Score:2

Where is MPV save state location?

jp flag

Where does mpv save or log the state when using --save-position-on-quit or Shift+q?

This is used to save the exit state in order for the video to start playing from where it was left off when exiting mpv.

Usermaxn avatar
jp flag
I did look at the man page, it only describes the behaviour not the location it is saved
Score:4
in flag

On my own copy of mpv:

andrew@ilium~$ mpv --version | head -n 1
mpv 0.35.0-255-g16f0cd546d Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects

the 'saved' exit state is written in a simple text file in $HOME/.config/mpv/watch_later. An example, again taken from my own system, is:

andrew@ilium~/.config/mpv/watch_later$ ls
3F33858724ABD9E42AB6EDA66A77E92D
andrew@ilium~/.config/mpv/watch_later$ cat 3F33858724ABD9E42AB6EDA66A77E92D 
start=15.807474
andrew@ilium~/.config/mpv/watch_later$ 

I note that the man pages give some clear detail on this:

~/.config/mpv/watch_later/

Contains  temporary  config  files  needed  for resuming playback
of files with the watch later feature. See for example the Q key 
binding, or  the  quit-watch-later input command.

Each file is a small config file which is loaded if the corresponding
media file is loaded. It contains the playback position and some
(not necessarily  all)  settings that  were changed during playback.
The filenames are hashed from the full paths of the media files. It's
in general not possible to extract the  media  filename  from this
hash. However, you can set the --write-filename-in-watch-later-config
option, file.

The option --write-filename-in-watch-later-config mentioned there is worth using; on my system this command:

mpv --save-position-on-quit --write-filename-in-watch-later-config test.avi 

gives the following result:

andrew@ilium~/.config/mpv/watch_later$ cat 3F33858724ABD9E42AB6EDA66A77E92D 
# test.avi
start=26.067734
andrew@ilium~/.config/mpv/watch_later$ 

It would be a great idea to add these options to the mpv.conf file, as I have done on my system...

Usermaxn avatar
jp flag
thank you for this informative answer. this solves the problem.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.