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

mpv does not support video rotation metadata in OpenCamera-recorded MP4 video #5032

Open
CounterPillow opened this issue Oct 23, 2017 · 3 comments

Comments

@CounterPillow
Copy link
Contributor

CounterPillow commented Oct 23, 2017

mpv version and platform

$ mpv --version
mpv 0.27.0-270-g0358cca39e (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on Mon Oct 23 11:32:08 CEST 2017
ffmpeg library versions:
   libavutil       55.58.100
   libavcodec      57.89.100
   libavformat     57.71.100
   libswscale      4.6.100
   libavfilter     6.82.100
   libswresample   2.7.100
ffmpeg version: 3.3.4

Arch Linux

Reproduction steps

  1. Play sample file
  2. Notice how it's not rotated correctly
  3. Open sample file in gwenview (or look at the generated thumbnail from KDE's thumbnailer)
  4. Note how it is correctly rotated -90 degrees there

Expected behavior

mpv shows the video in the proper rotation

Actual behavior

mpv shows the video rotated 90 degree clockwise

Log file

https://0x0.st/sr3T.log

Sample files

https://0x0.st/sr3b.mp4

Additional info:

$ ffprobe VID_20171023_132840.mp4 
ffprobe version 3.3.4 Copyright (c) 2007-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-shared --enable-version3
  libavutil      55. 58.100 / 55. 58.100                                                     
  libavcodec     57. 89.100 / 57. 89.100                                                     
  libavformat    57. 71.100 / 57. 71.100                                                     
  libavdevice    57.  6.100 / 57.  6.100                                                     
  libavfilter     6. 82.100 /  6. 82.100                                                     
  libavresample   3.  5.  0 /  3.  5.  0                                                     
  libswscale      4.  6.100 /  4.  6.100                                                     
  libswresample   2.  7.100 /  2.  7.100                                                     
  libpostproc    54.  5.100 / 54.  5.100                                                     
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20171023_132840.mp4':                           
  Metadata:                                                                                  
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2017-10-23T11:29:09.000000Z
    com.android.version: 6.0.1
  Duration: 00:00:27.67, start: 0.000000, bitrate: 20280 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 19950 kb/s, SAR 1:1 DAR 16:9, 29.88 fps, 29.92 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2017-10-23T11:29:09.000000Z
      handler_name    : VideoHandle
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 95 kb/s (default)
    Metadata:
      creation_time   : 2017-10-23T11:29:09.000000Z
      handler_name    : SoundHandle
@galad87
Copy link

galad87 commented Oct 29, 2017

The rotation matrix is set to

0 1
-1 0
0 0

so it's missing the tx value. Anyway it looks like a 90° rotation matrix to me.

@jobevers
Copy link

jobevers commented Sep 19, 2018

for what its worth, I have

mpv --version                                                                                                                          
mpv git-2018-05-17-05b392b Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
 built on Sun May 20 01:05:19 UTC 2018
ffmpeg library versions:
   libavutil       56.18.102
   libavcodec      58.19.102
   libavformat     58.15.100
   libswscale      5.2.100
   libavfilter     7.24.100
   libswresample   3.2.100
ffmpeg version: git-2018-05-19-411f714

and it played a rotated video from opencamera just fine. This is the ffprobe of that file:

  Duration: 00:30:00.07, start: 0.000000, bitrate: 20261 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 19998 kb/s, SAR 1:1 DAR 16:9, 29.98 fps, 30 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2018-07-15T13:57:28.000000Z
      handler_name    : VideoHandle
    Side data:
      displaymatrix: rotation of -90.00 degrees

@Dudemanguy
Copy link
Member

Old one but does anyone know if this is still an issue (do we support this stuff yet? I don't remember).

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

5 participants