Avidemux cut introduces required audio delay

Started by poweless, July 22, 2016, 10:15:07 PM

Previous topic - Next topic

poweless

I am trying to cut a 4-second segment from a bluray m2ts file.  Since Avidemux cannot seem to output m2ts, I tried saving to mp4 instead.  My ultimate goal is getting it back to bluray and, for that purpose, I am using tsmuxer.  Since tsmuxer apparently doesn't like mp4 files, I extracted the raw h264 and two ac3 audio streams from the mp4 file created by Avidemux (with mp4box) and recreated the bluray structure.  The resulting bluray audio is out of sync by what appeared to be exactly 1 second.  If I add a 1 second delay to the audio streams with tsmuxer, the audio is then synced.  I used VLC to determine the length of the delay.

I followed the same process in Avidemux again but instead saved to a .ts file.  Now, when I bring the .ts file into tsmuxer, it automatically knows about a 1024ms delay to both audio streams.  So that taught me I need a 1024ms delay rather than 1000ms.  I'm grateful to have stumbled onto that bit of information.  I read a post somewhere that complained about tsmuxer audio delay issues which suggested tsremux.  tsremux was a disaster; VLC couldn't even play the files it created, plus it lacks some of the nice features tsmuxer supports like custom chapter points.

Since there is no audio delay in the original m2ts, why is it now necessary to add this delay to the audio after using Avidemux to cut it?  Did Avidemux cut a segment from the beginning of the audio file and not the video file?  This bit of trial and error should not have been necessary.

I've since wanted to mux an srt subtitle file into the bluray and it needed the 1024ms delay as well.