How to reduce delay in playing rtsp live video stream in java using vlcj

Raji A C picture Raji A C · May 29, 2012 · Viewed 14.8k times · Source

I have developed a video chatting application,but the video is displayed with high latency.video is streamed over rtsp.how to reduce the delay in playing the rtsp stream?

Answer

vArDo picture vArDo · Jul 6, 2012

What video codec are you using? You should be able to reduce latency to <1s using following options:

  1. Add :live-caching=0 to input handling options (e.g. when opening webcam)
  2. Play around with codecs, for example change codec to mpeg-4 (seems to work better for my configuration where I have Android device as stream receiver)
  3. Add :sout-mux-caching=10 (or some other low value) to stream options

With following line used to stream webcam video (notice: no audio) to my Android I was able to slightly reduce latency:

:sout=#transcode{vcodec=mp4v,vb=800,fps=30,scale=0.25,acodec=none}:rtp{sdp=rtsp://:8554/} :sout-keep :sout-mux-caching=10