[FFmpeg-trac] #8329(ffmpeg:new): Rotation metadata not overridden when the input video has rotation metadata set to 180

FFmpeg trac at avcodec.org
Wed Oct 23 02:54:42 EEST 2019


#8329: Rotation metadata not overridden when the input video has rotation metadata
set to 180
-----------------------------------+---------------------------------------
             Reporter:  hungryTux  |                     Type:  defect
               Status:  new        |                 Priority:  normal
            Component:  ffmpeg     |                  Version:  unspecified
             Keywords:             |               Blocked By:
             Blocking:             |  Reproduced by developer:  0
Analyzed by developer:  0          |
-----------------------------------+---------------------------------------
 Summary of the bug:

 I have a MOV file that I'm trying to transcode using the
 '''-noautorotate''' and '''-metadata:s:v rotate=0''' flags. I was
 expecting the output file to have rotation metadata set to 0, but it
 appears the rotation metadata is just getting copied over from the input
 file.

 Version of FFMPEG: 3.4.5

 Complete debug logs here: https://paste.ee/p/EtqKm

 How to reproduce:
 ffprobe output on input file:
 {{{
 % ./ffprobe -v quiet -print_format json -show_format -show_streams
 2019-02-11_16-51-38_000.MOV
 {
     "streams": [
         {
             "index": 0,
             "codec_name": "hevc",
             "codec_long_name": "H.265 / HEVC (High Efficiency Video
 Coding)",
             "profile": "Main",
             "codec_type": "video",
             "codec_time_base": "67/1995",
             "codec_tag_string": "hvc1",
             "codec_tag": "0x31637668",
             "width": 1920,
             "height": 1080,
             "coded_width": 1920,
             "coded_height": 1088,
             "has_b_frames": 2,
             "sample_aspect_ratio": "0:1",
             "display_aspect_ratio": "0:1",
             "pix_fmt": "yuvj420p",
             "level": 123,
             "color_range": "pc",
             "refs": 1,
             "r_frame_rate": "30/1",
             "avg_frame_rate": "1995/67",
             "time_base": "1/600",
             "start_pts": -20,
             "start_time": "-0.033333",
             "duration_ts": 21082,
             "duration": "35.136667",
             "bit_rate": "15000382",
             "nb_frames": "1064",
             "disposition": {
                 "default": 1,
                 "dub": 0,
                 "original": 0,
                 "comment": 0,
                 "lyrics": 0,
                 "karaoke": 0,
                 "forced": 0,
                 "hearing_impaired": 0,
                 "visual_impaired": 0,
                 "clean_effects": 0,
                 "attached_pic": 0,
                 "timed_thumbnails": 0
             },
             "tags": {
                 "rotate": "180",
                 "creation_time": "2019-02-12T01:33:04.000000Z",
                 "language": "und",
                 "handler_name": "Core Media Data Handler",
                 "encoder": "HEVC"
             },
             "side_data_list": [
                 {
                     "side_data_type": "Display Matrix",
                     "displaymatrix": "\n00000000:       -65536           0
 0\n00000001:            0      -65536           0\n00000002:            0
 0  1073741824\n",
                     "rotation": -180
                 }
             ]
         }
     ],
     "format": {
         "filename": "2019-02-11_16-51-38_000.MOV",
         "nb_streams": 1,
         "nb_programs": 0,
         "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
         "format_long_name": "QuickTime / MOV",
         "start_time": "-0.033333",
         "duration": "35.136667",
         "size": "67019028",
         "bit_rate": "15259051",
         "probe_score": 100,
         "tags": {
             "major_brand": "qt  ",
             "minor_version": "0",
             "compatible_brands": "qt  ",
             "creation_time": "2019-02-12T01:33:04.000000Z",
             "com.apple.quicktime.location.ISO6709":
 "+47.6471-122.3589+030.650/",
             "com.apple.quicktime.make": "Apple",
             "com.apple.quicktime.model": "iPhone XS",
             "com.apple.quicktime.software": "12.1.4",
             "com.apple.quicktime.creationdate": "2019-02-11T16:51:38-0800"
         }
     }
 }

 }}}

 Command used to transcode the input
 {{{
 % ./ffmpeg -loglevel debug -y -noautorotate -i 2019-02-11_16-51-38_000.MOV
 -threads 0 -map_chapters -1 -f mp4 -movflags faststart -filter_complex
 '[0:v:0]yadif=deint=interlaced,scale=1280:720:flags=bicubic,setdar=1.7778[v0];[v0]concat=n=1:v=1:a=0[cat_v]'
 -an -sn -map [cat_v] -vcodec libx264 -profile:v main -level 3.1 -maxrate
 2048k -bufsize 20480k -preset medium -crf 22 -x264opts ref=3:keyint=90 -r
 24.0 -vsync 1 -metadata:s:v rotate=0 -pix_fmt yuv420p -metadata:s:v
 language=eng test-mov.mp4
 }}}

 ffprobe output on the output file. (Notice the rotation info is copied
 over)
 {{{
 %./ffprobe -v quiet -print_format json -show_format -show_streams test-
 mov.mp4
 {
     "streams": [
         {
             "index": 0,
             "codec_name": "h264",
             "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part
 10",
             "profile": "Main",
             "codec_type": "video",
             "codec_time_base": "1/48",
             "codec_tag_string": "avc1",
             "codec_tag": "0x31637661",
             "width": 1280,
             "height": 720,
             "coded_width": 1280,
             "coded_height": 720,
             "has_b_frames": 2,
             "sample_aspect_ratio": "1:1",
             "display_aspect_ratio": "16:9",
             "pix_fmt": "yuv420p",
             "level": 31,
             "chroma_location": "left",
             "refs": 1,
             "is_avc": "true",
             "nal_length_size": "4",
             "r_frame_rate": "24/1",
             "avg_frame_rate": "24/1",
             "time_base": "1/12288",
             "start_pts": 0,
             "start_time": "0.000000",
             "duration_ts": 433152,
             "duration": "35.250000",
             "bit_rate": "2278083",
             "bits_per_raw_sample": "8",
             "nb_frames": "846",
             "disposition": {
                 "default": 1,
                 "dub": 0,
                 "original": 0,
                 "comment": 0,
                 "lyrics": 0,
                 "karaoke": 0,
                 "forced": 0,
                 "hearing_impaired": 0,
                 "visual_impaired": 0,
                 "clean_effects": 0,
                 "attached_pic": 0,
                 "timed_thumbnails": 0
             },
             "tags": {
                 "rotate": "180",
                 "language": "eng",
                 "handler_name": "VideoHandler"
             },
             "side_data_list": [
                 {
                     "side_data_type": "Display Matrix",
                     "displaymatrix": "\n00000000:       -65536           0
 0\n00000001:            0      -65536           0\n00000002:            0
 0  1073741824\n",
                     "rotation": -180
                 }
             ]
         }
     ],
     "format": {
         "filename": "test-mov.mp4",
         "nb_streams": 1,
         "nb_programs": 0,
         "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
         "format_long_name": "QuickTime / MOV",
         "start_time": "0.000000",
         "duration": "35.250000",
         "size": "10048917",
         "bit_rate": "2280605",
         "probe_score": 100,
         "tags": {
             "major_brand": "isom",
             "minor_version": "512",
             "compatible_brands": "isomiso2avc1mp41",
             "encoder": "Lavf57.83.100"
         }
     }
 }
 }}}

 ffmpeg version:
 {{{
 % ./ffmpeg -version
 ffmpeg version 3.4.5 Copyright (c) 2000-2018 the FFmpeg developers
 built with gcc 4.1.2 (GCC) 20070626 (Red Hat 4.1.2-14)
 configuration: --prefix=/local/p4clients/pkgbuild-
 z8TTk/workspace/src/FFmpeg/build/private/install --pkg-config-
 flags=--static --enable-gpl --enable-nonfree --enable-libx264 --enable-
 libfdk-aac --enable-libvpx --enable-libspeex --enable-encoder=vorbis
 --enable-libvorbis --enable-libmp3lame --enable-static --disable-
 protocol=hls --disable-demuxer=hls --disable-decoder=prores --disable-
 decoder=prores_lgpl --disable-ffplay --disable-ffserver --disable-shared
 libavutil      55. 78.100 / 55. 78.100
 libavcodec     57.107.100 / 57.107.100
 libavformat    57. 83.100 / 57. 83.100
 libavdevice    57. 10.100 / 57. 10.100
 libavfilter     6.107.100 /  6.107.100
 libswscale      4.  8.100 /  4.  8.100
 libswresample   2.  9.100 /  2.  9.100
 libpostproc    54.  7.100 / 54.  7.100
 }}}

 This is not reproducible on all input files with rotation info set. I
 tried the same command out with a file containing rotation metadata set to
 90 degrees, and in that case the rotation metadata wasn't copied over.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8329>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list