View Single Post
Old 6th August 2018, 15:50   #12  |  Link
JeanMarc
Registered User
 
Join Date: Aug 2006
Location: USA
Posts: 59
tsmuxer audio delay

My situation was a little different, and this solution might not be applicable here, but might still shed some light on how tsmuxer can generate this audio delay.

I was frustrated by the same issue: a progressive audio delay that could reach 20 seconds at the end of 2 hour movie.
The files I was using seemed well synchronized, but as soon as tsmuxer or multiavchd was muxing them into m2ts, the audio sync issue would be there.

I finally found that my original file didn't have a stable frame rate. The players were able to maintain the synchronization, but not tsmuxer. Apparently, tsmuxer doesn't behave like a regular player, and loses the audio-video sync information. It muxes the video at the (inaccurate) video frame rate, and the audio at the nominal frame rate. Since they are different a delay is generated.

My solution was to change my ffmpeg encoding. I was using the -r option to set the frame rate, which apparently doesn't produce a very reliable frame rate. I changed that to use the fps filter, which sets a perfectly constant frame rate.

More generally, my advice would be to run an ffmpeg command that would set a constant frame rate with the fps filter. This has solved the problem for me.
JeanMarc is offline   Reply With Quote