On Mon, Feb 16 2015, Nikos Chantziaras wrote:

> On 16/02/15 22:51, gottl...@nyu.edu wrote:
>> I apologize in advance for this off topic query.
>>
>> I took a video with my phone (galaxy note 4) and via google+ uploaded it
>> to my mail laptop.  It is an mp4 and plays fine on both the phone and
>> the labtop except that it is sideways.
>>
>> I was surprised that neither the player on the phone nor the player on
>> the laptop (totem, I run gnome) seems to offer a rotation option.
>>
>> Am I missing a slightly hidden option or do I need another program.
>> I do not do video editing and do no plan to in the near future.
>
> You can change the metadata of the mp4 file without re-encoding
> it. This requires that the player you play the video in actually
> respects that metadata though! mplayer and mpv respect it. Your
> phone's player might not.

Not worried about the phone.  I won't touch the file there and will
probably delete it when I get the one right on the laptop.

> You need ffmpeg for this (media-video/ffmpeg).

That I have (1.2.6-r1, highest stable).

>   ffmpeg -i yourvideo.mp4 -c copy -metadata:s:v:0 rotate=90 output.mp4

I did this command but the result is not rotated (my player is totem).
There was a warning issued.  Below is the command I used and the
on-screen output.  The resulting mp4 file plays fine but is not rotated.

What did I do wrong?

thanks again,
allan




newlap tmp # ffmpeg -i orig.mp4 -c copy -metadata:s:v:0 rotate=90 r90.mp4
ffmpeg version 1.2.6 Copyright (c) 2000-2014 the FFmpeg developers
  built on Feb  3 2015 14:21:53 with gcc 4.8.3 (Gentoo 4.8.3 p1.1, pie-0.5.9)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 
--mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc 
--cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar 
--optflags='-march=native -O2 -pipe' --extra-cflags='-march=native -O2 -pipe' 
--extra-cxxflags='-march=native -O2 -pipe' --disable-static --enable-gpl 
--enable-postproc --enable-avfilter --enable-avresample --disable-stripping 
--enable-version3 --disable-indev=v4l2 --disable-indev=oss --disable-indev=jack 
--disable-outdev=oss --enable-bzlib --disable-runtime-cpudetect --disable-debug 
--disable-doc --disable-gnutls --enable-hardcoded-tables --enable-iconv 
--enable-network --disable-openssl --enable-ffplay --disable-vaapi 
--disable-vdpau --enable-zlib --enable-libvo-aacenc --disable-libvo-amrwbenc 
--enable-libmp3lame --disable-libfdk-aac --disable-libaacplus --disable-libfaac 
--disable-libtheora --disable-libtwolame --enable-libx264 --enable-libxvid 
--disable-libcdio --disable-libiec61883 --disable-libdc1394 --dis  libavutil    
  52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[h264 @ 0x122e340] Warning: not compiled with thread support, using thread 
emulation
[aac @ 0x122f070] Warning: not compiled with thread support, using thread 
emulation
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'orig.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2015-02-08 21:30:20
  Duration: 00:05:44.94, start: 0.000000, bitrate: 17240 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 
1920x1080, 16996 kb/s, 29.91 fps, 29.92 tbr, 90k tbn, 180k tbc
    Metadata:
      rotate          : 90
      creation_time   : 2015-02-08 21:30:20
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 
250 kb/s
    Metadata:
      creation_time   : 2015-02-08 21:30:20
      handler_name    : SoundHandle
Output #0, mp4, to 'r90.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    encoder         : Lavf54.63.104
    Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1080, 
q=2-31, 16996 kb/s, 29.91 fps, 90k tbn, 90k tbc
    Metadata:
      handler_name    : VideoHandle
      creation_time   : 2015-02-08 21:30:20
      rotate          : 90
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 
250 kb/s
    Metadata:
      creation_time   : 2015-02-08 21:30:20
      handler_name    : SoundHandle
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 7166 fps=0.0 q=-1.0 size=  504481kB time=00:03:59.68 
bitrate=17242.6kbitsframe=10311 fps=0.0 q=-1.0 Lsize=  726141kB 
time=00:05:44.93 bitrate=17245.2kbits/s    
video:715245kB audio:10529kB subtitle:0 global headers:0kB muxing overhead 
0.050533%
newlap tmp # ffmpeg -i orig.mp4 -c copy -metadata:s:v:0 rotate=90 r90.mp4


Reply via email to