PDA

View Full Version : MKV Audio Delay


Oline 61
29th May 2006, 06:27
I have a movie backup consisting of 1 AVC track and 1 AC3 track in an MKV. I remember that I set a delay for the AC3 in mkvmerge, but I can't remember what it is. I want to demux the audio, and encode it to aac then remux into mp4, and I need to know the audio delay for this. How can I find out the audio delay from the MKV file?

robU*4
29th May 2006, 08:59
try mkvinfo -v and see when the timecode of the first audio packet

Oline 61
29th May 2006, 16:34
Thanks, that works.

Now I have another problem. When I demux with mkvextract I get a .ac3 and a .264. The original video used an SAR in x264, but when I remux the 264 to mp4, the SAR doesn't work. I am using ffdshow with the correct options set in the output pane, and the overlay is selected in MPC.

If I remux the demuxed video to mkv again, the SAR ceases to function again. I assume mkvextract must be removing the SAR info from the stram? How can I put it back in?

Oline 61
29th May 2006, 17:00
Nevermind, I found the par= command for MP4Box and it appears to work.

Oline 61
30th May 2006, 04:20
This looks like no delay, correct?
+ EBML head
|+ Doc type: matroska
|+ Doc type version: 1
|+ Doc type read version: 1
+ Segment, size 2346690309
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 4027)
|+ Segment information
| + Timecode scale: 1000000
| + Muxing application: libebml v0.7.7 + libmatroska v0.8.0
| + Writing application: mkvmerge v1.7.0 ('What Do You Take Me For') built on Apr 28 2006 17:20:19
| + Duration: 8834.826s (02:27:14.826000000)
| + Date: Mon May 22 21:36:57 2006 UTC
| + Segment UID: 0x8c 0xe1 0xf8 0x78 0x85 0xfc 0x51 0x34 0xb3 0x98 0xb6 0xd2 0xd9 0x03 0x8f 0xb8
|+ Segment tracks
| + A track
| + Track number: 1
| + Track UID: 3404661647
| + Track type: video
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 0
| + MinCache: 1
| + Timecode scale: 1.000000
| + Max BlockAddition ID: 0
| + Codec ID: V_MPEG4/ISO/AVC
| + Codec decode all: 1
| + CodecPrivate, length 131
| + Default duration: 41.709ms (23.976 fps for a video track)
| + Language: eng
| + Name: 1674kbps AVC
| + Video track
| + Pixel width: 704
| + Pixel height: 416
| + Interlaced: 0
| + Display width: 853
| + Display height: 416
| + A track
| + Track number: 2
| + Track UID: 4063761582
| + Track type: audio
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 1
| + MinCache: 0
| + Timecode scale: 1.000000
| + Max BlockAddition ID: 0
| + Codec ID: A_AC3
| + Codec decode all: 1
| + Default duration: 32.000ms (31.250 fps for a video track)
| + Language: eng
| + Name: 448kbps 5.1ch AC3
| + Audio track
| + Sampling frequency: 48000.000000
| + Channels: 6
|+ EbmlVoid (size: 1024)
|+ Cluster
| + Cluster timecode: 0.000s
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.000s = 00:00:00.000000000)
| + Frame with size 670
| + Block group
| + Block (track number 2, 8 frame(s), timecode 0.000s = 00:00:00.000000000)
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.167s = 00:00:00.167000000)
| + Frame with size 27
| + Reference block: -167.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.083s = 00:00:00.083000000)
| + Frame with size 21
| + Reference block: 84.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.042s = 00:00:00.042000000)
| + Frame with size 20
| + Reference block: 41.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.125s = 00:00:00.125000000)
| + Frame with size 21
| + Reference block: -83.000000ms
| + Block group
| + Block (track number 2, 8 frame(s), timecode 0.256s = 00:00:00.256000000)
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.334s = 00:00:00.334000000)
| + Frame with size 34
| + Reference block: -209.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.250s = 00:00:00.250000000)
| + Frame with size 23
| + Reference block: 84.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.209s = 00:00:00.209000000)
| + Frame with size 30
| + Reference block: 41.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.292s = 00:00:00.292000000)
| + Frame with size 23
| + Reference block: -83.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.501s = 00:00:00.501000000)
| + Frame with size 40
| + Reference block: -209.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.417s = 00:00:00.417000000)
| + Frame with size 26
| + Reference block: 84.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.375s = 00:00:00.375000000)
| + Frame with size 21
| + Reference block: 42.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.459s = 00:00:00.459000000)
| + Frame with size 23
| + Reference block: -84.000000ms
| + Block group
| + Block (track number 2, 8 frame(s), timecode 0.512s = 00:00:00.512000000)
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.667s = 00:00:00.667000000)
| + Frame with size 30
| + Reference block: -208.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.584s = 00:00:00.584000000)
| + Frame with size 24
| + Reference block: 83.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.542s = 00:00:00.542000000)
| + Frame with size 24
| + Reference block: 42.000000ms
| + Block group
| + Block (track number 1, 1 frame(s), timecode 0.626s = 00:00:00.626000000)
| + Frame with size 21
| + Reference block: -84.000000ms
| + Block group
| + Block (track number 2, 8 frame(s), timecode 0.768s = 00:00:00.768000000)
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792
| + Frame with size 1792

unmei
30th May 2006, 08:12
Yes,
as you can see the first block group in that cluster contains the first video frame (track 1) at time 0 and the second block group contains the first fe audio packets (track 2) also at time 0.

robU*4
30th May 2006, 10:43
Be careful, mkvmerge sometimes does padding/cutting depending on the options. I don't remember the options...