[MEncoder-users] A/V sync challenges on h.264 transcoding, especially with edited files

Steve Mushero Steve at tudou.com
Sun Nov 4 13:02:02 CET 2007


Hi - We are testing transacoding thousands of video streams to h.265/mp4
for web downloading and are having A/V sync issues no matter how we do
it.  The main challenge seems to be in source files that have been
edited to add an advertisement or split for length - the extracted video
& audio streams are different length even before we transcode to
h.264/AAC.  But if we transcode to FLV or AVI (which we've done millions
of times) they play just fine, but in MP4 they are out of sync as much
as 50% of the time.  Is there something different in the mp4 container
that makes it more sensitive to these sync issues or timing than FLV or
AVI ?

We have tried many methods to transcode, though our main method was to
extract the audio/video steams from the incoming container, encode them
separately (video with mencoder), then mux with mp4box.  We went that
route due to reported bug issues with mencoder creating mp4's directly
from AVIs, etc. but that path also results in sync issues.  We also have
tried transcoding twice, first to AVI and then to MP4, but have the same
issues.  Looking back into the source files or intermediate-AVI, we see
different audio/video lengths, but they play okay until they get to MP4,
where they are out of sync.

We have thought of trying to measure the time difference and introducing
a delay with mp4box, but that'll only work if it's a start delay and we
can measure it.  For mid-clip edits, etc. this is a problem.  It seems
that the editing of the source before we get it messes up the time codes
in a way that trips up the mp4 container.  Also, in some cases, the
quality of the stream generation (often from a cheap video capture card)
can also cause sync challenges that get worse in mp4.  

We can send samples to anyone interesting, though they are large
(usually 10-30 minutes).

Thanks.

Steve




More information about the MEncoder-users mailing list