mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.89k stars 2.84k forks source link

options: reset some options between files by default #14151

Closed guidocella closed 2 months ago

guidocella commented 2 months ago

Add some options to --reset-on-next-file's default value that you commonly don't want to keep between files. The catch is that if you specify options in the command line or mpv.conf --reset-on-next-file resets to those values, but the vast majority of uses for these options should be at runtime.

github-actions[bot] commented 2 months ago

Download the artifacts for this pull request:

Windows * [mpv-x86_64-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1516157248.zip) * [mpv-i686-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1516157344.zip) * [mpv-x86_64-windows-msvc](https://nightly.link/mpv-player/mpv/actions/artifacts/1516164304.zip)
macOS * [mpv-macos-14-arm](https://nightly.link/mpv-player/mpv/actions/artifacts/1516155566.zip) * [mpv-macos-12-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1516156172.zip) * [mpv-macos-13-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1516156455.zip)
na-na-hi commented 2 months ago

that you commonly don't want to keep between files

This purely depends on the contents of the playlist in question. It's very often that all videos in the playlist come from closely-related sources. I don't want the crop and rotate settings to be reset for this reason. Switching to the next file and then switching it back also causes the settings to be reset.

Also it makes no sense to reset ab loop points without also resetting --ab-loop-count.

guidocella commented 2 months ago

I always wanted to reset rotate and crop to reset between files, it's hard to guess how common the use case you mentioned is. We can remove those and add ab-loop only if desired. Resetting ab-loop is also nice because it is not obvious how to add it to --reset-on-next-file (https://github.com/mpv-player/mpv/issues/10966). I added --ab-loop-count.

A tricky one is loop-file which ideally you could make it preserve numerical values between files without making it reset on next file if you change it at runtime; see https://github.com/mpv-player/mpv/issues/5943 https://github.com/mpv-player/mpv/issues/10966 https://github.com/mpv-player/mpv/issues/11291 https://www.reddit.com/r/mpv/comments/rcwnrw/looping_each_file_n_times_in_a_playlist/

and IRC discussions:

2023-09-18 17:47:53 ChH guido: kasper93: I didn't realize how weird loop-file is, I've always only used it with yes/no. I thought resetting it means that if mpv gets started without it and then set to 'yes' at runtime, then resetting it would mean it goes to 'no' when going to the next file. 2023-09-18 17:48:54 ChH imo that option should be changed so that it counts repeats (or seeks to the beginning, idc) for the current file instead of in total ... 2023-09-18 20:35:02 guido I just remembered that there was a lot of discussion about adding current-window-scale because option values shouldn't change on their own but actually loop-file already changes the value set by the user 2023-09-18 20:37:13 guido https://github.com/mpv-player/mpv/commit/d07b7f068db56aa5fa7cf16b9d077721ff0a8452 2023-09-18 20:51:53 guido I guess there should be a remaining-loops property that decreases on each loop while --loop-file=N persists across files 2023-09-18 20:52:10 guido --loop-playlist=N also overwrites the value set by the user, but that doesn't cause issues 2023-09-18 20:56:01 ChH remaining-file-loops to make clear it doesn't have anything to do with loop-playlist 2023-09-18 20:56:23 guido right 2023-09-18 20:57:17 guido whether --loop-file=inf should reset on next file depends on individual preferences, but --loop-file=N should never reset

guidocella commented 2 months ago

I made this ab loop only which should be uncontroversial.

kasper93 commented 2 months ago

Do we really need this change? Are we fixing anything? I can image ab-loop to be useful if you watch some series and want to skip recap/intro each time. Not sure how valid is that usecase, but maybe just don't introduce precedence of resetting anything.

guidocella commented 2 months ago

That would be weird since episodes have different durations, but it's fine if the change is not worth it.