I use MeGUI for conversions of ts in mkv, I need to know how to sync/adjust the video and audio delay automatically, I use this process. Megui> Create avs script> locate the file. Ts> change resolution and crop and save the file avs to queue up the MeGUI.
In VLC PLAYER convert the same file .Ts for audio AC3, and mux ac3 with mkv in mkvmerge
After done joining in mkv merge, the final file gets delay in audio, so I have to manually adjust in Media player classic, using the keys + and -
I need a way to do this automatically
thank you very much and sorry my english
+ Reply to Thread
Results 1 to 8 of 8
How are you loading the audio? When you demux the audio, typically there will be value written in the name something like AD T80 2_0ch 192Kbps DELAY 72ms.ac3 . That is the 72ms delay value. When you load that audio stream directly into the audio section, the delay will be automatically entered
Transport streams are tricky. Sometimes there is no automatic way, and you have to do it manually (find the delay value in MPC, and enter the value in mkvtoolnix to shift the audio, remux the file)
Exactly what I do, I rename the mkv file (generated by MeGUI) and AC3 file (generated by vlc media player)for the same name and check the audio with the video for media player classic and then insert this value of delay in mkvmerge and remux.
I do not do the demux the raw file.Ts, just do two processes video in megui and audio in vlc player.
this way would get this value automatically delay, not needing to manually check in MPC using the + and -
mediainfo (view=> text) sometimes reports the delay value (but it might not be accurate) , you can try that on the ts . That's the delay value you would enter in megui when encoding
ID : 640 (0x280)
Menu ID : 1002 (0x3EA)
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : HE-AAC / LC
Muxing mode : LATM
Codec ID : 17
Duration : 42s 325ms
Bit rate mode : Variable
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz / 24.0 KHz
Compression mode : Lossy
Delay relative to video : -390ms
What kind of TS ? If it's mpeg2 compression (not AVC), when you index it with DGIndex (in megui I don' t know what it's called, file indexer or something) . The audio will have the delay value written in it as described above . Encoding the audio as described above will incoporate the delay value
What I need is to make this process of sync delay automatically
Another option - You can try DirectShowSource("file.ts") when using megui or any other encoder , directshow will automatically incorporate the delay value , but it has several potential drawbacks (frame accuracy, especially when using temporal filters, prone to whatever directshow filter chain you have configured) . For straight encode , no temporal filters, it should be ok
There could be a way to auto batch this? Well possibly. I usually do the same process as poisondeathray. I use VLC, adjust the delay to find the correct ms, whether it be positive or negative, then use that ms in mkvmerge GUI and adjust the delay in ms.
Now if you use the mkvmerge command line
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
according to bunkus.org "This would add 200ms of silence at the beginning of the audio track "
So maybe it is possible to auto batch this as long as the delay is the same for all video?