Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playback speed should affect --image-display-duration #12496

Closed
pcordes opened this issue Sep 26, 2023 · 6 comments · May be fixed by #15346
Closed

Playback speed should affect --image-display-duration #12496

pcordes opened this issue Sep 26, 2023 · 6 comments · May be fixed by #15346

Comments

@pcordes
Copy link

pcordes commented Sep 26, 2023

Years ago, ] and [ to change video playback speed also affected how quickly MPV would step through playlist entries that were still images. This broke (or was intentionally changed) several years ago. (Along with right-arrow going to the next jpg with auto-repeat also not working anymore, but that's a separate issue.)

I'm posting this as a feature request rather than bug because I assume the current behaviour is intentional, I just don't like it. :P (I'm using mpv 0.36 on Arch GNU/Linux.)

Expected behavior of the wanted feature

speed=2.0 with image-display-duration=1 should only pause 0.5 seconds between still images, as if image-display-duration was scaled by the speed property.

Alternative behavior of the wanted feature

[ and ], and custom keybinds to set the playback speed, should affect how fast images flip somehow.

I guess as a workaround, I could bind [ and ] to also multiply image-display-duration as well as speed so they just change in lock-step, if that's doable from input.txt. But resetting speed to 1 with backspace would need a way to reset image-display-duration to its initial command-line value. For my own use I might be fine with that, 1 is ok as long as a scale factor can be cranked up to 32x or whatever.

@guidocella
Copy link
Contributor

You can already change image-display-duration at runtime, there is no reason speed should do the same thing.

@pcordes
Copy link
Author

pcordes commented Sep 26, 2023

You can already change image-display-duration at runtime, there is no reason speed should do the same thing.

Then the default keybinds for [ and ] (and { and }) should do that, including restoring to the original speed with backspace (so other users don't have to script it themselves, among other reasons).

Like I said, I don't care how the internals work as long as shift-] can speed up image duration.

I don't want 2 different keybinds for video speed vs. image speed, and I'd rather not have the OSD be messy from showing a change to both speed and image-display-duration. (Or only show the later one.)

Also, I know I can define versions of ] and [ like so:

ctrl+] multiply image-display-duration 0.5
ctrl+[ multiply image-display-duration 2.0

Or make { and } do both with

{ multiply speed 0.5; multiply image-display-duration 2.0
} multiply speed 2.0; multiply image-display-duration 0.5

but this now only shows the image duration, not speed. I could do the other order to see the speed instead.

But how would I get backspace to restore the original image-display-duration if that was overridden on the command line? Like I wrote in my original feature request, that would be another advantage of using the speed property as a divisor for image-display-duration.

@guidocella
Copy link
Contributor

guidocella commented Sep 26, 2023

Then the default keybinds for [ and ] (and { and }) should do that, including restoring to the original speed with backspace (so other users don't have to script it themselves, among other reasons).

There is no need to make the default keybindings do that because it is not a common use case, you are the first user requesting it. changed my mind, #15346 will bind brackets to affect --image-display-duration.

I don't want 2 different keybinds for video speed vs. image speed

Keys can be bound to multiple commands separated by ;.

I'd rather not have the OSD be messy from showing a change to both speed and image-display-duration. (Or only show the later one.)

Commands can be silenced with the no-osd prefix.

but this now only shows the image duration, not speed. I could do the other order to see the speed instead.

You can set different key bindings for images as shown in the user scripts linked from the wiki to turn mpv into an image viewer.

But how would I get backspace to restore the original image-display-duration if that was overridden on the command line? Like I wrote in my original feature request, that would be another advantage of using the speed property as a divisor for image-display-duration.

Either just set it to 1 or write a script that saves the original value and provides a keybinding to reset to it.

@pcordes
Copy link
Author

pcordes commented Sep 26, 2023

You can set different key bindings for images as shown in the user scripts linked from the wiki to turn mpv into an image viewer.

Thanks, that's quite useful; I'd been going to ask about overloading page-up as add playlist-pos-1 10 for images vs. seek forward by 10 minutes for videos.

It's annoying to have to do a bunch of manual scripting for what I think would be a better default, so I still think the feature-request has merit, but yes most of what I want can be achieved with good-enough results via just binding two [ / ], and { / }, and backspace. Fine control isn't needed for images so I won't also change my keybinds for ctrl+] multiply speed 1.01

@guidocella
Copy link
Contributor

This is the script by the way:

local duration = mp.get_property('image-display-duration')

mp.add_key_binding('F1', 'reset-image-display-duration', function ()
    mp.set_property('image-display-duration', duration)
end)

Change F1 to any other key.

@Dudemanguy
Copy link
Member

I don't think it makes sense to make speed work like this.

@Dudemanguy Dudemanguy closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2023
guidocella added a commit to guidocella/mpv that referenced this issue Dec 25, 2024
This makes mpv usable as an image viewer out of the box, as it is
currently hard to setup. Using mpv as an image viewer has several
advantages, the biggest one is that it's the best program at browsing
directories of mixed videos and images.

This adds a builtin image conditional profile that users can extend in
mpv.conf. It is written to not restore and reapply the options on each
image change, because that is slow for certain options (e.g.
--d3d11-flip=no restarts the VO), and causes visible flicker when
options like gamma are unapplied before changing image and reapplied on
the next image. But it still restores the previous options after
switching to a video or audio file.

Default image key bindings are defined in the image input section. sxiv
is their main inspiration.

Closes mpv-player#7983, closes mpv-player#12496.
guidocella added a commit to guidocella/mpv that referenced this issue Dec 25, 2024
This makes mpv usable as an image viewer out of the box, as it is
currently hard to setup. Using mpv as an image viewer has several
advantages, the biggest one is that it's the best program at browsing
directories of mixed videos and images.

This adds a builtin image conditional profile that users can extend in
mpv.conf. It is written to not restore and reapply the options on each
image change, because that is slow for certain options (e.g.
--d3d11-flip=no restarts the VO), and causes visible flicker when
options like gamma are unapplied before changing image and reapplied on
the next image. But it still restores the previous options after
switching to a video or audio file.

Default image key bindings are defined in the image input section. sxiv
is their main inspiration.

Closes mpv-player#7983, closes mpv-player#12496.
guidocella added a commit to guidocella/mpv that referenced this issue Dec 31, 2024
This makes mpv usable as an image viewer out of the box, as it is
currently hard to setup. Using mpv as an image viewer has several
advantages, the biggest one is that it's the best program at browsing
directories of mixed videos and images.

This adds a builtin image conditional profile that users can extend in
mpv.conf. It is written to not restore and reapply the options on each
image change, because that is slow for certain options (e.g.
--d3d11-flip=no restarts the VO), and causes visible flicker when
options like gamma are unapplied before changing image and reapplied on
the next image. But it still restores the previous options after
switching to a video or audio file.

Default image key bindings are defined in the image input section. sxiv
is their main inspiration.

Closes mpv-player#7983, closes mpv-player#12496.
guidocella added a commit to guidocella/mpv that referenced this issue Jan 5, 2025
This makes mpv usable as an image viewer out of the box, as it is
currently hard to setup. Using mpv as an image viewer has several
advantages, the biggest one is that it's the best program at browsing
directories of mixed videos and images.

This adds a builtin image conditional profile that users can extend in
mpv.conf. It is written to not restore and reapply the options on each
image change, because that is slow for certain options (e.g.
--d3d11-flip=no restarts the VO), and causes visible flicker when
options like gamma are unapplied before changing image and reapplied on
the next image. But it still restores the previous options after
switching to a video or audio file.

Default image key bindings are defined in the image input section. sxiv
is their main inspiration.

Closes mpv-player#7983, closes mpv-player#12496.
guidocella added a commit to guidocella/mpv that referenced this issue Jan 5, 2025
This makes mpv usable as an image viewer out of the box, as it is
currently hard to setup. Using mpv as an image viewer has several
advantages, the biggest one is that it's the best program at browsing
directories of mixed videos and images.

This adds a builtin image conditional profile that users can extend in
mpv.conf. It is written to not restore and reapply the options on each
image change, because that is slow for certain options (e.g.
--d3d11-flip=no restarts the VO), and causes visible flicker when
options like gamma are unapplied before changing image and reapplied on
the next image. But it still restores the previous options after
switching to a video or audio file.

Default image key bindings are defined in the image input section. sxiv
is their main inspiration.

Closes mpv-player#7983, closes mpv-player#12496.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants