Downloading video stream via rtspsrc

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) jetson xavier nx
• DeepStream Version 5.1
• JetPack Version (valid for Jetson only) 4.5.1
• TensorRT Version 7.1.3
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs) questions
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

I’m working on modifying a LPR sample about deepstream to use rtspsrc directly. So far, no luck. The following two simple commands are to investigate the problem:

The first command is not workable. No playable file can be produced.

gst-launch-1.0 -e rtspsrc location="rtsp://10.196.70.109:88/live" ! rtph264depay ! h264parse ! mp4mux ! filesink location=gst_short.mp4

The second command is workable. The downloaded file can be played.

gst-launch-1.0 -e rtspsrc location="rtsp://10.196.70.109:88/live" ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! omxh264enc ! mp4mux ! filesink location=gst.mp4 

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

How to explain this phenomenon? The second command consumes more hardware resources because it does transcode. So the first command should be preferred. How to make the first command work?

It has nothing to do with deepstream. Please google gstreamer related resources.

gst-launch-1.0 -e rtspsrc location=rtsp://xxxxxxxxx ! rtph264depay ! h264parse ! queue ! mux.video_0 qtmux name=mux reserved-prefill=TRUE faststart=TRUE ! filesink location=./test.mp4

Sorry, your solution is not workable. The output file, test.mp4, cannot be produced.

The following command line was translated from lpr_app.

gst-launch-1.0 -ev filesrc location=~/91_09151231.mp4 \
! qtdemux ! h264parse ! queue \
! nvv4l2decoder \
! m.sink_0 nvstreammux name=m width=1280 height=720 batch-size=1 ! nvstreamdemux name=s s.src_0 \
! queue \
! nvinfer name=primary-infer-engine1 config-file-path=trafficamnet_config.txt process-mode=2 \
! queue \
! nvtracker tracker-width=640 tracker-height=384 gpu_id=0 ll-config-file=tracker_config.yml ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvdcf.so enable_batch_process=1 \
! queue \
! nvdsanalytics config-file=config_nvdsanalytics.txt \
! queue \
! nvinfer name=secondary-infer-engine1 config-file-path=lpd_us_config.txt process-mode=2 \
! queue \
! nvinfer name=secondary-infer-engine2 config-file-path=lpr_config_sgie_us.txt process-mode=2 \
! queue \
! nvmultistreamtiler rows=1 columns=1 width=1280 height=1080 ! queue \
! nvvideoconvert ! nvdsosd ! queue \
! nvvideoconvert ! capsfilter ! queue \
! nvv4l2h264enc ! filesink location=~/h.mp4

The above command produces the file, h.mp4, which is playable.

However, no luck to modify the video source to rtspsrc.

gst-launch-1.0 -e rtspsrc location="rtsp://" ! rtph264depay ! h264parse \
! nvv4l2decoder \
! m.sink_0 nvstreammux name=m width=1280 height=1080 batch-size=1 ! nvstreamdemux name=s s.src_0 \
! queue \
! nvinfer name=primary-infer-engine1 config-file-path=trafficamnet_config.txt process-mode=2 \
! queue \
! nvtracker tracker-width=640 tracker-height=384 gpu_id=0 ll-config-file=tracker_config.yml ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvdcf.so enable_batch_process=1 \
! queue \
! nvdsanalytics config-file=config_nvdsanalytics.txt \
! queue \
! nvinfer name=secondary-infer-engine1 config-file-path=lpd_us_config.txt process-mode=2 \
! queue \
! nvinfer name=secondary-infer-engine2 config-file-path=lpr_config_sgie_us.txt process-mode=2 \
! queue \
! nvmultistreamtiler rows=1 columns=1 width=1280 height=1080 ! queue \
! nvvideoconvert ! nvdsosd ! queue \
! nvvideoconvert ! capsfilter ! queue \
! nvv4l2h264enc ! filesink location=~/h.mp4

It may be not trivial to solve the problem. I spent a lot of time to investigate how to modify the video source to use rtspsrc. All schemes searched from google are not workable so far. The only sample code with rtspsrc in /opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-testsr also cannot produce a playable video file. Searched results in github with the two keywords “rtspsrc nvv4l2decoder” do not provide helpful solutions.

Any advice for tricky to modify filesrc to rtspsrc? Thanks a lot.

Sorry, my bad.

After changing an ipcam, the mentioned problem is disappeared. So at least one of gstreamer’s plugin or nv-* plugin is incompatible to the previous ipcam’s rtsp.

Is it possible to find out which element is getting in trouble? How?