Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mpv with cache=yes cache 409.78MB #5359

Closed
Funodav opened this issue Jan 6, 2018 · 3 comments
Closed

Mpv with cache=yes cache 409.78MB #5359

Funodav opened this issue Jan 6, 2018 · 3 comments

Comments

@Funodav
Copy link

Funodav commented Jan 6, 2018

mpv version and platform

mpv 0.28.0-74-ga9a4d6349a Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
built on Thu Jan 4 21:25:15 UTC 2018
ffmpeg library versions:
libavutil 56.7.100
libavcodec 58.9.100
libavformat 58.3.100
libswscale 5.0.101
libavfilter 7.10.100
libswresample 3.0.101
ffmpeg version: git-2018-01-04-89bbf5c7e

Reproduction steps

--cache=yes

Expected behavior

To do what the version 0.27 did cache 70MB or something reasonable.

Actual behavior

cache more than necessary, To much space use in ram
AV: 00:00:03 / 01:30:58 (0%) A-V: 0.000 Cache: 169s+409MB

Log file

https://pastebin.com/E31dXE7D

@Argon-
Copy link
Member

Argon- commented Jan 6, 2018

That's the demuxer cache which defaults to 400MB now. The "normal" (old) cache got reduced to 10MB by default.
See https://mpv.io/manual/master/#options-demuxer-max-bytes and the following option.

If you want to limit the demuxer cache I strongly recommend you use --demuxer-readahead-secs to do this rather than --demuxer-max(-back)-bytes.

@ghost
Copy link

ghost commented May 5, 2018

Actually --cache-secs.

@florianjacob
Copy link

For other people finding this which, like me, are notoriously low on memory and would rather use those 400MiB of memory for browser tabs not getting taken down by the out of memory killer, demuxer-readahead-secs / demuxer-max-bytes is not enough, this will only stop mpv from using up to 400MiB from the start, but it will still cache up to 400MiB of already played content - you can see this easily through the nice new cache indicator at the bottom, for a video smaller than 400MiB it will never discard already-played content. You also need demuxer-max-back-bytes to restrict the backbuffer, e.g.:

# restrict readahead and backbuffer to 40MiB from default of 400MiB
demuxer-max-bytes=41943040
demuxer-max-back-bytes=41943040

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants