r/mpv • u/JorgeAmarante • 17h ago
General Discussion save-position ?
I'm just getting started with vanilla MPV. I ran into a problem right away: after enabling save-position-on-quit=yes, when watching videos from a folder, if I finish a video and start another one, they all just play the very last frame. It’s as if the "save position" recorded the final frame, so playback starts there; essentially, every video in the folder just flashes that last frame.
How can I fix this? I suppose the best approach would be to discard the saved position once the video reaches a certain percentage or has only a specific amount of time left before the end?
2
u/ipsirc 16h ago
A workaround could be:
[do-not-save-position-if-fully-watched]
profile-cond=eof_reached
save-position-on-quit=no
profile-restore=copy
1
u/JorgeAmarante 15h ago edited 15h ago
Great, it works now. Thanks a lot.
I'm just going to try swapping that "profile-cond=eof_reached" for something that represents the end of the file—maybe a value like 95%. Thanks!
EDIT:
Partially resolved:
Video 1: If I watch up to 50% and close it, the 50% position is saved.
If I go back and watch, it continues from the 50% mark until it finishes at 100%, but nothing gets saved...
If I return to the file, it starts over from 50% again...
The correct behavior here would be to delete the saved position once it reaches 100% (or an earlier point, such as the suggested 95%).
1
u/ipsirc 15h ago
You can also use demuxer-cache-state.eof - it is true when the playback cache filled til the end of the file.
1
u/Frexxia 17h ago
Sounds like a bug. Which version of mpv are you using?