How to reduce rtsp real-time video playback delay in java using vlcj

I developed a video chat application, but the video is displayed with a high delay .video is broadcast via rtsp.how to reduce the delay in playing the rtsp stream?

+4
source share
2 answers

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

  • Add :live-caching=0 to enter processing parameters (for example, when opening a webcam).
  • Play with the codecs, for example, change the codec to mpeg-4 (it seems, for my configuration, it’s better to work where I have an Android device as a stream receiver).
  • Add :sout-mux-caching=10 (or another other value) for stream parameters

With the following line used for streaming video in webcams (notification: no sound) for my Android, I was able to slightly decrease the latency:

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

0
source

You should currently configure this way.

 String[] options = { ":file-caching=0", ":network-caching=300", ":sout = #transcode{vcodec=x264,vb=800,scale=0.25,acodec=none,fps=23}:display :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep"}; mediaPlayer.playMedia(address, options); 

The most important is network-caching=300 . Defualt - 1000 ms.

0
source

Source: https://habr.com/ru/post/1414813/


All Articles