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

Repeated values for video-rotate with cycle #2647

Closed
tomty89 opened this issue Dec 29, 2015 · 6 comments
Closed

Repeated values for video-rotate with cycle #2647

tomty89 opened this issue Dec 29, 2015 · 6 comments

Comments

@tomty89
Copy link
Contributor

tomty89 commented Dec 29, 2015

Alt+RIGHT cycle video-rotate 90
Alt+LEFT cycle video-rotate -90

If I add the above lines to input.conf, I can cycle-rotate the output in either direction. However, there are three values for an unrotated output: no, 0, 360. So I'll have to press the keys repeatedly to "get out" from the unrotated state.

@kevmitch
Copy link
Member

I think the best you can do is

RIGHT cycle_values video-rotate 90 180 270 0
LEFT cycle_values !reverse video-rotate 90 180 270 0

the only problem is that the if you rotate left first it will go to 0

@ghost ghost added the meta:question label Dec 30, 2015
@ghost
Copy link

ghost commented Dec 30, 2015

Yes, this is how it works. While rotating through no makes no sense in this case, it's (probably) needed for other properties. (In theory, the video-rotate property could be special-cased, but personally I don't feel like doing this.)

@ghost ghost closed this as completed Dec 30, 2015
@tomty89
Copy link
Contributor Author

tomty89 commented Dec 31, 2015

I just wonder why "0" and "360" exists in the list when I do "cycle".

@tomty89
Copy link
Contributor Author

tomty89 commented Jan 1, 2016

I mean, shouldn't the accepted range be 1-359 instead of 0-360 anyway? 0 and 360 will just be no-op and make no sense.

[tom@localhost ~]$ mpv --video-rotate=361
Invalid value for option video-rotate: 361
Valid values are:
no
0-360 (integer range)
Error parsing option video-rotate (option could not be parsed)
Setting command line option '--video-rotate=361' failed.

Exiting... (Fatal error)

@ghost
Copy link

ghost commented Jan 2, 2016

0 and no are different. no prevents the container rotation flag from being applied. 0 is simply the default value. But I can remove 360.

ghost pushed a commit that referenced this issue Jan 2, 2016
It's indeed completely useless. Pointed out in #2647.
@ghost
Copy link

ghost commented Dec 4, 2016

@wm4 I agree that cycling through video-rotate shouldn't be special-cased. That would feel like a dirty hack.

And the method by @kevmitch with cycling specific values has its own big drawbacks (try rotating left the first thing you do when you open a video).

Might as well just solve this rotate clockwise/counter-clockwise situation via Lua, like I did here:

#3869 (comment)


Edit: I've now published this and a few other scripts on the wiki:

https://github.com/mpv-player/mpv/wiki/User-Scripts

  • auto-keep-gui-open
    Intelligently switches mpv's "keep-open" behavior based on whether you are running in video-mode or audio-only mode.

  • cycle-video-rotate
    Allows you to perform video rotation which perfectly cycles through all 360 degrees without any glitches.

  • multi-command-if
    Very powerful conditional logic and multiple action engine for your keybindings, without having to write a single line of code!

  • quick-scale
    Quickly scale the video player to a target size, with full control over target scale and max scale. Helps you effortlessly resize a video to fit on your desktop, or any other video dimensions you need!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants