mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Tweak --cache-pause-* options for more control over buffering behavior

Open tmm1 opened this issue 7 years ago • 5 comments
trafficstars

--cache-pause-initial is now number of seconds, so it can be controlled separately from buffering that happens during regular playback.

New --cache-pause-fill can be used along with --cache-pause-wait to control buffering start and stop thresholds separately. For example, you can tell the player to start buffering when the packet cache is less than 0.5s, but fill up the buffer until 1s. Previously there were cases where the player would keep entering buffering over and over, because the packet cache would dip slightly below the threshold and then fill up quickly and resume right away.

tmm1 avatar May 02 '18 17:05 tmm1

@tmm1 so basically the new --cache-pause initial replaces --cache-pause-wait or they can be used together? Better yet can you give me scenario where you seeing the most benefit? Right now i'm using: demuxer-readahead-secs=5.000 cache-pause-initial=yes cache-pause-wait=5.000 and it's kind of helping with the initial frame lost,but in my opinion creating more commands that have almost the same function will just get more people confused which one to choose. And i want to thank you for your hard work,looks like you are the onliest one who is trying to improve the streaming experience.

dnmTX avatar May 02 '18 19:05 dnmTX

@dnmTX It is hard to recommend settings without knowing what kind of issues you're seeing. Have you created any issues describing your problem with logs?

With this PR, the only thing you would have to change is cache-pause-initial = yes to cache-pause-initial = 5.0. Then you would delete cache-pause-wait (which would make it default to 1s), and you should not see the player go into buffering.

You can also try playing with https://github.com/mpv-player/mpv/pull/5788 first, which will show more details about what is happening when buffering starts.

tmm1 avatar May 02 '18 19:05 tmm1

@tmm1 thanks for the instructions,i'll change it as soon as the new build show up.I never opened a issue cause the problem is not with the player but with the shitty servers where the videos are hosted and if the file is larger then 1Gb the video-bitrate is higher then the actual download speed which results to a horrible viewing experience.I'm just trying desperately to tweak somehow the player to no avail.Anyway,thanks again and don't quit on improving the streaming experience,every little bit helps.

P.S. What about the --cache-pause-fill ? Any ideas or scenarios on using it? P.S.P.S I actually did open a issue (#5568) and literally got booed by some of the members.

dnmTX avatar May 02 '18 20:05 dnmTX

According to #5568 the remote server has upload bandwidth of 4000kbps, but you're trying to watch videos with bitrate that is 4220kbps. Unfortunately no amount of code or new options can help in this scenario, because the server is not able to send data fast enough.

For seamless playback, every time you finish watching 1 minute of video, one more minute of video should have downloaded during that time. But if the bitrate is higher than available bandwidth, while you watch one minute of video, only 50s or 55s of new video was able to download. So no matter what, eventually you will need to pause and rebuffer to catch up the missing data.

tmm1 avatar May 02 '18 21:05 tmm1

What I would really love to see is mpv pausing long enough until full playback can be achieved. So if we receive data slower than we consume it (factoring in playing speed too) mpv shouldn't start playing once it filled a few seconds of buffer. Cause it'll run out of buffer soon anyways. I hate when that happens.

medhefgo avatar May 17 '18 08:05 medhefgo