Menu

#785 SMPlayer does not adjust aspect ratio of a video when a rotation flag is set

stable
open
nobody
None
5
2020-12-06
2016-12-18
Adam
No

I discovered this issue while using a tip from here: http://stackoverflow.com/a/27768317/1003916

I have a video that was recorded on a cell phone vertically. When played back on a computer in VLC/mpv/SMPlayer, the video is always sideways, in landscape orientation.

When I use FFmpeg to apply a rotation flag to the video as suggested in the stackoverflow post, SMPlayer does indeed display the video rotated, however it does not adjust the aspect ratio and the video plays back squished and still in landscape orientation.

I am using mpvfor playback.. when I open the file directly from mpv without SMPlayer, the rotated video plays back correctly rotated and in portrait orientation. VLC also plays back the video correctly. SMPlayer is the only player I have this issue with.

$ ffprobe -v quiet video.mp4 -show_streams|grep rot
TAG:rotate=90

Version info:

Version: 16.11.0 (revision 8242)
Using Qt 4.8.7 (compiled with Qt 4.8.7)
Using MPV git-51fd8f6

Discussion

  • Ricardo Villalba

    Can you provide a sample video with this problem?

     
    • Adam

      Adam - 2016-12-18

      Yeah, about that. I was hoping nobody would ask :) My only sample video is NSFW. Thankfully ffmpeg is great and it let me crop the video and still retain the issue.

      Two files are attached.. sample.mkv is the normal sideways/landscape video. sample-rotated.mkv is after I applied the rotation flag. If you play the rotated one in VLC or mpv, you will see that it plays fine, rotated and portrait orientation. If you play in SMPlayer, it's rotated but still landscape.

      Even though I cropped the video, it is still a slightly NSFW

      And here is a screenshot of VLC (left, correct) next to SMPlayer (right, incorrect)

       

      Last edit: Adam 2016-12-18
  • Ricardo Villalba

    In my computer it's displayed correctly, I think. Using smplayer 16.11 with mpv 0.21.

     
    • Adam

      Adam - 2016-12-18

      Thanks for testing. That's strange.. yes it is displaying correctly for you. I'm also on SMPlayer 16.11. I'm using the mpv-tests PPA

      https://launchpad.net/~mc3man/+archive/ubuntu/mpv-tests

      mpv git-51fd8f6 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
       built on Fri Dec  9 03:51:07 UTC 2016
      ffmpeg library versions:
         libavutil       55.34.100
         libavcodec      57.64.101
         libavformat     57.56.100
         libswscale      4.2.100
         libavfilter     6.65.100
         libswresample   2.3.100
      ffmpeg version: 3.2.2
      

      Maybe it's a weird quirk with my version of mpv .. but it is still strange that the video plays fine running directly from mpv (mpv sample-rotated.mkv) but not from within SMPlayer.

      No idea. Not a big deal I suppose, I doubt I'll ever run into this situation again.

       

      Last edit: Adam 2016-12-18
    • Adam

      Adam - 2016-12-18

      Can you look at your video properties? Mine shows the video to be 256x144 @ 1.777:1 aspect ratio, so landscape .. I don't know if those values are supposed to take into account for rotation properties.

      I also get a message "Changing filter failed!" if I right-click the video and try to rotate it in any way.

       

      Last edit: Adam 2016-12-18
      • Ricardo Villalba

        The resolution for me is 384 x 216

         
        • Adam

          Adam - 2016-12-19

          Ah, yeah I opened the wrong one.. made a couple crops. It doesn't matter though, the aspect ratio was all I was curious about, and yours is the same as mine.

           
  • Arttu Liimola

    Arttu Liimola - 2017-03-28

    This happens when using vdpau. When playing video with rotate tag with mpv using vdpau the aspect ratio is correct. But not when using Smplayer with vdpau and mpv.

    Using Smplayer with xv or vaapi the aspect ratio is correct.

     
  • Tynach

    Tynach - 2019-02-26

    This happens with the OpenGL (now 'GPU') video output mode, which I think I remember being the default. You can work around it by going to Advanced, MPlayer/mpv tab, and adding --keepaspect to the 'Options', but this causes an even worse bug if you try to scale the window to match the corrected aspect ratio.

    I used to be able to add rotate=auto to the video filters, but that no longer seems to fix it since I upgraded to Ubuntu 18.04 (technically KDE Neon). Ubuntu 16.04's version was fixed with the rotate=auto filter, though.

    Edit: I'd like to clarify that I am not using vdpau, nor vaapi. I have all hardware acceleration disabled.

     

    Last edit: Tynach 2019-02-26
  • VVD

    VVD - 2020-12-06

    Hello from Dec of 2020!
    Bug is still here!
    SMPlayer 20.6.0, mpv 0.33.0.

    In console without SMPlayer, just mpv -vo gpu video.mp4: rotated, correct aspect ratio, eat less then 8% of 1 core of my very old cpu.
    In SMPlayer+mpv with -vo gpu: rotated, but incorrect aspect ratio, eat less then 8% of 1 core of my cpu.
    In SMPlayer+mpv with -vo xv: rotated, correct aspect ratio, but eat 50-60% of 1 core of my cpu.

    FreeBSD 12.2 amd64, recent KDE5, Core 2 Duo E6550@2.8GHz, GeForce 9800 GT with NVIDIA drivers 340.108.

     

Log in to post a comment.