Replies: 2 comments 8 replies
-
|
|
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Please read the documentation. Caching in mpv is very flexible, and you can do all that you describe in your post, and more. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In mpv forward cache works like this:
mpv reads 400MiB (user set amount) of data from disk to RAM so that user can seek forward (and backward) fast in the playback stream and don't wait for data fetch from storage drive (for example slow HDD).
and when user watches the video the app always fetch more of data from drive.
this causes the storage drive to always be engaged.
or put another way the buffer is a constant length from playing frame to the last cached byte )
In firefox video playback buffer (cache) works a bit differently.
it has the the buffer length like mpv called media.cache_readahead_limit but it also has a threshold that needs to be reached when going through buffer for firefox to fetch more data called media.cache_resume_threshold . (they are set by seconds not size (MiB)).
Equivalent of this for mpv would be that if a user opened a 2GiB video file and set these two setting to 400MiB and 100MiB then at first the mpv would read and cache 400MiB and then when user watches the video it does not continuously fetch more data until the cache buffer has gotten to the last 100MiB of 400MiB and then mpv reads and caches another 300MiB and so on.
I believe this is a better way to implement cache system.
this way user can use cache a way to make HDD less used and less noisy and let HDD goes to sleep (drive spin-down) more.
even SSD are better utilized this way.
Beta Was this translation helpful? Give feedback.
All reactions