PDA

View Full Version : Joining 2 Ac3 with odd video and audio lengths


AMED
14th July 2008, 10:04
Hi All,

I'm having a problem with encoding LOTR-FOTR SE (2 discs).

What I'm trying to do is make a x264 anamorphic rip of the movie (with AC3 audio) with both parts of the movie joined.

It seems that the audio of the first part of the movie is a little longer that the video, so when i join the movie (using DVDremake) before encoding it and feed it into Automkv the audio is out of sync when it hits part2.

I have found a way (doom9 search) of getting the audio to sync when the 2 parts of the movie is joined when transcoding the audio. I really want to be able to join the the 2 parts with the original AC3's, without transcoding it, but just padding or trimming it to fix the sync.

I used this script when i transcoded
LoadPlugin("F:\AutoMKV096b7\exe\filter\NicAudio.dll")
LoadPlugin("F:\AutoMKV096b7\exe\filter\SoundOut.dll")
LoadPlugin("F:\AutoMKV096b7\exe\BeSweet\BassAudio.dll")
LoadPlugin("F:\AutoMKV096b7\exe\filter\FFmpegSource.dll")
LoadPlugin("F:\AutoMKV096b7\exe\filter\dgdecode.dll")

d1=Mpeg2Source("F:\LOTR_SEE_D1F\VTS_01_1.d2v").AudioDub(NicAC3Source("F:\LOTR_SEE_D1F\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3"))
d2=Mpeg2Source("F:\LOTR_SEE_D2F\VTS_01_1.d2v").AudioDub(NicAC3Source("F:\LOTR_SEE_D2F\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3"))
d1++d2

#NicAC3Source("F:\MOVIES\temp\movie t80 3_2ch 448kbps delay 0ms.ac3")
#DelayAudio(0.0000)
#Applying STEREO downmixing routines
function stereo(clip a)
{
flr = GetChannel(a, 1, 2)
fcc = GetChannel(a, 3)
lfe = GetChannel(a, 4)
lfc = MixAudio(fcc, lfe, 0.2071, 0.2071)
mix = MergeChannels(lfc, lfc)
lrc = MixAudio(flr, mix, 0.2929, 1.0)
blr = GetChannel(a, 5, 6)
Return MixAudio(lrc, blr, 1.0, 0.2929)
}
#
6==Audiochannels() ? stereo() : last
function addvideo(clip c) {
blankclip(length = Int(100 * AudioLengthF(c) / float(audiorate(c))), fps=100)
Return audiodub(last,c)
}
#Normalize()

Soundout()

Is it possible to do with Avisynth ?

madshi
14th July 2008, 10:39
It seems that the audio of the first part of the movie is a little longer that the video, so when i join the movie (using DVDremake) before encoding it and feed it into Automkv the audio is out of sync when it hits part2.
Still, do it this way. After you've done this find out how much the audio is out of sync in the 2nd part. Let's say it's 500ms too late. Now drag the first audio file into delaycut and remove the last 500ms of the audio information. You can do this without transcoding. Delaycut will just shorten the file. After having done this you can just repeat the whole process. This time audio sync should be perfect.

AMED
14th July 2008, 10:50
is there an easy way to find out the value i need or will it just be trial and error?

-EDIT:

Hmm, I just used the Info function on the first part of LOTR


Video is 01:41:18:360
Audio is 01:41:17:824

so i should be adding 536ms of padding to the end?

madshi
14th July 2008, 11:04
is there an easy way to find out the value i need or will it just be trial and error?

Hmm, I just used the Info function on the first part of LOTR

Video is 01:41:18:360
Audio is 01:41:17:824

so i should be trimming 536ms of audio off ?
Maybe yes, maybe no. Personally, when needing to find out which audio delay is the right one, I'm opening the movie in MPC HC and then you can with the [+] and [-] keys in the num blocks adjust the audio delay in real time during movie playback. This works best for me to find the correct delay. You'll need to find a scene where there's lots of talking with faces zoomed in. Or maybe a door being shut loudly...

tebasuna51
14th July 2008, 13:18
is there an easy way to find out the value i need or will it just be trial and error?

-EDIT:

Hmm, I just used the Info function on the first part of LOTR


Video is 01:41:18:360
Audio is 01:41:17:824

so i should be adding 536ms of padding to the end?

But you say in previous post:

It seems that the audio of the first part of the movie is a little longer that the video

Maybe DGIndex has applied a initial delay over the audio: "F:\LOTR_SEE ... DELAY 0ms.ac3"
and now is longer, you must calculate the audio duration over the extracted ac3. Use DelayCut, see 'Duration' in 'TARGET FILE INFO', and 'Delay' at 'End' ms (- to cut) to match video duration).

After you can add the second part without reencoding:
copy /b part1_fixed.ac3 + part2.ac3 whole.ac3