Im running on a NVIDIA Orin Nano Developer Kit - Jetpack 5.1.2 [L4T 35.4.1]
I’m trying to decode an h264 video from my connected Razer Kiyo Pro webcam. See below for its output capabilities.
When I use avdec_h264 in my pipeline, it all works, though this uses a good portion of my CPU (which i can not spare once this is integrated into my larger application)
gst-launch-1.0
v4l2src device=/dev/video1 ! video/x-h264, width=1920, height=1080, framerate=30/1 !
avdec_h264 !
nvvidconv !
x264enc tune=zerolatency ! h264parse ! rtph264pay config-interval=1 pt=126 !
udpsink host=192.168.8.179 port=10101
But when I run with nvv4l2decoder, the pipeline freezes with no errors
GST_DEBUG=3 gst-launch-1.0
v4l2src device=/dev/video1 ! video/x-h264, width=1920, height=1080, framerate=30/1 !
nvv4l2decoder ! ‘video/x-raw(memory:NVMM)’ ! nvvidconv ! video/x-raw,format=NV12 !
x264enc tune=zerolatency ! h264parse ! rtph264pay config-interval=1 pt=126 !
udpsink host=192.168.8.179 port=10101
Here is the output from the failing pipeline
GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-h264, width=1920, height=1080, framerate=30/1 ! nvv4l2decoder ! ‘video/x-raw(memory:NVMM)’ ! nvvidconv ! video/x-raw,format=NV12 ! x264enc tune=zerolatency ! h264parse ! rtph264pay config-interval=1 pt=126 ! udpsink host=192.168.8.179 port=10101
Setting pipeline to PAUSED …
Opening in BLOCKING MODE
0:00:00.341747144 46095 0xaaaaf0eb4150 WARN v4l2 gstv4l2object.c:4561:gst_v4l2_object_probe_caps:nvv4l2decoder0:src Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:00.341808138 46095 0xaaaaf0eb4150 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaaf0e7a020 Failed to determine interlace mode
0:00:00.341837547 46095 0xaaaaf0eb4150 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaaf0e7a020 Failed to determine interlace mode
0:00:00.341862891 46095 0xaaaaf0eb4150 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaaf0e7a020 Failed to determine interlace mode
0:00:00.341887660 46095 0xaaaaf0eb4150 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaaaf0e7a020 Failed to determine interlace mode
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
NvMMLiteOpen : Block : BlockType = 261
NvMMLiteBlockCreate : Block : BlockType = 261
0:00:00.363484452 46095 0xaaaaf0d77240 WARN v4l2bufferpool gstv4l2bufferpool.c:809:gst_v4l2_buffer_pool_start:v4l2src0:pool:src Uncertain or not enough buffers, enabling copy threshold
0:00:03.753000653 46095 0xaaaaf0d77240 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create: lost frames detected: count = 1 - ts: 0:00:03.409321483
0:00:06.817980627 46095 0xaaaaf0d77240 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create: lost frames detected: count = 1 - ts: 0:00:06.474416611
0:00:08.818281770 46095 0xaaaaf0d77240 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create: lost frames detected: count = 1 - ts: 0:00:08.474479643
0:00:10.818338806 46095 0xaaaaf0d77240 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create: lost frames detected: count = 1 - ts: 0:00:10.474544643
0:00:12.818435682 46095 0xaaaaf0d77240 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create: lost frames detected: count = 1 - ts: 0:00:12.474608803
0:00:14.818284131 46095 0xaaaaf0d77240 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create: lost frames detected: count = 1 - ts: 0:00:14.474678579
Why would the software decoder work but the hardware one not work when they have the same capabilities?
Here are the camera output options
beauceron@ubuntu:~$ v4l2-ctl --device=/dev/video1 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'YUYV' (YUYV 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
[1]: 'MJPG' (Motion-JPEG, compressed)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
[2]: 'H264' (H.264, compressed)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
[3]: 'NV12' (Y/CbCr 4:2:0)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)