Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#4612 closed defect (invalid)

ffmpeg does not respect -noautorotate

Reported by: projectsymphony Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
-autorotate is a bool switch that enables or disables automatic rotation of video according to metadata and/or display matrix.

-noautorotate should disable autorotation, but it does not have any effect, video is always automatically rotated

How to reproduce:

% ffmpeg -noautorotate -i someinput.mov someoutput.mp4
ffmpeg version N-72570-gf104970

Change History (4)

comment:1 Changed 4 years ago by cehoyos

  • Resolution set to needs_more_info
  • Status changed from new to closed

(works as expected here)

Please reopen this ticket if you can provide your failing command line together with the complete, uncut console output.

comment:2 follow-up: Changed 4 years ago by projectsymphony

  • Resolution needs_more_info deleted
  • Status changed from closed to reopened

Here you go


$ ./ffmpeg -i ./rotatedvid.mov output.mp4
ffmpeg version N-72842-gfb92f3e Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --cc=clang --enable-libx264 --enable-debug --disable-optimizations --disable-yasm --disable-asm --enable-libfdk-aac --enable-version3 --enable-nonfree --enable-gpl --disable-doc --enable-libmp3lame --enable-openssl --enable-libfreetype --enable-avresample
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rotatedvid.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2013-09-11 10:04:39
    model           : iPhone 4
    model-ita       : iPhone 4
    encoder         : 6.0.1
    encoder-ita     : 6.0.1
    date            : 2013-09-11T12:04:38+0200
    date-ita        : 2013-09-11T12:04:38+0200
    make            : Apple
    make-ita        : Apple
  Duration: 00:00:11.12, start: 0.000023, bitrate: 10814 kb/s
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 10754 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2013-09-11 10:04:39
      handler_name    : Core Media Data Handler
      encoder         : H.264
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default)
    Metadata:
      creation_time   : 2013-09-11 10:04:39
      handler_name    : Core Media Data Handler
[libx264 @ 0x7ff600815800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7ff600815800] profile High, level 3.1
[libx264 @ 0x7ff600815800] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    make-ita        : Apple
    model           : iPhone 4
    model-ita       : iPhone 4
    make            : Apple
    encoder         : Lavf56.36.100
    date            : 2013-09-11T12:04:38+0200
    date-ita        : 2013-09-11T12:04:38+0200
    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x1280, q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)
    Metadata:
      handler_name    : Core Media Data Handler
      creation_time   : 2013-09-11 10:04:39
      encoder         : Lavc56.41.100 libx264
    Stream #0:1(und): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 44100 Hz, mono, s16, 96 kb/s (default)
    Metadata:
      creation_time   : 2013-09-11 10:04:39
      handler_name    : Core Media Data Handler
      encoder         : Lavc56.41.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
frame=   46 fps=0.0 q=0.0 size=       0kB time=00:00:02.76 bitrate=   0.1kbits/sframe=   74 fps= 69 q=29.0 size=     134kB time=00:00:03.69 bitrate= 298.2kbits/frame=   99 fps= 60 q=29.0 size=     311kB time=00:00:04.52 bitrate= 562.1kbits/frame=  126 fps= 59 q=29.0 size=     489kB time=00:00:05.43 bitrate= 737.7kbits/frame=  151 fps= 57 q=29.0 size=     657kB time=00:00:06.26 bitrate= 858.2kbits/frame=  174 fps= 55 q=29.0 size=     815kB time=00:00:07.03 bitrate= 949.3kbits/frame=  202 fps= 55 q=29.0 size=    1031kB time=00:00:07.96 bitrate=1060.5kbits/frame=  226 fps= 54 q=29.0 size=    1211kB time=00:00:08.75 bitrate=1133.4kbits/frame=  253 fps= 54 q=29.0 size=    1424kB time=00:00:09.65 bitrate=1208.0kbits/frame=  279 fps= 53 q=29.0 size=    1648kB time=00:00:10.54 bitrate=1280.6kbits/frame=  307 fps= 53 q=29.0 size=    1851kB time=00:00:11.07 bitrate=1368.8kbits/frame=  333 fps= 49 q=-1.0 Lsize=    2348kB time=00:00:11.12 bitrate=1729.3kbits/s    
video:2205kB audio:131kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.493147%
[libx264 @ 0x7ff600815800] frame I:5     Avg QP:21.64  size: 21659
[libx264 @ 0x7ff600815800] frame P:277   Avg QP:23.85  size:  6984
[libx264 @ 0x7ff600815800] frame B:51    Avg QP:25.01  size:  4203
[libx264 @ 0x7ff600815800] consecutive B-frames: 69.4% 30.6%  0.0%  0.0%
[libx264 @ 0x7ff600815800] mb I  I16..4: 28.9% 62.6%  8.5%
[libx264 @ 0x7ff600815800] mb P  I16..4:  0.6%  1.2%  0.5%  P16..4: 46.1%  5.4%  6.7%  0.0%  0.0%    skip:39.4%
[libx264 @ 0x7ff600815800] mb B  I16..4:  0.0%  0.2%  0.4%  B16..8: 53.2%  1.5%  0.2%  direct: 1.0%  skip:43.6%  L0:42.5% L1:57.1% BI: 0.4%
[libx264 @ 0x7ff600815800] 8x8 transform intra:56.1% inter:85.4%
[libx264 @ 0x7ff600815800] coded y,uvDC,uvAC intra: 48.1% 42.5% 3.2% inter: 10.3% 25.5% 0.0%
[libx264 @ 0x7ff600815800] i16 v,h,dc,p:  9% 23% 11% 57%
[libx264 @ 0x7ff600815800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 20% 37%  4%  4%  3%  7%  5%  5%
[libx264 @ 0x7ff600815800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 27% 36%  2%  4%  2% 11%  2%  2%
[libx264 @ 0x7ff600815800] i8c dc,h,v,p: 69% 15% 14%  1%
[libx264 @ 0x7ff600815800] Weighted P-Frames: Y:3.2% UV:0.0%
[libx264 @ 0x7ff600815800] ref P L0: 68.2%  9.7% 15.9%  6.0%  0.1%
[libx264 @ 0x7ff600815800] ref B L0: 88.3% 11.7%
[libx264 @ 0x7ff600815800] kb/s:1625.24
 
$ ./ffmpeg -noautorotate -i ./rotatedvid.mov output.mp4
ffmpeg version N-72842-gfb92f3e Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --cc=clang --enable-libx264 --enable-debug --disable-optimizations --disable-yasm --disable-asm --enable-libfdk-aac --enable-version3 --enable-nonfree --enable-gpl --disable-doc --enable-libmp3lame --enable-openssl --enable-libfreetype --enable-avresample
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './rotatedvid.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2013-09-11 10:04:39
    model           : iPhone 4
    model-ita       : iPhone 4
    encoder         : 6.0.1
    encoder-ita     : 6.0.1
    date            : 2013-09-11T12:04:38+0200
    date-ita        : 2013-09-11T12:04:38+0200
    make            : Apple
    make-ita        : Apple
  Duration: 00:00:11.12, start: 0.000023, bitrate: 10814 kb/s
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 10754 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2013-09-11 10:04:39
      handler_name    : Core Media Data Handler
      encoder         : H.264
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default)
    Metadata:
      creation_time   : 2013-09-11 10:04:39
      handler_name    : Core Media Data Handler
[libx264 @ 0x7ff74c805000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7ff74c805000] profile High, level 3.1
[libx264 @ 0x7ff74c805000] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    make-ita        : Apple
    model           : iPhone 4
    model-ita       : iPhone 4
    make            : Apple
    encoder         : Lavf56.36.100
    date            : 2013-09-11T12:04:38+0200
    date-ita        : 2013-09-11T12:04:38+0200
    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2013-09-11 10:04:39
      handler_name    : Core Media Data Handler
      encoder         : Lavc56.41.100 libx264
    Stream #0:1(und): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 44100 Hz, mono, s16, 96 kb/s (default)
    Metadata:
      creation_time   : 2013-09-11 10:04:39
      handler_name    : Core Media Data Handler
      encoder         : Lavc56.41.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
frame=   46 fps=0.0 q=0.0 size=       0kB time=00:00:02.76 bitrate=   0.1kbits/sframe=   75 fps= 71 q=29.0 size=     146kB time=00:00:03.71 bitrate= 321.8kbits/frame=  102 fps= 65 q=29.0 size=     331kB time=00:00:04.62 bitrate= 586.6kbits/frame=  129 fps= 61 q=29.0 size=     517kB time=00:00:05.52 bitrate= 766.8kbits/frame=  157 fps= 59 q=29.0 size=     708kB time=00:00:06.45 bitrate= 898.8kbits/frame=  184 fps= 58 q=29.0 size=     920kB time=00:00:07.36 bitrate=1024.1kbits/frame=  212 fps= 57 q=29.0 size=    1119kB time=00:00:08.28 bitrate=1105.5kbits/frame=  237 fps= 56 q=29.0 size=    1311kB time=00:00:09.12 bitrate=1176.8kbits/frame=  262 fps= 55 q=29.0 size=    1521kB time=00:00:09.96 bitrate=1250.5kbits/frame=  290 fps= 55 q=29.0 size=    1741kB time=00:00:10.89 bitrate=1309.5kbits/frame=  319 fps= 56 q=29.0 size=    1945kB time=00:00:11.07 bitrate=1438.2kbits/frame=  333 fps= 52 q=-1.0 Lsize=    2377kB time=00:00:11.12 bitrate=1751.0kbits/s    
video:2235kB audio:131kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.484018%
[libx264 @ 0x7ff74c805000] frame I:5     Avg QP:21.72  size: 21685
[libx264 @ 0x7ff74c805000] frame P:282   Avg QP:23.82  size:  7039
[libx264 @ 0x7ff74c805000] frame B:46    Avg QP:25.09  size:  4218
[libx264 @ 0x7ff74c805000] consecutive B-frames: 72.4% 27.6%  0.0%  0.0%
[libx264 @ 0x7ff74c805000] mb I  I16..4: 24.2% 64.9% 10.9%
[libx264 @ 0x7ff74c805000] mb P  I16..4:  0.5%  1.2%  0.6%  P16..4: 46.3%  5.5%  6.6%  0.0%  0.0%    skip:39.3%
[libx264 @ 0x7ff74c805000] mb B  I16..4:  0.0%  0.1%  0.4%  B16..8: 53.3%  1.5%  0.2%  direct: 1.0%  skip:43.4%  L0:42.3% L1:57.4% BI: 0.3%
[libx264 @ 0x7ff74c805000] 8x8 transform intra:55.8% inter:85.1%
[libx264 @ 0x7ff74c805000] coded y,uvDC,uvAC intra: 49.4% 41.5% 4.2% inter: 10.4% 25.7% 0.0%
[libx264 @ 0x7ff74c805000] i16 v,h,dc,p: 22%  9% 11% 58%
[libx264 @ 0x7ff74c805000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 11% 34%  4%  5%  5%  6%  6%  3%
[libx264 @ 0x7ff74c805000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30%  9% 34%  5%  3%  3%  4% 10%  2%
[libx264 @ 0x7ff74c805000] i8c dc,h,v,p: 71% 13% 15%  1%
[libx264 @ 0x7ff74c805000] Weighted P-Frames: Y:2.8% UV:0.0%
[libx264 @ 0x7ff74c805000] ref P L0: 68.4%  9.7% 16.0%  5.8%  0.1%
[libx264 @ 0x7ff74c805000] ref B L0: 88.1% 11.9%
[libx264 @ 0x7ff74c805000] kb/s:1647.02

comment:3 in reply to: ↑ 2 Changed 4 years ago by cehoyos

  • Resolution set to worksforme
  • Status changed from reopened to closed
$ ./ffmpeg -i ./rotatedvid.mov output.mp4
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 10754 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)

    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x1280, q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)
$ ./ffmpeg -noautorotate -i ./rotatedvid.mov output.mp4

    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 10754 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)

    Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)

The console output shows that the -noautorotate option works as expected, as in my tests.

comment:4 Changed 4 years ago by projectsymphony

  • Resolution changed from worksforme to invalid

Oh I see the problem, the encoded file had the display matrix copied from the original and when opened the player would display it as rotated. The flag works as expected.

Note: See TracTickets for help on using tickets.