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 ...