Closed twilson90 closed 3 years ago
That is an FFmpeg filter (http://ffmpeg.org/ffmpeg-filters.html#loop).
See if you can replicate the same issue with just ffmpeg.c
. If yes, it's an FFmpeg issue (https://trac.ffmpeg.org), not an mpv issue. What I guess is that the loop filter literally buffers all of that video that it will then loop (which matches the explanation of "on repeating the loop the memory consumption remains static"). If you think of it on video filter level, I don't think there's any other way for it to do the loop.
On a tool level, sure. We have tools on the player level to loop either your playlist or a file:
mpv -h=loop
--loop alias for loop-file
--loop-file Choices: no inf yes (or an integer) (0 to 10000) (default: no)
--loop-playlist Choices: no inf yes force (or an integer) (1 to 10000) (default: no)
--ab-loop-a Time (default: no)
--ab-loop-b Time (default: no)
--ab-loop-count Choices: inf (or an integer) (0 to 2147483647) (default: inf)
see the related issue https://github.com/mpv-player/mpv/issues/8703 why the loop options won't work for this use case. next time you should link that too.
I'm aware of all the built in looping functions, this is a very special case where I need the the video track to loop infinitely for the duration of audio.
As soon as I looked into it I realised it was an ffmpeg issue, just simply the way the loop filter works.
So instead I'm trying ffmpeg's movie filter instead with the looping parameter set to 0, chained to setpts=N/FRAME_RATE/TB
to generate valid linear timestamps, and it appears to work much better.
No memory problems!
Important Information
Provide following Information:
Reproduction steps
(the size parameter in this case matches the total number of frames in the video, the -1 means loop forever)
Expected behavior
Memory consumption should remain low and more or less static.
Actual behavior
The memory consumption never stops growing for the duration of the looped video. On repeating the loop the memory consumption remains static. After several minutes of running a long 1280x720 video with the loop filter it had consumed all my machine's memory (8gb)
Log file
log.txt
Sample files
https://0x0.st/-A9E.mp4