Opened 12 years ago

Closed 7 years ago

#1033 closed defect (fixed)

MOV file with non-zero/negative start has no sync between A/V unless -async 1 is used

Reported by: Deron Kazmaier Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov async
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I have a couple files which someone generated by loading the video into QT on the Mac and some how selecting an range and resaving. Not a QT user, so don't know how they did it. The resulting files play properly in QT and other apps, but when played with ffplay or reencoded to another format in ffmpeg, they are out of sync. In ffplay, the first frame holds for many seconds while the audio plays, and when the video does start it is behind the audio by the number of seconds it held the initial video. Converted files in ffmpeg have same/similar problems using commands like "ffmpeg -i bad_mov_start.mov -c:v libx264 -preset veryfast -qp 0 bad_mov_start.mp4".

The smallest(!) file is 1.8Gb, and can be downloaded from a good server at http://www.usmediavault.com/bad_mov_start.mov

Thanks for your great work! If this was something I could help fix (I have some small knowledge from writing a libavdevice) I would be willing to take a stab but knowing where to start and what the actual problem is would help. From my perspective, it is like a needle in a haystack! Just let me know if I can be of some use.


ffmpeg -v 9 -loglevel 99 -i bad_mov_start.mov
ffmpeg version N-38488-gf972193 Copyright (c) 2000-2012 the FFmpeg developers

built on Mar 4 2012 00:22:11 with gcc 4.5.2
configuration: --enable-shared --enable-gpl --enable-nonfree --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-librtmp --enable-libopenjpeg --enable-decklink
libavutil 51. 41.100 / 51. 41.100
libavcodec 54. 6.100 / 54. 6.100
libavformat 54. 2.100 / 54. 2.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 62.101 / 2. 62.101
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 7.100 / 0. 7.100
libpostproc 52. 0.100 / 52. 0.100

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x23403a0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x23403a0] ISO: File Type Major Brand: qt
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x23403a0] All info found
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bad_mov_start.mov':

Metadata:

major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2012-02-27 01:30:20

Duration: 00:01:33.31, start: -12.126126, bitrate: 149599 kb/s

Stream #0:0(eng), 47, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32, 1152 kb/s
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler

Stream #0:1(eng), 24, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32, 1152 kb/s
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler

Stream #0:2(eng), 24, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32, 1152 kb/s
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler

Stream #0:3(eng), 24, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32, 1152 kb/s
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler

Stream #0:4(eng), 24, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32, 1152 kb/s
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler

Stream #0:5(eng), 24, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32, 1152 kb/s
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler

Stream #0:6(eng), 24, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32, 1152 kb/s
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler

Stream #0:7(eng), 24, 1/48000: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32, 1152 kb/s
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler

Stream #0:8(eng), 1, 1/2997: Video: prores (apcn / 0x6E637061), yuv422p10le, 1920x1080, 1/2997, 140357 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 2997 tbc
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler

Stream #0:9(eng), 1, 1/2997: Data: none (tmcd / 0x64636D74)
Metadata:

creation_time : 2012-02-27 01:30:20
handler_name : ?Apple Alias Data Handler
timecode : 00:00:00:00

At least one output file must be specified

Change History (7)

comment:1 by Carl Eugen Hoyos, 12 years ago

Keywords: mov prores added
Reproduced by developer: set
Status: newopen

Reproducible with ffmpeg -i bad_mov_start.mov -qscale 2 out.avi (assuming the speaker is supposed to say "the husband" very shortly after the game begins when the ball is thrown in).

comment:2 by Keith, 12 years ago

I am having a similar issue with respect to ffmpeg showing negative start times. This also seems to be tied to incorrect reporting of Duration.

more info here
http://stackoverflow.com/questions/10640088/why-does-ffmpeg-report-different-durations

comment:3 by Carl Eugen Hoyos, 12 years ago

Both samples can be transcoded correctly with -async 1.

comment:4 by Michael Niedermayer, 12 years ago

Summary: MOV file with non-zero/negative start has no sync between A/VMOV file with non-zero/negative start has no sync between A/V unless -async 1 is used

comment:5 by Carl Eugen Hoyos, 11 years ago

Keywords: async added

comment:6 by Carl Eugen Hoyos, 11 years ago

Keywords: prores removed

comment:7 by Carl Eugen Hoyos, 7 years ago

Component: undeterminedavformat
Resolution: fixed
Status: openclosed

Fixed since 47695b1d

Note: See TracTickets for help on using tickets.