Opened 6 years ago

Last modified 6 years ago

#2044 new defect

timecode copying error with variable frame rate QuickTime files

Reported by: dericed Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: timecode, mov, vfr
Cc: ubitux@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Video capture in Final Cut Pro often creates variable frame rate QuickTime? files (where only the first and sometimes last frame deviate have frame durations that deviate from the rest). When I try to convert these files in ffmpeg while preserving timecode the results are unexpected.

I'm attaching a sample produced by using FCP to capture two frames from a tape. By reading the sample-to-time table in the video trak the first frame has a duration of 401/2997 and the rest have frame durations of 100/2997.

When I try to copy the tracks of this input to an output quicktime file the timecode track in the output does not match the input's timecode track. When the input is opened in QuickTime? or FCP the first frame of the sample is 00:59:14;24 and the second is 00:59:14;25. With the output the first frame is 00:59:14;24 but the second is 00:59:14;28.

How to reproduce:

ffmpeg started on 2012-12-19 at 00:21:21
Report written to "ffmpeg-20121219-002121.log"
Command line:
ffmpeg -report -y -i fcp_capture.mov -c:v copy -c:a copy -r ntsc output.mov
ffmpeg version 1.0.git Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 18 2012 23:49:10 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-ffplay
  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 80.100 / 54. 80.100
  libavformat    54. 49.102 / 54. 49.102
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 28.102 /  3. 28.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffe3900f800] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffe3900f800] ISO: File Type Major Brand: qt  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffe3900f800] File position before avformat_find_stream_info() is 8447
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffe3900f800] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffe3900f800] File position after avformat_find_stream_info() is 746703
Guessed Channel Layout for  Input Stream #0.2 : stereo
Guessed Channel Layout for  Input Stream #0.3 : mono
Guessed Channel Layout for  Input Stream #0.4 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'fcp_capture.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2012-11-28 08:06:53
  Duration: 00:00:00.07, start: 0.100434, bitrate: 173589 kb/s
    Stream #0:0(eng), 1, 1/2997: Video: rawvideo (2vuy / 0x79757632), uyvy422, 720x486, 66983 kb/s, 11.96 fps, 7.47 tbr, 2997 tbn, 2997 tbc
    Metadata:
      creation_time   : 2012-11-28 08:06:53
      handler_name    : Apple Alias Data Handler
      timecode        : 00:59:14;24
    Stream #0:1(eng), 0, 1/2997: Subtitle: eia_608 (c608 / 0x38303663)
    Metadata:
      creation_time   : 2012-11-28 08:06:53
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng), 4, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 2304 kb/s
    Metadata:
      creation_time   : 2012-11-28 08:06:53
      handler_name    : Apple Alias Data Handler
    Stream #0:3(eng), 4, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32, 1152 kb/s
    Metadata:
      creation_time   : 2012-11-28 08:06:53
      handler_name    : Apple Alias Data Handler
    Stream #0:4(eng), 4, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32, 1152 kb/s
    Metadata:
      creation_time   : 2012-11-28 08:06:53
      handler_name    : Apple Alias Data Handler
    Stream #0:5(eng), 0, 1/2997: Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 2012-11-28 08:06:53
      handler_name    : Apple Alias Data Handler
      timecode        : 00:59:14;24
Output #0, mov, to 'output.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf54.49.102
    Stream #0:0(eng), 0, 1/30000: Video: rawvideo (2vuy / 0x79757632), uyvy422, 720x486, q=2-31, 66983 kb/s, 11.96 fps, 30k tbn, 29.97 tbc
    Metadata:
      creation_time   : 2012-11-28 08:06:53
      handler_name    : Apple Alias Data Handler
      timecode        : 00:59:14;24
    Stream #0:1(eng), 0, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, 2304 kb/s
    Metadata:
      creation_time   : 2012-11-28 08:06:53
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
No more output streams to write to, finishing.
frame=    2 fps=0.0 q=-1.0 Lsize=    1388kB time=00:00:00.16 bitrate=67994.3kbits/s    
video:1367kB audio:19kB subtitle:0 global headers:0kB muxing overhead 0.135388%
Statistics: 1470868 bytes read, 2 seeks

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (2)

fcp_capture.mov (1.4 MB) - added by dericed 6 years ago.
sample FCP capture QuickTime? file with timecode track
output.mov (1.4 MB) - added by dericed 6 years ago.
output file of example

Change History (3)

Changed 6 years ago by dericed

sample FCP capture QuickTime? file with timecode track

Changed 6 years ago by dericed

output file of example

comment:1 in reply to: ↑ description Changed 6 years ago by cehoyos

Replying to dericed:

When the input is opened in QuickTime? or FCP the first frame of the sample is 00:59:14;24 and the second is 00:59:14;25. With the output the first frame is 00:59:14;24 but the second is 00:59:14;28.

Isn't this the expected behaviour given that FFmpeg's mov muxer only supports cfr?

Note: See TracTickets for help on using tickets.