Rotation does not work when output is set to gpu or gpu-next, only direct3d
Free media player with support for Youtube
Brought to you by:
rvm
Rotation works under direct3d but not under gpu/gpu-next which is bad because high bitrate videos require gpu decoding. Under gpu/gpu-next nothing happens when I try to rotate. The SMPlayer log produces this sort of messages when I use the keybinding I set for rotation:
[09:43:57:587] BaseGuiPlus::eventFilter: key: QKeySequence("D")
[09:43:57:588] MyActionGroup::itemTriggered: 'rotate_clockwise'
[09:43:57:591] MyActionGroup::itemTriggered: ID: 1
[09:43:57:593] Core::changeRotate: 1
[09:43:57:595] MPVProcess::changeVF: "rotate" false
[09:43:57:597] MPVProcess::sendCommand: "vf remove \"lavfi=[hflip,vflip]\""
[09:43:57:599] MPVProcess::changeVF: "rotate" true
[09:43:57:601] MPVProcess::sendCommand: "vf add \"lavfi=[rotate=PI/2:ih:iw]\""
[09:43:57:930] MPVProcess::parseLine: "[ffmpeg] Impossible to convert between the formats supported by the filter 'mpv_src_in0' and the filter 'auto_scale_0'"
[09:43:57:934] MPVProcess::parseLine: "[lavfi] failed to configure the filter graph"
[09:43:57:936] MPVProcess::parseLine: "Disabling filter lavfi.00 because it has failed."
I've checked and opening the mpv.exe that's supplied with SMPlayer directly and setting a keybinding in input conf to
r cycle-values video-rotate "90" "180" "270" "0"
makes mpv able to rotate correctly.
Could you please be nice enough to fix it pretty quickly as this is really killing SMPlayer usage for me? I would appreciate this a lot.
I can't reproduce this problem in my computer, using smplayer 23.12.
Do you have the problem with all videos?
Thanks for the quick reply. Yes, the problem is with all videos. I believe the fact that you can't reproduce it might have to do with the fact that i'm on an AMD APU and you might not be.
When I removed smplayer.ini, it would let me rotate, but that's only because it wasn't doing hardware decoding, so the framerate was like 2 fps. So I set gpu-next as the video output, turned on HW decoding, and did the following settings:
performance/hardware decoding setting: d3d11va is the only one that gives me full framerate on high bitrate video. (I believe Auto also defaults to that). d3d11va, Auto (safe) and Auto give me full fps and don't let me rotate.
d3d11va-copy doesn't give me full framerate but lets me rotate. some other settings (None, auto-copy, auto-copy-safe, dxva2-copy, nvdec, nvdec-copy, cuda, cuda-copy, crystalhd) also let me rotate but they also don't give me full framerate.
dxva2 gives me full framerate and doesn't let me rotate, and the whole display is green and pink.
i attached smplayer.ini (i removed some paths from it, MRU, toolbar state binary string, etc, but everything related to perf should still be the same as I normally use)
Ok, I see.
If I run mpv directly with the rotate filter and dxva2, I also get that error:
So this is either a bug in mpv or a limitation when using dxva2 and the rotate filter. This is something I can't fix.
You can try to report the problem to the mpv developers:
https://github.com/mpv-player/mpv/issues
ok, but the original post mentions video-rotate and not rotate. when i was looking up how to do this on mpv standalone (i didn't know before) people repeatedly said that video-rotate should be used and not rotate. so why not use video-rotate in SMPlayer?
so specifically here's the comparison:
so one important thing would be to figure out how to change the value of video-rotate without restarting mpv. i don't really know how SMPlayer communicates with mpv, but I guess is it's via a socket, so I guess you'd send a socket command.
(bear in mind that the example in OP shows that video-rotate can be changed during playback, in that case by using a key binding)
Using video-rotate within smplayer has some problems such as not maintaining the aspect ratio so the image it's shown distorted. I think it's not worth it to implement it.
You can always pass the option --video-rotate in preferences -> advanced -> options for mplayer/mpv.
hey bud, even though you've had problems implementing it in the past, would you mind taking another look at it? the way you're doing things in SMPlayer right now really is cumbersome. like eg i can only have video equalizer (only works in gpu) or rotation (only works in direct3d).
"not maintaining the aspect ratio" but you should be able to calculate the aspect ratio yourself. why is that a problem?
"You can always pass the option --video-rotate in preferences -> advanced -> options for mplayer/mpv."
thanks, but that doesn't work. i need to be able to rotate the video as it is playing, using keyboard bindings.
idk what gui toolkit you're using, but i imagine that when you display the image in smplayer you just take the bitmap from mpv and apply it to a rectangle canvas that's part of the smplayer window. you'll have to resize that canvas depending on the size of the image coming in - but that should be the extent of it, i believe.
hey bud, can you please work on this. I get it that you can't be bothered, but this is a real problem
Check if this works for you:
In preferences -> advanced -> mplayer/mpv, type this in the video filters field:
format=fmt=yuv420p
That actually works when using gpu with MPV, thanks.