![MPV 保存状态位置在哪里?](https://linux22.com/image/1193662/MPV%20%E4%BF%9D%E5%AD%98%E7%8A%B6%E6%80%81%E4%BD%8D%E7%BD%AE%E5%9C%A8%E5%93%AA%E9%87%8C%EF%BC%9F.png)
使用或+时在哪里mpv
保存或记录状态?--save-position-on-quit
Shiftq
这用于保存退出状态,以便视频从退出时停止的地方开始播放mpv
。
答案1
在我自己的 mpv 副本上:
andrew@ilium~$ mpv --version | head -n 1
mpv 0.35.0-255-g16f0cd546d Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
“已保存”的退出状态写在 中的一个简单文本文件中 $HOME/.config/mpv/watch_later
。以下示例同样取自我自己的系统:
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$
我注意到手册页给出一些清晰的细节:
~/.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.
这里提到的选项--write-filename-in-watch-later-config
值得使用;在我的系统上使用此命令:
mpv --save-position-on-quit --write-filename-in-watch-later-config test.avi
得出以下结果:
andrew@ilium~/.config/mpv/watch_later$ cat 3F33858724ABD9E42AB6EDA66A77E92D
# test.avi
start=26.067734
andrew@ilium~/.config/mpv/watch_later$
将这些选项添加到mpv.conf 文件,正如我在我的系统上所做的那样......