Strange audio delay - 2 identical streams one is OK one is shifted

Started by IcePlanet, August 19, 2025, 08:11:35 PM

Previous topic - Next topic

IcePlanet

After last help all encoding run without any problems. But now I encountered strange problem. Have 2 recordings (.ts), made from the same stream and 24 hours apart, each recording has 2 audio tracks. Encoding settings identical on both recordings and on both tracks. 3 tracks are perfectly in sync, but 4th track is out of sync.

Video 1 audio track 0 is out of sync
Video 1 audio track 1 is in sync
Video 2 audio track 0 is in sync
Video 2 audio track 1 is in sync

The sync is almost precise at beginning of output file, and 1.5s at the end. The bad thing is that I can not replicate on small block of the file.

Media info from the original .ts

MPEG Audio Version 1 Layer 2 Constant 160 kb/s 160 kb/s



Media info from the resulting .mkv
AAC LC SBR PS HE-AACv2 NBC A_AAC-29 2 channels



Attached is .py script for both encodings and Media Info from all 4 files (2x original, 2x result).

alexstorm

This version of Karate Kid was probably shot in Canada with DCI specification represent 2K or 4K image resolution in 24 fps or 48 fps (frame per second) in JPG2000 sequence / Interop
So the original is probably released online with 24 fps.  Your version is 25 fps and dubbed.

Two hours would have 25 fps to be 180,000 frames and 24 fps would be 172,800 frames, a difference of 7,200 frames, would be 288 seconds or 4 minutes 48 seconds.  What happens is that the video gets an extra frame blended into it every second.  Two frames are blended together and that result is added to the sequence of frames, so playback on 25 fps TV looks fine.  The background audio can either be slowed down to match 24 frames in a second, which would lower the pitch or it can be then harmonized back upward so the music is in key and the sound effects are not slowed down.  Then the audio dub goes on top of this background audio track and is synced for 25 fps for European TV playback.

A lot of this is sort of uncessasary background info.  I wanted to point out how much manipulation is done for some copies of media.  Both video and audio are not original anymore.  Is the one track that doesn't sync unique and have different content or is it the same as the previous track.  Perhaps it is a copy that syncs better with 24 fps?  There are many steps where the audio sync can fail because of that the original media was already convereted for 25 fps playback.  I think if you want everything to sync, get the original media content that has not been converted to 25 fps and work with that instead.