Hi,
I have confirmed this issue on a xavier box running Jetson 4.2.1 + DeepStream 4.0.
Here’s a test case.
GST_DEBUG=2,v4l2*=7 ./test-launch "videotestsrc num-buffers=9000 is-live=true ! video/x-raw,width=(int)1920,height=(int)1080,framerate=30/1,format=NV12 ! nvvideoconvert ! video/x-raw(memory:NVMM),width=(int)1920,height=(int)1080,framerate=30/1,format=NV12 ! nvv4l2h264enc bufapi-version=True ! h264parse ! rtph264pay name=pay0"
This will crash when you access from a client. For example,
gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test ! rtph264depay ! queue ! h264parse ! nvv4l2decoder bufapi-version=True ! nvvideoconvert ! "video/x-raw(memory:NVMM),format=RGBA" ! nvegltransform ! nveglglessink sync=False
Here’s such a crash log.
stream ready at rtsp://127.0.0.1:8554/test
Opening in BLOCKING MODE
0:00:02.964636578 2533 0x7f7800b630 WARN v4l2 gstv4l2object.c:2355:gst_v4l2_object_add_interlace_mode:0x7f780e4040 Failed to determine interlace mode
0:00:02.964782380 2533 0x7f7800b630 WARN v4l2 gstv4l2object.c:2355:gst_v4l2_object_add_interlace_mode:0x7f780e4040 Failed to determine interlace mode
0:00:02.964950456 2533 0x7f7800b630 WARN v4l2 gstv4l2object.c:4431:gst_v4l2_object_probe_caps:<nvv4l2h264enc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
in videoconvert caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12
(test-launch:2533): GLib-GObject-WARNING **: 16:26:49.572: invalid cast from 'nvv4l2h264enc' to 'GstNvV4l2VideoDec'
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
0:00:03.092726665 2533 0x7f58005d90 WARN v4l2bufferpool gstv4l2bufferpool.c:1066:gst_v4l2_buffer_pool_start:<nvv4l2h264enc0:pool:src> Uncertain or not enough buffers, enabling copy threshold
H264: Profile = 66, Level = 0
0:00:03.267662450 2533 0x7f5c003370 WARN v4l2bufferpool gstv4l2bufferpool.c:1655:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:src> Driver should never set v4l2_buffer.field to ANY
0:00:03.283406269 2533 0x55801dbd90 WARN rtspmedia rtsp-media.c:3861:gst_rtsp_media_suspend: media 0x7f7810c290 was not prepared
(test-launch:2533): GStreamer-CRITICAL **: 16:26:49.916: gst_structure_set: assertion 'IS_MUTABLE (structure) || field == NULL' failed
(test-launch:2533): GStreamer-CRITICAL **: 16:26:49.917: gst_structure_set: assertion 'IS_MUTABLE (structure) || field == NULL' failed
(test-launch:2533): GLib-GObject-WARNING **: 16:26:49.953: invalid cast from 'nvv4l2h264enc' to 'GstNvV4l2VideoDec'
0:00:03.355453918 2533 0x7f58005d90 WARN v4l2bufferpool gstv4l2bufferpool.c:1600:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:03.355569638 2533 0x7f58005d90 WARN v4l2bufferpool gstv4l2bufferpool.c:1600:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:03.388709453 2533 0x7f58005d90 WARN v4l2bufferpool gstv4l2bufferpool.c:1600:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:03.388890074 2533 0x7f58005d90 WARN v4l2bufferpool gstv4l2bufferpool.c:1600:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
Segmentation fault (core dumped)
After investigations, I found there was a bug filed as 796525 in GStreamer.
https://bugzilla.gnome.org/show_bug.cgi?id=796525
But this was fixed in 1.14.2, which is older than the one installed on Jetson 4.2.1.
I am wondering if nvv4l2 encoders came from older v4l2 encoders, and are not yet fixed?
Thanks.