mpv.js icon indicating copy to clipboard operation
mpv.js copied to clipboard

cumulative delays

Open MichaelLiaoFeng opened this issue 4 years ago • 1 comments

I have a problem with cumulative delays.

My software is developed based on electron, runs in the local area network, and plays the camera RTSP stream.

My computer configuration is as follows:

image

image

The parameters of low-latency playback in the document.

image

const mpvProperty = ['profile=low-latency', 'cache-pause=yes', 'framedrop=no', 'speed=1.01', 'opengl-glfinish=yes']

mpvProperty.forEach(prop => {
  this.playerInstance._sendProperty(...prop.split('='))
})

this.playerInstance.loadFile(this.streamUrl)

(The cache-pause is set to yes because it needs to be monitored and prompted to the user when buffering.)

After configuring the parameters, the delay is very low during the initial period of time, within 500 milliseconds, but after a period of time, the delay will accumulate up to ten seconds or even half a minute.

image

I guess it might be a caching problem, so I execute the drop-buffers command once every ten minutes. This has a certain effect but it is not ideal. Because the paused-for-cache event is often triggered after execution, and the delay after execution has not been reduced too much.

So I really don't understand which link caused the delay. The main video stream is 1920*1080. I can accept the reduction of video quality. How to configure the parameters?

Please help!

MichaelLiaoFeng avatar Jul 23 '20 06:07 MichaelLiaoFeng

我觉得应该是mpv的问题,我也遇到了这个问题。 我用ffmpeg 将本地文件推送到rtsp服务,再用mpv拉流,延迟就很明显(与vlc相比,vlc就几乎没有延迟),不光这样,音视频同步还有问题。

应该是mpv对rtsp这种协议的支持不是很好造成的。

最好去mpv那里问更合适一些。

lyg1949 avatar Aug 14 '20 11:08 lyg1949