CircusMonkey / ros_rtsp

ROS node to subscribe to an image and serve it up as a RTSP video feed.
The Unlicense
103 stars 48 forks source link

Lag/Latency #14

Closed akshata1100 closed 2 years ago

akshata1100 commented 2 years ago

When I stream rtsp to my VLC player there's almost 20-40s of lag in the stream. I've tried almost everything. VLC doesn't play the rtsp if I change the config file (eh: bitrate/ width/height etc).

What's the best solution to this?

CircusMonkey commented 2 years ago

Hi @akshata1100, I don't recommend VLC for this at all but 20-40s of lag hints at some other problem. Try the other client commands below first to see if it's just a VLC issue:

How is the lag with the gstreamer or mpv commands?:

gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:8554/front drop-on-latency=true use-pipeline-clock=true do-retransmission=false latency=0 protocols=GST_RTSP_LOWER_TRANS_UDP ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=true
mpv --no-cache --untimed --no-demuxer-thread --vd-lavc-threads=1 rtsp://127.0.0.1:8554/front

I've updated the example commands on the readme to include a different VLC command to try:

cvlc --no-audio --mux none --demux none --deinterlace 0 --no-autoscale --avcodec-hw=any --no-auto-preparse --sout-rtp-proto=udp --network-caching=300 --realrtsp-caching=0 --sout-udp-caching=0 --clock-jitter=0 --rtp-max-misorder=0 rtsp://127.0.0.1:8554/front :udp-timeout=0
akshata1100 commented 2 years ago

Let me check this out. Thank you very much