View Single Post
Old 19th October 2008, 22:31   #649  |  Link
lchiu7
Registered User
 
Join Date: Apr 2002
Posts: 279
audio/video sync problems with MP4 and AC-3

This is a strange one. Using the 2.2.0 GUI I

This is the situation. Our local broadcaster transmits HD as H.264 with AC-3 audio over DVB-T. Files end up quite large 4G/hr so I want to compress them and remove the ads.

I can remove ads okay with tspacket editor but the resulting file has AC-3 packet errors which are not apparent when played but play havoc with programs like tsremuxer etc. It seems that the packet errors occur at cut points.

So I thought I would do the following.

1. Break up the file into each segment between ad breaks.
2. Compress each segment into h.264 using x264
3. demux the AC-3 audio from each segment using dgavcindex
4. Merge the compressed video with the original audio into a MKV container using mkvmerge.

This seems to work fine. dgavcindex outputs the AC-3 file with a name containing text like DELAY -234ms and mkvmerge reads that delay value and inserts it into the parameter for delays.

However I end up with 4-5 separate mkv files for the one show. What I want to do of course is have just one file.

Thought I could do that with mkvmerge and just merge the 5 MKV files together. While that works, the resultant file loses audio/video sync - in fact the sync is fine for the part of the video that comes from the first file, it loses sync after that. That is strange since each individual file is in sync - it's just the merged file that isn't.

Tried something else - that is, rather than create 5 files, create one file by using the append option for each MP4 file but taking note for each different audio file, marking the appropriate delay for it.

That also doesn't work. Audio/video goes out of sync after the first segment.

Finally tried just a DOS copy /b option to concatenate the 5 files together but the resultant file just plays up to the end of the first segment.

Any thoughts or ideas appreciated on what I could do now.

Thanks

Larry
lchiu7 is offline