View Full Version : Merging two Type-2 AVI files with different audio sampling rates


sys49152
29th January 2003, 19:46
Quick Summary :

I would like to merge two Type-2 AVI files (from DV source) with different audio sampling rates (33khz and 48khz) to eventually feed into TMPGEnc (DV -> mpeg-2 conversion) in order to burn the final DVD.

Details :

I have a single DV tape with the audio set at 33Khz for half the time, and 48khz for the other half (I'm blaming it on my wife..). I grabbed it using Scenalzyer and it automatically split the AVI into two files (one containing the 33khz AVI, the other containing the 48khz file).

Are the next steps correct ? :

(audio stuff)
1. extract both audio tracks using VirtualDub
2. use ssrc to resample the 33khz extracted wav to a 48khz wav file
3. use GoldWave to merge the files (I can't seem to find any other relatively cheap program to do this. It takes *incredibly long* using Goldwave, but it does do the trick)

(video stuff)
1. extract both video files using VirtualDub (direct stream copy, no audio option)
2. merge the video files

(DV->Mpeg2)
Now I should be able to use TMPGEnc to load both the video and audio files created above, and create the final mpeg-2 file.

Do the steps above sound reasonable? Or is there a better way to do this?

Thanks!

bb
29th January 2003, 21:08
Originally posted by sys49152
[B](audio stuff)
1. extract both audio tracks using VirtualDub
2. use ssrc to resample the 33khz extracted wav to a 48khz wav file
3. use GoldWave to merge the files (I can't seem to find any other relatively cheap program to do this. It takes *incredibly long* using Goldwave, but it does do the trick)
1. ok
2. ok
3. Use VirtualDub to add the audio to each of the two video files, then create one big AVI via "File / Append AVI segment", both Video and Audio set to "Direct stream copy".

(video stuff)
1. extract both video files using VirtualDub (direct stream copy, no audio option)
2. merge the video files
see above

bb

sys49152
29th January 2003, 21:17
bb, thanks.

I did in fact try to remux the re-sampled audio track (38khz->48khz) back into the original avi file using VirtualDub as you suggested before posting my message, but when I tried to play it (Windows Media Player), it complained that there was a problem with the file (it played for a bit, then froze). I didn't have any problems playing the original file (avi with the 33khz audio). I thought that it might have something to do with remuxing a differently sampled audio file with the original video file (perhaps a problem with Type-2 AVI files?).

I'll try it again and use another player -- perhaps it was Windows Media player that didn't like the remuxed file.. but other players will have no difficulties playing it.

I'll post back the results.

sys49152
3rd February 2003, 03:49
It did work (!). Um.. interesting, since it gave me problems the last time I tried. The only difference -- I used VirtualDubMod instead of VirtualDub. All my other steps were the same. I'll chalk it up to something I probably did wrong the first time 'round.

Thanks for saving me the extra tedious steps of separting the second avi!

sh0dan
3rd February 2003, 17:29
If you are going to encode it afterwards, it'll probably be just as easy using avisynth.

vid1 = AviSource("file1.avi",pixel_type="rgb24").resampleaudio(48000)
vid2 = AviSource("file2.avi",pixel_type="rgb24").resampleaudio(48000)
return vid1 + vid2


The pixeltype is for TMPGEnc only - otherwise just delete the parameter. Resampleaudio doesn't do anything if the audio is already at the correct rate, so it doesn't hurt.

sys49152
22nd February 2003, 17:27
sh0dan,

Let me first say that I didn't respond to your last post simply because I've been so blown away by avisynth -- I can't stop playing with it! I hadn't tried it out before your suggestion, but now I try to do all my avi clip processing through it before feeding it to any other video application (including tmpgenc). Truely remarkable! Thanks for introducing me to this gem with your example above.

sys49152

sh0dan
24th February 2003, 11:27
Welcome to you!

If you have further questions to it, just ask away in the AviSynth forum!

C=64 forever :)