I’m running on an NVIDIA Jetson Nano 4Gb Developer Kit with Jetpack 4.6.4 getting h264 video feed in with a Razer Kiyo Pro webcam.
The webcam has the following capabilities
Index : 2
Type : Video Capture
Pixel Format: 'H264' (compressed)
Name : H.264
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)
When I run this pipeline, it works (though i get a lot of warnings)
GST_DEBUG=3 gst-launch-1.0 \
v4l2src device=/dev/video0 ! video/x-h264, width=1920, height=1080, framerate=30/1 ! queue ! \
nvv4l2decoder ! nvvidconv ! \
videorate ! video/x-raw, framerate=30/1 ! videoscale ! video/x-raw, width=640, height=360 ! \
nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay config-interval=1 pt=126 ! \
udpsink host=192.168.8.179 port=10101
Which generates these warnings (and continues generating lost frame detected warnings) but does run
0:00:02.013450051 5801 0x5581a86090 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bb9200 Failed to determine interlace mode
0:00:02.013574113 5801 0x5581a86090 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bb9200 Failed to determine interlace mode
0:00:02.013654999 5801 0x5581a86090 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bb9200 Failed to determine interlace mode
0:00:02.013734322 5801 0x5581a86090 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bb9200 Failed to determine interlace mode
0:00:02.013910207 5801 0x5581a86090 WARN v4l2 gstv4l2object.c:4476:gst_v4l2_object_probe_caps:<nvv4l2h264enc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Opening in BLOCKING MODE
0:00:02.070755832 5801 0x5581a86090 WARN v4l2 gstv4l2object.c:4476:gst_v4l2_object_probe_caps:<nvv4l2decoder0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:02.070823176 5801 0x5581a86090 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bc3e00 Failed to determine interlace mode
0:00:02.070879843 5801 0x5581a86090 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bc3e00 Failed to determine interlace mode
0:00:02.070984061 5801 0x5581a86090 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bc3e00 Failed to determine interlace mode
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
0:00:02.095480884 5801 0x5581c27e80 WARN v4l2bufferpool gstv4l2bufferpool.c:790:gst_v4l2_buffer_pool_start:<v4l2src0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:02.550317551 5801 0x5581c0a990 WARN v4l2 gstv4l2object.c:4476:gst_v4l2_object_probe_caps:<nvv4l2decoder0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:02.550375311 5801 0x5581c0a990 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bc3e00 Failed to determine interlace mode
0:00:02.550417499 5801 0x5581c0a990 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bc3e00 Failed to determine interlace mode
0:00:02.550454478 5801 0x5581c0a990 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5581bc3e00 Failed to determine interlace mode
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
0:00:02.562014061 5801 0x5581c0a990 WARN v4l2bufferpool gstv4l2bufferpool.c:1087:gst_v4l2_buffer_pool_start:<nvv4l2h264enc0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:02.562607186 5801 0x5581c0a990 WARN v4l2videodec gstv4l2videodec.c:1755:gst_v4l2_video_dec_decide_allocation:<nvv4l2decoder0> Duration invalid, not setting latency
0:00:02.571815571 5801 0x5581c0a990 WARN v4l2bufferpool gstv4l2bufferpool.c:1087:gst_v4l2_buffer_pool_start:<nvv4l2decoder0:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:02.583467811 5801 0x7f8400bf20 WARN v4l2bufferpool gstv4l2bufferpool.c:1536:gst_v4l2_buffer_pool_dqbuf:<nvv4l2decoder0:pool:src> Driver should never set v4l2_buffer.field to ANY
H264: Profile = 66, Level = 0
0:00:02.603587915 5801 0x7f8400c680 WARN v4l2bufferpool gstv4l2bufferpool.c:1536:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:src> Driver should never set v4l2_buffer.field to ANY
0:00:04.518498644 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:02.437624451
0:00:05.050583175 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:02.937618867
0:00:05.085580466 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:02.970119180
0:00:05.118078435 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:03.005120388
0:00:05.150607966 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:03.037619128
0:00:05.185608539 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:03.070117024
0:00:05.218086091 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:03.105115868
0:00:05.218233487 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:03.137617180
0:00:06.344575172 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:04.232857159
0:00:06.378160233 5801 0x5581c27e80 WARN v4l2src gstv4l2src.c:976:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:04.264054210
When I change to this pipeline (only difference is 60fps)
GST_DEBUG=3 gst-launch-1.0 \
v4l2src device=/dev/video0 ! video/x-h264, width=1920, height=1080, framerate=60/1 ! queue ! \
nvv4l2decoder ! nvvidconv ! \
videorate ! video/x-raw, framerate=30/1 ! videoscale ! video/x-raw, width=640, height=360 ! \
nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay config-interval=1 pt=126 ! \
udpsink host=192.168.8.179 port=10101
Then it generates these logs and stops
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
0:00:00.555551374 5936 0x55634a2c90 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x556347bd50 Failed to determine interlace mode
0:00:00.555632017 5936 0x55634a2c90 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x556347bd50 Failed to determine interlace mode
0:00:00.555724800 5936 0x55634a2c90 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x556347bd50 Failed to determine interlace mode
0:00:00.555772845 5936 0x55634a2c90 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x556347bd50 Failed to determine interlace mode
0:00:00.555872292 5936 0x55634a2c90 WARN v4l2 gstv4l2object.c:4476:gst_v4l2_object_probe_caps:<nvv4l2h264enc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Opening in BLOCKING MODE
0:00:00.599220241 5936 0x55634a2c90 WARN v4l2 gstv4l2object.c:4476:gst_v4l2_object_probe_caps:<nvv4l2decoder0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:00.599307031 5936 0x55634a2c90 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5563466ac0 Failed to determine interlace mode
0:00:00.599360707 5936 0x55634a2c90 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5563466ac0 Failed to determine interlace mode
0:00:00.599421047 5936 0x55634a2c90 WARN v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x5563466ac0 Failed to determine interlace mode
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.604057516 5936 0x556349b140 WARN basesrc gstbasesrc.c:3055:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:00.604090528 5936 0x556349b140 WARN basesrc gstbasesrc.c:3055:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.001178645
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
beauceron@beauceron:~$
The Jetson Nano is supposed to be able to decode h264 at 4k60fps, so why not 1080p60fps?