I have an .MP4 file with one video track (H.264, 25 FPS) and one audio track (MP2). The total length is ~2:52 (two hours, 52 minutes). I've noticed that A/V is synchronous before ~2:34 but async afterwards, i.e. audio is late ~0.3 s.
My plan was to
- Extract the audio track to .MP2
- Cut the 0.3 s (using mp3directCut, which works fine)
- Mux the video track and the cut audio track.
Done. However, the result wasn't satisfying because A/V was out of sync right from the start of the video. I took a closer look at the original file and dumped the timestamps. The smallest PTS of the video track is 0.16 s, and the PTSs are all increasing by 0.04 and without any gap. The smallest PTS of the audio track is 0.212 s, and most PTSs increase by 24 ms (normal for MP2), but few diffs are smaller or greater than 24 ms (which is ok, but obviously a problem when extracting the track, see question below)
My questions are: Do I lose timestamps when extracting to MP2? Then my initial plan is foredoomed. Which other way is there to cut a small part of an audio track inside an MP4 file? Without reencoding audio, of course. I'm familiar with FFmpeg and AviDemux.