How to use DeepStream nvv4l2h264enc

We’re trying to use the nvv4l2h264enc, doing something like this:

$ gst-launch-1.0 filesrc location=sample_720p.h264 ! h264parse ! 'video/x-h264,framerate=30/1,height=720,width=1280' ! nvv4l2decoder ! 'video/x-raw(memory:NVMM),framerate=30/1,height=720,width=1280' ! nvv4l2h264enc ! 'video/x-h264,framerate=30/1,height=720,width=1280' ! h264parse ! fakesink --gst-debug=3

The decoder works fine, but the encoder does not. We’ve tried adding videoconvert in the middle of decode and encode, with and without the h264parse, not using the decoder, using decodebin, and probably other things that I cant remember. The main error seems to be:

0:00:02.512619683   676 0x7fba20003f70 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30/1
0:00:02.512732551   676 0x55c02874f4f0 WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: Internal data stream error.
0:00:02.512762187   676 0x55c02874f4f0 WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3611): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.

I produced a diagram using GST_DEBUG_DUMP_DOT_DIR and it looks fine. (file attached)

I’m running the deepstream container, latest version, on ubuntu18.04 with rtx2080. Nvidia driver 430 with runtime 10.2 and 10.1 (both tried) on the host.

The whole errror output is:

Setting pipeline to PAUSED ...
0:00:01.177450616   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2h264enc0:sink> Unable to try format: Unknown error -1
0:00:01.177479246   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2h264enc0:sink> Could not probe minimum capture size for pixelformat YM12
0:00:01.177485936   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2h264enc0:sink> Unable to try format: Unknown error -1
0:00:01.177490605   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2h264enc0:sink> Could not probe maximum capture size for pixelformat YM12
0:00:01.177497166   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2370:gst_v4l2_object_add_interlace_mode:0x55d8c7515800 Failed to determine interlace mode
0:00:01.177519605   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2h264enc0:src> Unable to try format: Unknown error -1
0:00:01.177524073   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2h264enc0:src> Could not probe minimum capture size for pixelformat H264
0:00:01.177527572   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2h264enc0:src> Unable to try format: Unknown error -1
0:00:01.177531679   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2h264enc0:src> Could not probe maximum capture size for pixelformat H264
0:00:01.177824051   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:01.177846817   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat MJPG
0:00:01.177852139   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:01.177871913   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat MJPG
0:00:01.177885243   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:01.177890170   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat H265
0:00:01.177893716   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:01.177897526   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat H265
0:00:01.177906270   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:01.177916575   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat H264
0:00:01.177920234   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:01.177923944   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat H264
0:00:01.177938262   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:src> Unable to try format: Unknown error -1
0:00:01.177942630   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:src> Could not probe minimum capture size for pixelformat NM12
0:00:01.177946087   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:src> Unable to try format: Unknown error -1
0:00:01.177949979   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:src> Could not probe maximum capture size for pixelformat NM12
0:00:01.177954882   629 0x55d8c7593100 WARN                    v4l2 gstv4l2object.c:2370:gst_v4l2_object_add_interlace_mode:0x55d8c753e8d0 Failed to determine interlace mode
0:00:01.178248873   629 0x55d8c7593100 WARN                 basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<filesrc0> pad not activated yet
Pipeline is PREROLLING ...
0:00:01.387425837   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:01.387472089   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:01.387524711   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:01.387538159   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:01.387580972   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:01.387592929   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:01.387632443   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:01.387644837   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:01.387699325   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:01.387711026   629 0x55d8c7537cf0 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

Redistribute latency...
0:00:01.388641557   629 0x55d8c7537cf0 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30/1
0:00:01.388989251   629 0x55d8c7537cf0 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30/1
Redistribute latency...
0:00:01.389008015   629 0x55d8c7537cf0 WARN                GST_PADS gstpad.c:4226:gst_pad_peer_query:<capsfilter1:src> could not send sticky events
0:00:01.389133859   629 0x55d8c7537cf0 WARN            v4l2videodec gstv4l2videodec.c:1433:gst_v4l2_video_dec_decide_allocation:<nvv4l2decoder0> Duration invalid, not setting latency
0:00:01.389167527   629 0x55d8c7537cf0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1054:gst_v4l2_buffer_pool_start:<nvv4l2decoder0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:01.452135676   629 0x7f8118003f70 WARN          v4l2bufferpool gstv4l2bufferpool.c:1518:gst_v4l2_buffer_pool_dqbuf:<nvv4l2decoder0:pool:src> Driver should never set v4l2_buffer.field to ANY
0:00:01.452661421   629 0x7f8118003f70 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30/1
Redistribute latency...
Redistribute latency...
0:00:01.452986919   629 0x7f8118003f70 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30/1
Redistribute latency...
0:00:01.453305054   629 0x7f8118003f70 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30/1
0:00:01.453491692   629 0x55d8c7537cf0 WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: Internal data stream error.
0:00:01.453522503   629 0x55d8c7537cf0 WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3611): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
0:00:01.454066555   629 0x55d8c7537cf0 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1280, height=(int)720, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)bt709, framerate=(fraction)30/1
Freeing pipeline ...

Hi,
Please try

$ gst-launch-1.0 filesrc location= sample_720p.h264 ! h264parse ! nvv4l2decoder ! <b>nvvideoconvert</b> ! nvv4l2h264enc ! fakesink

Hi,
That fails with:

root@ea66f4650afe:~/deepstream_sdk_v4.0.1_x86_64/samples/streams# gst-launch-1.0 filesrc location= sample_720p.h264 ! h264parse ! nvv4l2decoder ! nvvideoconvert ! nvv4l2h264enc ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3611): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
root@ea66f4650afe:~/deepstream_sdk_v4.0.1_x86_64/samples/streams# gst-launch-1.0 filesrc location= sample_720p.h264 ! h264parse ! nvv4l2decoder ! nvvideoconvert ! nvv4l2h264enc ! fakesink --gst-debug=3
Setting pipeline to PAUSED ...
0:00:00.042095361   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2h264enc0:sink> Unable to try format: Unknown error -1
0:00:00.042108203   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2h264enc0:sink> Could not probe minimum capture size for pixelformat YM12
0:00:00.042112497   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2h264enc0:sink> Unable to try format: Unknown error -1
0:00:00.042135869   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2h264enc0:sink> Could not probe maximum capture size for pixelformat YM12
0:00:00.042140959   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2370:gst_v4l2_object_add_interlace_mode:0x55c05f92dc90 Failed to determine interlace mode
0:00:00.042196869   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2h264enc0:src> Unable to try format: Unknown error -1
0:00:00.042221647   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2h264enc0:src> Could not probe minimum capture size for pixelformat H264
0:00:00.042224848   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2h264enc0:src> Unable to try format: Unknown error -1
0:00:00.042246648   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2h264enc0:src> Could not probe maximum capture size for pixelformat H264
0:00:00.042385663   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:00.042393822   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat MJPG
0:00:00.042415174   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:00.042443452   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat MJPG
0:00:00.042473293   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:00.042478307   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat H265
0:00:00.042482131   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:00.042486038   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat H265
0:00:00.042495079   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:00.042499555   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe minimum capture size for pixelformat H264
0:00:00.042502576   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:sink> Unable to try format: Unknown error -1
0:00:00.042506278   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:sink> Could not probe maximum capture size for pixelformat H264
0:00:00.042522996   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:src> Unable to try format: Unknown error -1
0:00:00.042528166   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2919:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:src> Could not probe minimum capture size for pixelformat NM12
0:00:00.042541365   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:3033:gst_v4l2_object_get_nearest_size:<nvv4l2decoder0:src> Unable to try format: Unknown error -1
0:00:00.042547483   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2925:gst_v4l2_object_probe_caps_for_format:<nvv4l2decoder0:src> Could not probe maximum capture size for pixelformat NM12
0:00:00.042553262   117 0x55c05fbf7c70 WARN                    v4l2 gstv4l2object.c:2370:gst_v4l2_object_add_interlace_mode:0x55c05fb6e970 Failed to determine interlace mode
0:00:00.042663667   117 0x55c05fbf7c70 WARN                 basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<filesrc0> pad not activated yet
Pipeline is PREROLLING ...
0:00:00.204488812   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.204561468   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.204635107   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.204655312   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.204714638   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.204734135   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.204799910   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.204819178   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.204897430   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.204918134   117 0x55c05fb67a30 ERROR                   v4l2 gstv4l2object.c:2072:gst_v4l2_object_get_interlace_mode: Driver bug detected - check driver with v4l2-compliance from http://git.linuxtv.org/v4l-utils.git

0:00:00.206316567   117 0x55c05fb67a30 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Redistribute latency...
0:00:00.206727740   117 0x55c05fb67a30 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Redistribute latency...
0:00:00.206774265   117 0x55c05fb67a30 WARN                GST_PADS gstpad.c:4226:gst_pad_peer_query:<nvvideoconvert0:src> could not send sticky events
0:00:00.206999318   117 0x55c05fb67a30 WARN            v4l2videodec gstv4l2videodec.c:1433:gst_v4l2_video_dec_decide_allocation:<nvv4l2decoder0> Duration invalid, not setting latency
0:00:00.207055284   117 0x55c05fb67a30 WARN          v4l2bufferpool gstv4l2bufferpool.c:1054:gst_v4l2_buffer_pool_start:<nvv4l2decoder0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:00.208681311   117 0x55c05fb67f70 WARN          v4l2bufferpool gstv4l2bufferpool.c:1518:gst_v4l2_buffer_pool_dqbuf:<nvv4l2decoder0:pool:src> Driver should never set v4l2_buffer.field to ANY
0:00:00.209356604   117 0x55c05fb67f70 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Redistribute latency...
0:00:00.209774666   117 0x55c05fb67f70 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Redistribute latency...
0:00:00.210164291   117 0x55c05fb67f70 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Redistribute latency...
0:00:00.210345489   117 0x55c05fb67a30 WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: Internal data stream error.
0:00:00.210502037   117 0x55c05fb67a30 WARN               baseparse gstbaseparse.c:3611:gst_base_parse_loop:<h264parse0> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3611): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
0:00:00.211183986   117 0x55c05fb67a30 WARN            videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps:<nvv4l2h264enc0> rejected caps video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, format=(string)NV12, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Freeing pipeline ...

Attached is the diagram of a similar pipeline with many CAPSFILTERS that I tried, same error message.

Hi,
Please specify the caps and try again:

$ gst-launch-1.0 filesrc location= sample_720p.h264 ! h264parse ! nvv4l2decoder ! nvvideoconvert ! <b>'video/x-raw(memory:NVMM),format=I420'</b> ! nvv4l2h264enc ! fakesink

Hi,

Thanks, that works!
Which confuses me to be honest, and I was hoping that we could cleat this up before closing.

As we can see below, the pipline works with the I420 format, but fails with NV12 and P010_10LE. The latter is expected to fail since nvvideoconvert does not support the format, but I don’t see why NV12 fails? It’s supported by nvvideoconvert and nvv4l2h264enc and it what’s being returned from the decoder.

root@6aca6ba0dd5e:~/deepstream_sdk_v4.0.1_x86_64/samples/streams# gst-launch-1.0 filesrc location= sample_720p.h264 ! h264parse ! nvv4l2decoder ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=I420' ! nvv4l2h264enc ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:02.971889231
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
root@6aca6ba0dd5e:~/deepstream_sdk_v4.0.1_x86_64/samples/streams# gst-launch-1.0 filesrc location= sample_720p.h264 ! h264parse ! nvv4l2decoder ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=NV12' ! nvv4l2h264enc ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3611): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
root@6aca6ba0dd5e:~/deepstream_sdk_v4.0.1_x86_64/samples/streams# gst-launch-1.0 filesrc location= sample_720p.h264 ! h264parse ! nvv4l2decoder ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=P010_10LE' ! nvv4l2h264enc ! fakesink
WARNING: erroneous pipeline: could not link nvvideoconvert0 to nvv4l2h264enc0, nvvideoconvert0 can't handle caps video/x-raw(memory:NVMM), format=(string)P010_10LE

Hi,
We are unifying the releases between Jetson platforms and dGPUs. The plugins are with same name but the hardware is different and the firmware is different. Certain formats may work in Jetson platforms only. We will try to improve this.