[Ffmpeg-devel] elst tag in mov file -> audio/video out of synch

Leif Einar Aune leif.einar.aune
Tue Oct 3 16:31:05 CEST 2006


Hi!

 

I'm observing that ffmpeg produces 3gp files with audio/video out of synch,
but mencoder does not!

 

When transcoding a *.mov file containing a H264 video track of 38.23 seconds
and a AAC audio track of 33.43 seconds the resulting 3gp file will be 38
seconds.

 

However, the elst atom in the mov container specifies that the mediaTime for
the video track is 14471, meaning start 4.8 seconds into the stream.

 

Playing the original mov file in Quicktime or VLC results in synchronized
audio/video, and the total length is 33 seconds.

 

Playing the transcoded 3gp file of course gives out-of-synch video/audio,
since the whole video clip is included in the transcoded file.

 

When transcoding using mencoder and libavformat/libavcodec from the ffmpeg
source it produces a correct 3.gp file.

 

I've looked at the difference between mov.c from ffmpeg and demux_mov.c from
mencoder without spotting the obvious difference.

 

Command-line output:

 

/usr/local/src/newFfmpeg/ffmpeg/ffmpeg  -y -i atlantis_landing.mov  -vcodec
mpeg4 -b 210 -r 12 -acodec amr_nb -ab 48 -ar 8000 -ac 1 -s 176x132 test.3gp

 

FFmpeg version SVN-r6242, Copyright (c) 2000-2006 Fabrice Bellard, et al.

  configuration:  --enable-amr_nb --enable-pthreads --enable-gpl
--enable-faad --enable-faadbin --enable-faac --enable-xvid --enable-mp3lame
--enable-libogg --enable-vorbis --enable-amr_wb --tune=opteron --enable-x264
--enable-pp 

  libavutil version: 49.0.1

  libavcodec version: 51.16.0

  libavformat version: 50.5.0

  built on Oct  2 2006 17:12:43, gcc: 3.4.5 20051201 (Red Hat 3.4.5-2)

Stream mapping:

  Stream #0.0 -> #0.0

  Stream #0.1 -> #0.1

Press [q] to stop encoding

frame=  460 q=31.0 Lsize=     134kB time=33.4 bitrate=  32.9kbits/s    

video:71kB audio:52kB global headers:0kB muxing overhead 9.239900%

 

 

Running mp4info on the input-file gives this elst block:

 

type edts

    type elst

     version = 0 (0x00)

     flags = 0 (0x000000)

     entryCount = 1 (0x00000001)

      segmentDuration = 20028 (0x00004e3c)

      mediaTime = 14471 (0x00003887)

      mediaRate = 1 (0x0001)

      reserved = 0 (0x0000)

 

and this mdhd header for the same track:

 

type mdia

    type mdhd

     version = 0 (0x00)

     flags = 0 (0x000000)

     creationTime = 3242377490 (0xc142c112)

     modificationTime = 3242377491 (0xc142c113)

     timeScale = 2997 (0x00000bb5)

     duration = 114600 (0x0001bfa8)

     language = 0 (0x0000)

     reserved = <2 bytes> 00 00

 

the mvhd header gives:

 

type moov

  type mvhd

   version = 0 (0x00)

   flags = 0 (0x000000)

   creationTime = 3242377490 (0xc142c112)

   modificationTime = 3242377491 (0xc142c113)

   timeScale = 600 (0x00000258)

   duration = 20028 (0x00004e3c)

   rate = 1.000000

   volume = 1.000000

 

indicating the total clip length of 20028/600=33,38 seconds.

 

 

Could anyone please help me fix the mov.c or other file, or even better,
indicate that I'm missing some command-line options?

 

Best Regards

Leif Einar Aune





More information about the ffmpeg-devel mailing list