Jetson nano RTSP capture issue

I am writing code on my jetson nano developer kit to capture rtsp stream using GitHub - dusty-nv/jetson-utils: C++/Python Linux utility wrappers for NVIDIA Jetson - camera, codecs, CUDA, GStreamer, HID, OpenGL/XGL. Here is my code:

#include <stdio.h>

#include <jetson-utils/gstBufferManager.h>
#include <jetson-utils/gstDecoder.h>
#include <jetson-utils/gstUtility.h>
#include <jetson-utils/cudaResize.h>

#include <cuda_runtime.h>

int main (void)
{
    videoOptions opts;
    opts.resource = "rtsp://admin:adminadmin12@192.168.1.108:554/RVi/1/1";
    opts.width = 1920;
    opts.height = 1080;
    opts.frameRate = 25.0;
    opts.bitRate = 4096;
    opts.numBuffers = 4; // CHANGE?
    opts.zeroCopy = true;
    opts.rtspLatency = 2000;
    opts.deviceType = opts.DEVICE_IP;
    opts.codec = opts.CODEC_H264;

    void * dev_ptr;
    gstDecoder * decoder = gstDecoder::Create(opts);
    decoder->Open();
    imageFormat format = IMAGE_RGB8;

    decoder->Capture(&dev_ptr,format,18446744073709551615UL);


}

logs :

Blockquote

[gstreamer] initialized gstreamer, version 1.14.5.0
[gstreamer] gstDecoder – creating decoder for admin:adminadmin12@192.168.1.108
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
[gstreamer] gstDecoder – discovered video resolution: 1920x1080 (framerate 0.000000 Hz)
[gstreamer] gstDecoder – discovered video caps: video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)4.2, profile=(string)baseline, width=(int)1920, height=(int)1080, framerate=(fraction)0/1, interlace-mode=(string)progressive, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true
[gstreamer] gstDecoder – pipeline string:
[gstreamer] rtspsrc location=rtsp://admin:adminadmin12@192.168.1.108:554/RVi/1/1 latency=2000 ! queue ! rtph264depay ! h264parse ! omxh264dec ! video/x-raw(memory:NVMM) ! videorate drop-only=true max-rate=25 ! appsink name=mysink
[gstreamer] opening gstDecoder for streaming, transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> videorate0
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter1
[gstreamer] gstreamer changed state from NULL to READY ==> omxh264dec-omxh264dec0
[gstreamer] gstreamer changed state from NULL to READY ==> h264parse1
[gstreamer] gstreamer changed state from NULL to READY ==> rtph264depay1
[gstreamer] gstreamer changed state from NULL to READY ==> queue0
[gstreamer] gstreamer changed state from NULL to READY ==> rtspsrc0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer changed state from READY to PAUSED ==> videorate0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter1
[gstreamer] gstreamer changed state from READY to PAUSED ==> omxh264dec-omxh264dec0
[gstreamer] gstreamer changed state from READY to PAUSED ==> h264parse1
[gstreamer] gstreamer changed state from READY to PAUSED ==> rtph264depay1
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> queue0
[gstreamer] gstreamer message progress ==> rtspsrc0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> rtspsrc0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer message new-clock ==> pipeline0
[gstreamer] gstreamer message progress ==> rtspsrc0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> videorate0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> omxh264dec-omxh264dec0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> h264parse1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> rtph264depay1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> queue0
[gstreamer] gstreamer message progress ==> rtspsrc0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> rtspsrc0
[gstreamer] gstreamer message progress ==> rtspsrc0

(test_jetson_utils:17684): GStreamer-CRITICAL **: 10:24:56.991: gst_caps_is_empty: assertion ‘GST_IS_CAPS (caps)’ failed

(test_jetson_utils:17684): GStreamer-CRITICAL **: 10:24:56.991: gst_caps_truncate: assertion ‘GST_IS_CAPS (caps)’ failed

(test_jetson_utils:17684): GStreamer-CRITICAL **: 10:24:56.991: gst_caps_fixate: assertion ‘GST_IS_CAPS (caps)’ failed

(test_jetson_utils:17684): GStreamer-CRITICAL **: 10:24:56.991: gst_caps_get_structure: assertion ‘GST_IS_CAPS (caps)’ failed

(test_jetson_utils:17684): GStreamer-CRITICAL **: 10:24:56.991: gst_structure_get_string: assertion ‘structure != NULL’ failed

(test_jetson_utils:17684): GStreamer-CRITICAL **: 10:24:56.991: gst_mini_object_unref: assertion ‘mini_object != NULL’ failed
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Allocating new output: 1920x1088 (x 11), ThumbnailMode = 0
OPENMAX: HandleNewStreamFormat: 3605: Send OMX_EventPortSettingsChanged: nFrameWidth = 1920, nFrameHeight = 1080
[gstreamer] gstDecoder – onPreroll()
[gstreamer] gstreamer message progress ==> rtspsrc0
[gstreamer] gstreamer message progress ==> rtspsrc0
[gstreamer] gstreamer changed state from NULL to READY ==> manager
[gstreamer] gstreamer changed state from READY to PAUSED ==> manager
[gstreamer] gstreamer changed state from NULL to READY ==> rtpssrcdemux1
[gstreamer] gstreamer changed state from READY to PAUSED ==> rtpssrcdemux1
[gstreamer] gstreamer changed state from NULL to READY ==> rtpsession1
[gstreamer] gstreamer changed state from READY to PAUSED ==> rtpsession1
[gstreamer] gstreamer changed state from NULL to READY ==> funnel2
[gstreamer] gstreamer changed state from READY to PAUSED ==> funnel2
[gstreamer] gstreamer changed state from NULL to READY ==> funnel3
[gstreamer] gstreamer changed state from READY to PAUSED ==> funnel3
[gstreamer] gstreamer changed state from NULL to READY ==> rtpstorage1
[gstreamer] gstreamer changed state from READY to PAUSED ==> rtpstorage1
[gstreamer] gstreamer message progress ==> rtspsrc0
[gstreamer] gstreamer changed state from NULL to READY ==> udpsink2
[gstreamer] gstreamer changed state from READY to PAUSED ==> udpsink2
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> udpsink2
[gstreamer] gstreamer changed state from NULL to READY ==> fakesrc1
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> fakesrc1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> fakesrc1
[gstreamer] gstreamer message progress ==> rtspsrc0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> rtpssrcdemux1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> rtpstorage1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> rtpsession1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> funnel2
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> funnel3
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> manager
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> udpsrc4
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> udpsrc4
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> udpsrc5
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> udpsrc5
[gstreamer] gstreamer message progress ==> rtspsrc0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer changed state from NULL to READY ==> rtpptdemux1
[gstreamer] gstreamer changed state from READY to PAUSED ==> rtpptdemux1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> rtpptdemux1
[gstreamer] gstreamer changed state from NULL to READY ==> rtpjitterbuffer1
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> rtpjitterbuffer1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> rtpjitterbuffer1
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer message stream-start ==> pipeline0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer mysink taglist, video-codec=(string)“H.264\ (Baseline\ Profile)”;
[gstreamer] gstBufferManager – map buffer size was less than max size (1008 vs 3110400)
[gstreamer] gstBufferManager recieve caps: video/x-raw(memory:NVMM), format=(string)NV12, width=(int)1920, height=(int)1080, 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)0/1
[gstreamer] gstBufferManager – recieved first frame, codec=h264 format=nv12 width=1920 height=1080 size=3110400
[gstreamer] gstBufferManager – recieved NVMM memory
[gstreamer] gstreamer changed state from READY to PAUSED ==> mysink
[gstreamer] gstreamer message async-done ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> mysink
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> pipeline0
nvbuf_utils: dmabuf_fd 1065 mapped entry NOT found
nvbuf_utils: NvReleaseFd Failed… Exiting…
nvbuf_utils: dmabuf_fd 1067 mapped entry NOT found
nvbuf_utils: NvReleaseFd Failed… Exiting…
nvbuf_utils: dmabuf_fd 1069 mapped entry NOT found
nvbuf_utils: NvReleaseFd Failed… Exiting…
nvbuf_utils: dmabuf_fd 1063 mapped entry NOT found
nvbuf_utils: NvReleaseFd Failed… Exiting…
nvbuf_utils: dmabuf_fd 1071 mapped entry NOT found
nvbuf_utils: NvReleaseFd Failed… Exiting…
RingBuffer – allocated 4 buffers (6220800 bytes each, 24883200 bytes total)

Hi,
Please run this command and check if you can see video preview:

$ gst-launch-1.0 uridecodebin uri='rtsp://admin:adminadmin12@192.168.1.108:554/RVi/1/1' ! nvoverlaysink

Would like to make sure the URI is valid.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.