Mpv: Rotation and mirroring while playing the video does not work properly

Created on 30 May 2018  Â·  7Comments  Â·  Source: mpv-player/mpv

mpv version and platform

```$ mpv --version
mpv 0.28.2 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
built on Mon May 14 09:49:30 CEST 2018
ffmpeg library versions:
libavutil 56.14.100
libavcodec 58.18.100
libavformat 58.12.100
libswscale 5.1.100
libavfilter 7.16.100
libswresample 3.1.100
ffmpeg version: 4.0

$ uname -rms
Linux 4.16.11-1-ARCH x86_64

$ grep -m1 name /proc/cpuinfo
model name : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz

$ lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1080] (rev a1)

$ openbox --version | grep Openbox
Openbox 3.6.1

$ X -version 2>&1 | grep Server\\|Protocol
X.Org X Server 1.20.0
X Protocol Version 11, Revision 0
```

Reproduction steps

Add r vf add rotate=90 and l vf toggle mirror to allow rotation and mirroring of the video on runtime by pressing R for rotation and L for mirroring the video.

Expected behavior

Pressing R rotates the video by 90 degrees and pressing L mirrors the video

Actual behavior

Instead of 90 degress rotation the video content gets rotated within the video window ending up with this after pressing R twice (original image for reference) - expected behavior is – after two 90 degrees rotations – that the video is upside-down.

Instead of mirroring the video nothing happens.

Log file

Started the video, pressed R twice and L once.

output.txt

Sample files

Does not matter, happens to all videos I tested independent of codec or container. Video used for creating the screenshots from: https://www.youtube.com/watch?v=1CwEQ8QRnas downloaded via youtube-dl. But as said: Happens with all videos.

Most helpful comment

r cycle-values video-rotate "90" "180" "270" "0"
l vf toggle hflip

All 7 comments

The rotate filter takes radians: http://ffmpeg.org/ffmpeg-filters.html#rotate
You should be using --video-rotate instead anyway.

A filter named "mirror" doesn't exist in FFmpeg.
transpose hflip can probably do this.

Both worked some time ago.

Using --video-rotate (or video-rotate?) instead of r vf add video-rotate=90 and then pressing R it results in

[video-rotate] libavfilter filter 'video-rotate' not found!
Creating filter 'video-rotate' failed.

And nothing happening.

How to use transpose in input.conf?

Is there a log on why and when vf toggle mirror was removed and vf add rotate behavior was changed?

I assume you didn’t even get my point. So please re-open and have an actual dev answering this.

--video-rotate is an mpv option, not a filter.
you need r set video-rotate 90 in input.conf

the same way you'd use any other video filter

r set video-rotate 90 rotates only once (again: I assume you don’t understand the issue. So please re-open and have someone look at it who actually knows what they’re doing).

r vf add rotate=90 rotated by 90 degress everytime pressed until the behavior was changed.

When using r add video-rotate 90 rotating by 360 (359) degrees only once works but that is not what I need.

What’s with mirroring?

r cycle-values video-rotate "90" "180" "270" "0"
l vf toggle hflip

@h633537 Do you know how to keep the video window centered when rotating? With your code it moves up on the desktop. But pretty cool, thanks. So it seems like this isn’t a bug but the previously working options were removed.

r cycle-values video-rotate "90" "180" "270" "0"
l vf toggle hflip

@h633537 Works greats, thanks a lot !

Was this page helpful?
0 / 5 - 0 ratings