Log in

View Full Version : A REAL challenge for the cracks!


MCSmarties
25th September 2005, 22:21
Hello everybody, this is my first post. I have been reading Doom9's guides and forums for ages though...
I don't consider myself a n00b anymore but I'm certainly no expert.

I want to do something that most of you will consider really crazy. Can anybody help me?

Warning: long post ahead!
In a nutshell: How do I synchronize the soundtrack of movie A with movie B?

I own a rare french movie (with a french soundtrack) and want to add an english soundtrack.
That movie has been issued a long time ago as a VHS with english soundtrack, but is now unavailable.
A DVD has never been released.

From a P2P program I managed to find a copy of this movie with an english soundtrack
(finding and downloading it - from a single source - took approximately SIX MONTHS!!)
The picture quality is unfortunately absolutely awful (*sigh*) but the soundtrack is good.

I want to synchronize this english soundtrack with my own movie. Now here come the problems:

- Frame rate: my movie is 25.00 fps (PAL), the downloaded movie is 23.976 (NTFS)
- Sample rate: my soundtrack is 44100 Hz, the downloaded soundtrack is 48000 Hz
- Movie length: my movie is 1h 51min 23s, the downloaded movie is 1h 51min 8s (only the credits are missing, the movie is intact)
- Container: my movie is AVI (Xvid), downloaded movie is MPG (I believe MPEG2 (SVCD) - how do I find out?)

So far I did the following:
- made a digital file of my french VHS tape via capture card on my PC (XVid + MP3 128 CBR)
- demuxed MP3 soundtrack from my movie (VirtualDubMod)
- extract MPA soundtrack from downloaded movie (DGIndex)
- converted MPA to WAV with Winamp
- opened soundtrack from downloaded movie in Cool Edit Pro, resampled to 44100 Hz and saved as MP3.

I guess my problem is a mixture of audio delay and different frame rate.

I have been trying to synchronize the two soundtracks by opening them in Cool Edit Pro (multitrack view) but I can't "stretch" the audio directly,
only enter a stretching factor - the operation takes forever and I would have to repeat it x times, guesstimating a better factor each time!!

I tried to mux the english soundtrack with my movie (VirtualDubMod, adjust frame rate to match audio/video length) and then determine
the stretch factor with YAAI (Yet Another Avi Info) but it doesn't seem to work, I can't fine-tune the synchronization:
Small changes don't affect the movie at all, only "huge" frame rate changes (in the order of shifting the soundtrack by more than 30s)
result in a difference.

What can I do? Is there a program to stretch a soundtrack "graphically" (comparing the waveform and stretching until they overlap)?

Can a "real expert" help me out? If you pull this one off, you can proudly name yourself GAVES (Guru of the Audio/Video Encoding Scene! LOL)
Doom9 if you read this - it might be an interesting challenge for the Master himself ;)

:thanks:

PS: Moderators - I'm sorry if this is the wrong forum, I had a hard time finding the appropriate one!

kakomu
25th September 2005, 22:56
well, this is how I would go about this problem, personally.

First of all, you'll want to use another container besides AVI. Just makes things easier, and don't have to worry about frame rate.

However, I would take the French track and downsample to 44.1 khz (not only makes compressability easier, but will match the sample rate of the English track).

Next, there are plenty of audio editing programs out there. Something like soundforge would be good for this case, but I'm sure others out there are free and do the exact same work.

I would time stretch the audio by itself! Do not time stretch the audio AND the video. Look at both movies and find reference frames at the beginning and end (that is, find an exact same frame on both versions of the movie, such as a scene change, or beginning of credits, or something that you can be absolutely sure that both frames are exactly the same). I would do this in VirtualDub or Vdub mod, so that you can be very precise down to the thousandth of a second and frame.

Be sure to cut the audio on the english track so that it begins exactly where the french track begins. If the English audio track starts after the french audio track starts, then you will want to add some dead air so that the English track begins in sync with the french track.

From there, you will want to time stretch the English track(either expand or contract the audio) so that it is the same length as the french track.

I'm sorry that I'm not more specific, but I'm not at my own computer and cannot look at specific programs to suggest exact procedures.

iradic
26th September 2005, 00:54
never used it but besweet has it...

this manual lists all the available switches under the -ota( ) section of BeSweet v1.5.
for more info, read the BeSweet FAQ - http://forum.doom9.org/showthread.php?s=&threadid=15738 !

r - a frame rate convertor

example : "-r 23976 25000" will convert a 23.976fps stream (NTSC) to a 25.000fps stream (PAL)

tebasuna51
26th September 2005, 03:14
Please forget the video framerate and audio samplerate, you don't need modify this.
You need only modify the audio duration and delay.

Audio/Video (from different sources) synchronization:

1) You need identify 2 events (shots, closed door, ...), at beginning and at the end of the movie, and annotate the time. You can use Virtualdub for video and CoolEdit (Audition, SoundForge, Goldwave, Audacity,..) for audio.
You can use, for audio times, the french movie in VirtualDubMod like Kakumo say.

tv1 = Time in Video for Event 1
ta1 = Time in Audio for Event 1
tv2 = Time in Video for Event 2
ta2 = Time in Audio for Event 2

2) Then you know the necessary stretch:

K = (tv2 - tv1) / (ta2 - ta1)

In audio editor use Change/Ratio(%) = 100 x K

Goldwave: Menu Effect -> Time warp -> Change(%)
Method: Rate (Tempo & Pitch changed), Similarity (Pitch unchanged)

Audition: Menu Effects -> Time/Pitch -> Stretch -> Ratio(%)
Method: Resample (Tempo & Pitch changed), Time Stretch (Pitch unchanged)

Audacity: Menu Effect -> Change Speed (Tempo & Pitch changed) -> Percent Change(%)
Menu Effect -> Change Tempo (Pitch unchanged) -> Percent Change(%)

Now you have the elapsed time between Event 1 an 2, equal in video and audio
tv2 - tv1 = K x (ta2 - ta1)

3) Now to calculate the necessary delay:

Delay = tv1 - K x ta1

In audio editor add initial silence if Delay > 0, or cut the initial audio if Delay < 0.

4) Save the audio in mp3 CBR and mux with the video with VirtualDubMod or AviMux

Guest
26th September 2005, 03:59
From a P2P program I managed to find a copy of this movie with an english soundtrack! Are you aware of forum rule 6, which enjoins you from discussing illegally obtained copyrighted materials?

Matthew
26th September 2005, 11:49
I don't think this is so much a challenge, more of a pain in the arse :)

As an aside, I can't believe the effort people will go to for a hacking up a single movie. And dub tracks are awful too ;-)

MCSmarties
26th September 2005, 12:36
Wow that was fast!
A big "thank you" to all you people for pitching in with help and comments!
Now I have to try all that out :-)

tebasuna51:
Thank you for detailing a procedure step by step like that!
I'm going to try your method first - if it works indeed, it should have its porper place as an audio guide!

neuron2:
Yes I am very much aware aware of that rule, but I think that I am a borderline case.
[I removed a long rant here]

Matthew: I don't think this is so much a challenge, more of a pain in the arse
You got that right, man!!

Guest
26th September 2005, 12:46
If you want to look at the law by the letter then yes, I have indeed obtained the english soundtrack in a way that some call "illegal"
(I think we all agree this is not the time or place for a discussion on P2P legal issues). Then it's a rule 6 violation. Stop it. Thank you.

MCSmarties
26th September 2005, 12:53
Got it and I apologize. I understand your position.
Won't happen again. I deleted the "rant" I had posted above.

tebasuna51
26th September 2005, 16:23
One error in my post:
"You can use, for audio times, the french movie in VirtualDubMod like Kakumo say."

Must be "english movie" (the desired audio and in mpg format to need VDMod)

KpeX
26th September 2005, 22:56
Thread closed, R6.