Can not do h264parse

HI everyone,
i have DJI drone ( with 2 camera: 1. fpv 2. h20)
the drone has xavier nx nvidia release 32.5.1.
xaviar has ubuntu 18 with arm64 architecture.

i have c code with dji drone API to get h264stream.
my pipe is:

“(appsrc name=mysrc ! h264parse ! nvv4l2decoder enable-max-performance=1 ! nvvidconv ! video/x-raw(memory:NVMM), width=%d, height=%d, format=NV12 ! nvv4l2h264enc control-rate=1 bitrate=%d peak-bitrate=%d ! video/x-h264, profile=baseline ! rtph264pay pt=96 name=pay0 )”

my problem is: this pipeline work on fpv camera BUT NOT ON H20 camera
i debug it few day and i found that when i want to stream h20 camera:
i get this:

...
> ===== NVMEDIA: NVENC =====
> NvMMLiteBlockCreate : Block : BlockType = 4 
> 0:00:01.743227040 11570   0x7f6000af20 WARN          v4l2bufferpool gstv4l2bufferpool.c:1065:gst_v4l2_buffer_pool_start:<nvv4l2h264enc0:pool:src> Uncertain or not enough buffers, enabling copy threshold
> 0:00:01.744026784 11570   0x7f6000af20 WARN            v4l2videodec gstv4l2videodec.c:1673:gst_v4l2_video_dec_decide_allocation:<nvv4l2decoder0> Duration invalid, not setting latency
> 0:00:01.762063776 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:848:gst_h264_parser_parse_buffering_period: failed to read UE
> 0:00:01.762145248 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:892:gst_h264_parser_parse_buffering_period: error parsing "Buffering period"
> 0:00:01.762181184 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1188:gst_h264_parser_parse_sei_message: Bit non equal to one.
> 0:00:01.762211232 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero.
> 0:00:01.762236768 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero.
> 0:00:01.762303328 11570   0x7f6000af20 WARN               h264parse gsth264parse.c:531:gst_h264_parse_process_sei:<h264parse0> failed to parse one or more SEI message
> 0:00:01.763983200 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:848:gst_h264_parser_parse_buffering_period: failed to read UE
> 0:00:01.764033408 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:892:gst_h264_parser_parse_buffering_period: error parsing "Buffering period"
> 0:00:01.764064288 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1188:gst_h264_parser_parse_sei_message: Bit non equal to one.
> 0:00:01.764090816 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero.
> 0:00:01.764115584 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero.
> 0:00:01.764146624 11570   0x7f6000af20 WARN               h264parse gsth264parse.c:531:gst_h264_parse_process_sei:<h264parse0> failed to parse one or more SEI message
> 0:00:01.765765792 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:848:gst_h264_parser_parse_buffering_period: failed to read UE
> 0:00:01.765830880 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:892:gst_h264_parser_parse_buffering_period: error parsing "Buffering period"
> 0:00:01.765859776 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1188:gst_h264_parser_parse_sei_message: Bit non equal to one.
> 0:00:01.765882688 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero.
> 0:00:01.765903136 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero.
> 0:00:01.765960320 11570   0x7f6000af20 WARN               h264parse gsth264parse.c:531:gst_h264_parse_process_sei:<h264parse0> failed to parse one or more SEI message
> 0:00:01.767234752 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:848:gst_h264_parser_parse_buffering_period: failed to read UE
> 0:00:01.767278048 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:892:gst_h264_parser_parse_buffering_period: error parsing "Buffering period"
> 0:00:01.767344544 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1188:gst_h264_parser_parse_sei_message: Bit non equal to one.
> 0:00:01.767364320 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero.
> 0:00:01.767437536 11570   0x7f6000af20 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero

a lot of warnings comes until i stop the pipeline
i seems that the h264 stream that i get from the camera does not well…
i try it with few h20 cameras …but same…

i try without h264parse:

“(appsrc name=mysrc ! nvv4l2decoder enable-max-performance=1 ! nvvidconv ! video/x-raw(memory:NVMM), width=%d, height=%d, format=NV12 ! nvv4l2h264enc control-rate=1 bitrate=%d peak-bitrate=%d ! video/x-h264, profile=baseline ! rtph264pay pt=96 name=pay0 )”

but it doesnot work becouse i get h264stream via DJI API …
for fpv camera works good… what happen ?
thanks for helpers :)

Hi,
Please set config-interval property and try again:

... ! h264parse config-interval=1 ! ...

The property is to send SPS/PPS in interval:

  config-interval     : Send SPS and PPS Insertion Interval in seconds (sprop parameter sets will be multiplexed in the data stream when detected.) (0 = disabled, -1 = send with every IDR frame)
                        flags: readable, writable
                        Integer. Range: -1 - 3600 Default: 0

Probably SPS/PPS is missing and setting it may help.

Hi @DaneLLL thank you, i added it But i still get the same WARN :

0:00:01.900652036 13735   0x7f4c006720 WARN       codecparsers_h264 gsth264parser.c:848:gst_h264_parser_parse_buffering_period: failed to read UE
0:00:01.900722916 13735   0x7f4c006720 WARN       codecparsers_h264 gsth264parser.c:892:gst_h264_parser_parse_buffering_period: error parsing "Buffering period"
0:00:01.900811013 13735   0x7f4c006720 WARN       codecparsers_h264 gsth264parser.c:1188:gst_h264_parser_parse_sei_message: Bit non equal to one.
0:00:01.900847077 13735   0x7f4c006720 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero.
0:00:01.900875333 13735   0x7f4c006720 WARN       codecparsers_h264 gsth264parser.c:1194:gst_h264_parser_parse_sei_message: Bit non equal to zero.
0:00:01.900911781 13735   0x7f4c006720 WARN               h264parse gsth264parse.c:531:gst_h264_parse_process_sei:<h264parse0> failed to parse one or more SEI mess

its weird, because another camera works …

when i try the 2 camera on my PC (intel amd64 processor) , it works both cameras…

@DaneLLL , Hi,
i just added enable-max-performance=1 for nvv4l2decoder and as magic it works great!
the pipeline:
appsrc name=mysrc ! h264parse ! nvv4l2decoder enable-max-performance=1 ! nvvidconv ! video/x-raw(memory:NVMM), width=%d, height=%d, format=NV12 ! nvv4l2h264enc control-rate=1 bitrate=%d peak-bitrate=%d ! video/x-h264, profile=baseline ! rtph264pay pt=96 name=pay0 "

i still have WARN like i wrote above …
do you have any explanation why it happened ?

i looked on this post: https://forums.developer.nvidia.com/t/nvv4l2decoder-connot-decode-h264-gdr-file/154401/13
and i tried your solution…

i do have the problem with ffmpeg:

> [h264 @ 0x55a975e5b0] Missing reference picture, default is 0
> [h264 @ 0x55a975e5b0] decode_slice_header error
> [h264 @ 0x55a975e5b0] SEI type 1 size 1040 truncated at 848
> [h264 @ 0x55a975e5b0] SEI type 1 size 1040 truncated at 832
> [h264 @ 0x55a975e5b0] SEI type 1 size 1040 truncated at 848
> [h264 @ 0x55a975e5b0] SEI type 1 size 1040 truncated at 832
> [h264 @ 0x55a975e5b0] SEI type 1 size 1040 truncated at 848
> [h264 @ 0x55a975e5b0] SEI type 1 size 1040 truncated at 832

please can you explain to me why it works now ?

Hi,
Not sure why it helps with enable-max-performance=1. The option is to run hardware decoder in max clock, but the issues seems to be that sppsrc does not feed complete bitstream to decoder.

It should be fine to set enable-max-performance=1. If it works with it, please keep the setting.

1 Like