PDA

View Full Version : MKV audio delay question


gizzin
10th February 2009, 17:22
I was wondering how do you figure out the audio delay in a MKV file ??

neuron2
10th February 2009, 17:45
The question is meaningless for MKV containers.

sneaker_ger
11th February 2009, 15:15
The question is meaningless for MKV containers.

May I ask why?

neuron2
11th February 2009, 15:26
Each track has timestamps for its access units. This allows the player to align the tracks during playback. So, there is no "delay in an MKV file".

For a transport stream, the same applies and the issue of "delay" arises only when the streams are demuxed. Even there, there is no one delay, because it depends on the particular way you do the demuxing.

I cannot find any field in the Matroska container to specify an offset for the audio, which might be another interpretation of "delay".

So, we can ask the original poster to clarify his question.

poisondeathray
11th February 2009, 15:47
In mkvmergegui, when you highlight the audio track, in the format specific options tab, there is an audio delay box. There should be a corresponding command line for the cli version

If you open a .mkv in eac3to, it usually reports a delay for each audio track - I don't know how accurate this is

Can you clarify if my understanding is correct, neuron2? (or anyone)?

neuron2
11th February 2009, 16:06
I stand corrected.

I looked at the mkvtoolnix source and they implement delay by offsetting the timecodes. So, I suppose that means the initial timecode for the first access unit of a track doesn't have to start at 0.

That means that a delay in the MKV file can be interpreted as the difference between the first timecode for the video and the first timecode for the audio.

madshi can clarify if this is what his tool is reporting.

Inspector.Gadget
12th February 2009, 20:55
You can do this by piping mkvinfo's output to a text file and looking for the start time of the first block of the audio track in question (if audio precedes video, then vice versa).

SamLowry
13th February 2009, 06:23
mkmerge man page (http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html#EXTERNAL TIMECODE FILES) clearly states:
mkvmerge allows the user to chose the timecodes for a specific track himself. This can be used in order to create files with variable frame rate video or include gaps in audio.

Implement explicit timecodes for audiotrack starting with a value reflecting the audio delay you aim at.

I haven't tried this myself but hope it will do the job.