Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#2958 closed defect (fixed)

Transcoding some iPhone camera roll videos outputs excessive frame-rate

Reported by: Neal McConnell Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov fps
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

OS: CentOS 6.3 64-bit
Build: N-55797-g535d9a9
Obtained from: http://ffmpeg.gusari.org/static/64bit/

Summary of the bug:
I am attempting to transcode several MOVs that are directly from an iPhone4's camera roll folder. I do not specify frame-rate, since the videos are variable frame-rate (24,30 fps). For a few of the MOVs, the transcoded h264 output has a declared fps of 600, causing the h264 level to be very high, which means that some players reject playback. I noticed for these MOV files that FFmpeg, in the input stats, reports "tbr 600".
I checked the video timestamps of the particular files using FFprobe. All PTS differences don't amount to anything more than 31 fps.

How to reproduce:
Use the following source
https://www.dropbox.com/s/xji1akd6tuuravd/from_iphone4.MOV

with the following command:

% ffmpeg -report -i from_iphone4.MOV -c:v libx264 -crf 23 -an shouldbe30fps.mp4

I will attached the report, as the console output is annoyingly long.

Please note that this entry is very similar to issue #2451.

Attachments (1)

2958_report.log (1.0 MB ) - added by Neal McConnell 11 years ago.
Report output from trancode

Download all attachments as: .zip

Change History (6)

by Neal McConnell, 11 years ago

Attachment: 2958_report.log added

Report output from trancode

comment:1 by Carl Eugen Hoyos, 11 years ago

Keywords: mov added
Version: unspecifiedgit-master

For future tickets: If a problem is reproducible without external libraries, please don't use them.

If you are correct and the input video is vfr, I don't think anything can be done (except fixing vfr in mov).

$ ffmpeg -i from_iphone4.MOV -q:v 2 -vcodec mpeg4 -strict -2 -acodec aac out.mov
ffmpeg version N-56261-gfc47726 Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep 13 2013 17:39:25 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 43.100 / 52. 43.100
  libavcodec     55. 31.101 / 55. 31.101
  libavformat    55. 16.102 / 55. 16.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 84.100 /  3. 84.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'from_iphone4.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2013-01-13 22:11:45
    model           : iPhone 4
    model-eng       : iPhone 4
    encoder         : 6.0.1
    encoder-eng     : 6.0.1
    date            : 2013-01-13T17:11:45-0500
    date-eng        : 2013-01-13T17:11:45-0500
    make            : Apple
    make-eng        : Apple
  Duration: 00:00:16.87, start: 0.000000, bitrate: 10805 kb/s
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 10718 kb/s, 24.33 fps, 600 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      creation_time   : 2013-01-13 22:11:45
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default)
    Metadata:
      creation_time   : 2013-01-13 22:11:46
      handler_name    : Core Media Data Handler
Output #0, mov, to 'out.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    make-eng        : Apple
    model           : iPhone 4
    model-eng       : iPhone 4
    make            : Apple
    encoder-eng     : 6.0.1
    date            : 2013-01-13T17:11:45-0500
    date-eng        : 2013-01-13T17:11:45-0500
    encoder         : Lavf55.16.102
    Stream #0:0(und): Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 1280x720, q=2-31, 200 kb/s, 19200 tbn, 600 tbc (default)
    Metadata:
      creation_time   : 2013-01-13 22:11:45
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2013-01-13 22:11:46
      handler_name    : Core Media Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (aac -> aac)
Press [q] to stop, [?] for help
frame=10110 fps=697 q=2.0 Lsize=  208383kB time=00:00:16.90 bitrate=100985.7kbits/s dup=9699 drop=0
video:208062kB audio:268kB subtitle:0 global headers:0kB muxing overhead 0.025869%

Workaround is to specify an output frame rate:

$ ffmpeg -i from_iphone4.MOV -q:v 2 -vcodec mpeg4 -strict -2 -acodec aac -r 24 out24.mov
ffmpeg version N-56261-gfc47726 Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep 13 2013 17:39:25 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 43.100 / 52. 43.100
  libavcodec     55. 31.101 / 55. 31.101
  libavformat    55. 16.102 / 55. 16.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 84.100 /  3. 84.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'from_iphone4.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2013-01-13 22:11:45
    model           : iPhone 4
    model-eng       : iPhone 4
    encoder         : 6.0.1
    encoder-eng     : 6.0.1
    date            : 2013-01-13T17:11:45-0500
    date-eng        : 2013-01-13T17:11:45-0500
    make            : Apple
    make-eng        : Apple
  Duration: 00:00:16.87, start: 0.000000, bitrate: 10805 kb/s
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 10718 kb/s, 24.33 fps, 600 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      creation_time   : 2013-01-13 22:11:45
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default)
    Metadata:
      creation_time   : 2013-01-13 22:11:46
      handler_name    : Core Media Data Handler
Output #0, mov, to 'out24.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    make-eng        : Apple
    model           : iPhone 4
    model-eng       : iPhone 4
    make            : Apple
    encoder-eng     : 6.0.1
    date            : 2013-01-13T17:11:45-0500
    date-eng        : 2013-01-13T17:11:45-0500
    encoder         : Lavf55.16.102
    Stream #0:0(und): Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 1280x720, q=2-31, 200 kb/s, 12288 tbn, 24 tbc (default)
    Metadata:
      creation_time   : 2013-01-13 22:11:45
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2013-01-13 22:11:46
      handler_name    : Core Media Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (aac -> aac)
Press [q] to stop, [?] for help
frame=  407 fps=248 q=2.0 Lsize=   48379kB time=00:00:16.95 bitrate=23370.3kbits/s dup=0 drop=4
video:48100kB audio:268kB subtitle:0 global headers:0kB muxing overhead 0.022950%

comment:2 by rmk, 11 years ago

The video is indeed VFR. Looking at the sample to time table, one can see sample durations that vary between 23,x and 30 FPS.

Seems to be a known issue: https://discussions.apple.com/thread/2480522?start=0&tstart=0

comment:3 by Carl Eugen Hoyos, 10 years ago

Keywords: fps added
Reproduced by developer: set
Status: newopen

comment:4 by Michael Niedermayer, 10 years ago

Resolution: fixed
Status: openclosed

comment:5 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavformat
Note: See TracTickets for help on using tickets.