Hello, I recently attempted to build a hardware-encoded RTSP service using GStreamer on the Jetson Orin Nx and encountered some issues. It would be greatly appreciated if you could provide some troubleshooting insights.
Platform Information:
USB Camera Details:
Software Encoding Test:
xxx@ubuntu:~/gst-rtsp-server-1.16.3/examples$ GST_DEBUG=3 ./test-launch "videotestsrc ! video/x-raw,width=640,height=480,framerate=30/1 ! videoconvert ! x264enc tune=zerolatency ! rtph264pay name=pay0 pt=96"
stream ready at rtsp://127.0.0.1:8554/test
0:00:04.668716192 42335 0xffffa400e460 FIXME default gstutils.c:3980:gst_pad_create_stream_id_internal:<videotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:04.703048832 42335 0xaaaaeca9e860 FIXME rtspmedia rtsp-media.c:4201:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:04.704353920 42335 0xaaaaeca9e860 FIXME rtspmedia rtsp-media.c:4201:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:04.704391424 42335 0xaaaaeca9e860 WARN rtspmedia rtsp-media.c:4227:gst_rtsp_media_suspend: media 0xffffac0411e0 was not prepared
0:00:04.708347104 42335 0xaaaaeca9e860 FIXME rtspclient rtsp-client.c:1818:handle_play_request:<GstRTSPClient@0xaaaaeca995d0> Add support for seek style (null)
==============================================================================================================================================================================
xxx@ubuntu:~/gst-rtsp-server-1.16.3/examples$ GST_DEBUG=3 ./test-launch "v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=60/1 ! videoconvert ! video/x-raw,format=I420 ! x264enc tune=zerolatency ! rtph264pay name=pay0 pt=96"
stream ready at rtsp://127.0.0.1:8554/test
0:00:06.907428576 38909 0xaaaade727860 FIXME rtspmedia rtsp-media.c:4201:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:06.909641031 38909 0xaaaade727860 FIXME rtspmedia rtsp-media.c:4201:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:06.909715080 38909 0xaaaade727860 WARN rtspmedia rtsp-media.c:4227:gst_rtsp_media_suspend: media 0xffffb404c220 was not prepared
0:00:06.915983677 38909 0xaaaade727860 FIXME rtspclient rtsp-client.c:1818:handle_play_request:<GstRTSPClient@0xaaaade7225d0> Add support for seek style (null)
0:00:06.916080861 38909 0xaaaade727860 FIXME rtspmedia rtsp-media.c:2711:gst_rtsp_media_seek_full:<GstRTSPMedia@0xffffb404c220> Handle going back to 0 for none live not seekable streams.
0:00:18.730400637 38909 0xffffac00e460 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:12.668209285
0:00:22.686792061 38909 0xffffac00e460 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:16.618113349
0:00:23.280293117 38909 0xffffac00e460 WARN v4l2src gstv4l2src.c:978:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:17.218097605
Result: Playable normally via VLC.
Hardware Encoding Test:
xxx@ubuntu:~/gst-rtsp-server-1.16.3/examples$ GST_DEBUG=3 ./test-launch "videotestsrc ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! nvvidconv ! video/x-raw(memory:NVMM),format=(string)I420 ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96"
stream ready at rtsp://127.0.0.1:8554/test
Opening in BLOCKING MODE
0:00:12.766426593 39704 0xaaaaf3851b00 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffffa419ec20 Failed to determine interlace mode
0:00:12.766498529 39704 0xaaaaf3851b00 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffffa419ec20 Failed to determine interlace mode
0:00:12.766525729 39704 0xaaaaf3851b00 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffffa419ec20 Failed to determine interlace mode
0:00:12.766547201 39704 0xaaaaf3851b00 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffffa419ec20 Failed to determine interlace mode
0:00:12.766622401 39704 0xaaaaf3851b00 WARN v4l2 gstv4l2object.c:4561:gst_v4l2_object_probe_caps:<nvv4l2h264enc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:12.767443937 39704 0xffff7800f4c0 FIXME default gstutils.c:3980:gst_pad_create_stream_id_internal:<videotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
0:00:12.770273153 39704 0xffff7800f4c0 WARN v4l2bufferpool gstv4l2bufferpool.c:1114:gst_v4l2_buffer_pool_start:<nvv4l2h264enc0:pool:src> Uncertain or not enough buffers, enabling copy threshold
H264: Profile = 66, Level = 0
NVMEDIA: Need to set EMC bandwidth : 126000
NvVideo: bBlitMode is set to TRUE
0:00:12.783189537 39704 0xffff7800f5e0 WARN v4l2bufferpool gstv4l2bufferpool.c:1565:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:src> Driver should never set v4l2_buffer.field to ANY
0:00:12.784922241 39704 0xaaaaf3851860 FIXME rtspmedia rtsp-media.c:4201:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:12.785869281 39704 0xaaaaf3851860 FIXME rtspmedia rtsp-media.c:4201:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:12.785908289 39704 0xaaaaf3851860 WARN rtspmedia rtsp-media.c:4227:gst_rtsp_media_suspend: media 0xffffa41c7250 was not prepared
0:00:12.837420417 39704 0xaaaaf3851860 ERROR rtspclient rtsp-client.c:1882:handle_play_request: client 0xaaaaf384c700: media not found
0:00:12.838569377 39704 0xaaaaf3851860 ERROR rtspclient rtsp-client.c:1432:handle_teardown_request: client 0xaaaaf384c700: no media for uri
0:00:12.850406817 39704 0xaaaaf3851860 WARN rtspmedia rtsp-media.c:4520:gst_rtsp_media_set_state: media 0xffffa41c7250 was not prepared
Opening in BLOCKING MODE
0:00:15.257646881 39704 0xffffa4003de0 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff64003370 Failed to determine interlace mode
0:00:15.257700385 39704 0xffffa4003de0 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff64003370 Failed to determine interlace mode
0:00:15.257728737 39704 0xffffa4003de0 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff64003370 Failed to determine interlace mode
0:00:15.257751745 39704 0xffffa4003de0 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff64003370 Failed to determine interlace mode
0:00:15.257805409 39704 0xffffa4003de0 WARN v4l2 gstv4l2object.c:4561:gst_v4l2_object_probe_caps:<nvv4l2h264enc1:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:15.258687777 39704 0xaaaaf3851760 FIXME default gstutils.c:3980:gst_pad_create_stream_id_internal:<videotestsrc1:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
0:00:15.260850689 39704 0xaaaaf3851760 WARN v4l2bufferpool gstv4l2bufferpool.c:1114:gst_v4l2_buffer_pool_start:<nvv4l2h264enc1:pool:src> Uncertain or not enough buffers, enabling copy threshold
H264: Profile = 66, Level = 0
NVMEDIA: Need to set EMC bandwidth : 126000
NvVideo: bBlitMode is set to TRUE
0:00:15.274103777 39704 0xaaaaf3851aa0 WARN v4l2bufferpool gstv4l2bufferpool.c:1565:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc1:pool:src> Driver should never set v4l2_buffer.field to ANY
0:00:15.275241345 39704 0xffffa4003460 FIXME rtspmedia rtsp-media.c:4201:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:15.276842241 39704 0xffffa4003460 FIXME rtspmedia rtsp-media.c:4201:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:00:15.276877857 39704 0xffffa4003460 WARN rtspmedia rtsp-media.c:4227:gst_rtsp_media_suspend: media 0xffff640111c0 was not prepared
0:00:15.281307201 39704 0xffffa4003460 FIXME rtspclient rtsp-client.c:1818:handle_play_request:<GstRTSPClient@0xaaaaf384c960> Add support for seek style (null)
0:00:15.281365921 39704 0xffffa4003460 FIXME rtspmedia rtsp-media.c:2711:gst_rtsp_media_seek_full:<GstRTSPMedia@0xffff640111c0> Handle going back to 0 for none live not seekable streams.
==============================================================================================================================================================================
xxx@ubuntu:~/gst-rtsp-server-1.16.3/examples$ GST_DEBUG=3 ./test-launch "v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! nvvidconv ! video/x-raw(memory:NVMM),format=(string)I420 ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96"
stream ready at rtsp://127.0.0.1:8554/test
Opening in BLOCKING MODE
0:00:10.921622381 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff9c1a5e00 Failed to determine interlace mode
0:00:10.921702610 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff9c1a5e00 Failed to determine interlace mode
0:00:10.921729396 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff9c1a5e00 Failed to determine interlace mode
0:00:10.921750517 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff9c1a5e00 Failed to determine interlace mode
0:00:10.921838075 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:4561:gst_v4l2_object_probe_caps:<nvv4l2h264enc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:11.118833609 43668 0xffff7400f4c0 WARN basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:11.118880076 43668 0xffff7400f4c0 WARN basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
0:00:11.118982098 43668 0xffff9c003460 WARN rtspmedia rtsp-media.c:3001:default_handle_message: 0xffff9c1cd260: got error Internal data stream error. (gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:media-pipeline/GstBin:bin0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4))
0:00:11.119026293 43668 0xaaaae65a4860 WARN rtspmedia rtsp-media.c:3272:wait_preroll: failed to preroll pipeline
0:00:11.119057239 43668 0xaaaae65a4860 WARN rtspmedia rtsp-media.c:3652:gst_rtsp_media_prepare: failed to preroll pipeline
0:00:11.121733819 43668 0xaaaae65a4860 ERROR rtspclient rtsp-client.c:1077:find_media: client 0xaaaae659f5d0: can't prepare media
0:00:11.122072048 43668 0xaaaae65a4860 ERROR rtspclient rtsp-client.c:2963:handle_describe_request: client 0xaaaae659f5d0: no media
Opening in BLOCKING MODE
0:00:11.157843553 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff9c1aa830 Failed to determine interlace mode
0:00:11.157895364 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff9c1aa830 Failed to determine interlace mode
0:00:11.157921286 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff9c1aa830 Failed to determine interlace mode
0:00:11.157942887 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xffff9c1aa830 Failed to determine interlace mode
0:00:11.157994474 43668 0xffff9c003460 WARN v4l2 gstv4l2object.c:4561:gst_v4l2_object_probe_caps:<nvv4l2h264enc1:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Opening in BLOCKING MODE
0:00:11.189076316 43668 0xffff7400f4c0 WARN basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src1> error: Internal data stream error.
0:00:11.189109182 43668 0xffff7400f4c0 WARN basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src1> error: streaming stopped, reason not-negotiated (-4)
0:00:11.189208516 43668 0xffff9c003460 WARN rtspmedia rtsp-media.c:3001:default_handle_message: 0xffff9c1cd440: got error Internal data stream error. (gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:media-pipeline/GstBin:bin1/GstV4l2Src:v4l2src1:
streaming stopped, reason not-negotiated (-4))
0:00:11.189252038 43668 0xaaaae65a4860 WARN rtspmedia rtsp-media.c:3272:wait_preroll: failed to preroll pipeline
0:00:11.189272552 43668 0xaaaae65a4860 WARN rtspmedia rtsp-media.c:3652:gst_rtsp_media_prepare: failed to preroll pipeline
0:00:11.191459982 43668 0xaaaae65a4860 ERROR rtspclient rtsp-client.c:1077:find_media: client 0xaaaae659f700: can't prepare media
0:00:11.191777313 43668 0xaaaae65a4860 ERROR rtspclient rtsp-client.c:2692:handle_setup_request: client 0xaaaae659f700: media '/test' not found
Result:
- When using
videotestsrc, VLC fails to open the stream properly on the first attempt but succeeds on the second attempt. - When using
v4l2src device=/dev/video0, VLC cannot open the stream normally.
Could you help me diagnose where the problem might lie?



