View Full Version : Can this be done?
datascab
23rd January 2004, 22:07
Hello...
I've got a dvd that has mutliple mini movies on it.
Therefore I have to rip them into seperate vob files.
Then I get individual *.d2v files with there *.ac3 file.
The ac3 files all have differing delay values.
What I would like to do it to create a joined *.d2v and *.ac3 file so that I can then encode the grouped movie as a whole lump to ensure common bitrate (i'm using RV9).
I did try loading all the vob's required in order etc but the audio goes all to pot.
Any ideas welcome.
Thanks
Data
jggimi
23rd January 2004, 22:26
It can be done. But there are restrictions.
DVD2AVI can be used to concatenate different vob sets, with some restrictions (See Q11 in the DVD2AVI FAQ). Just click the "add" button. Unfortunately, I can't recommend it for this purpose, as it is likely that your audio will no longer be in sync when the second stream begins, due to the introduction of a new delay in audio.
What I recommend is to convert the soundtracks to PCM (.wav), in order to use AviSynth scripting to concatenate syncronized video and audio tracks. A script to concatenate two episodes might look something like this:
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
v1=mpeg2source("C:\dvd\part1.d2v")
v2=mpeg2source("C:\dvd\part2.d2v")
a1=wavsource("C:\dvd\part1_delay_50ms.wav")
a2=wavsource("C":\dvd\part2_delay_-120ms.wav")
sync-a1=delayaudio(a1,0.05)
sync-a2=delayaudio(a2,-0.12)
part1=audiodub(v1,sync-a1)
part2=audiodub(v2,sync-a2)
part1++part2I haven't done RV9 encoding, and don't know the requirements. If you manage your audio separately, just open the script in Vdub(mod) and Save Wav; then add a line with "Killaudio()" at the bottom of the script to keep the uncompressed audio out of the encoder.
manono
24th January 2004, 03:30
Hi-
Pretty clever, jggimi. I've saved your sample script, as I'm pretty sure I can use it sometime. I know, you probably grabbed bits and pieces of the script here and there, but it's nice to see it put together like that.
By the way, I think you can skip the conversion to WAV, and just use the original AC3, by loading the AC3Source Plugin (http://www.avisynth.org/warpenterprises/files/ac3source_25_dll_20030126.zip). Then I think you can save out the AC3 and (maybe) run it through AC3Fix (http://www.dvdrhelp.com/tools?section=10#10). I've not used it before, but the Plugin should work. If I'm wrong about that, maybe some AviSynth/Audio expert can set me straight. And maybe datascab will try out your script and report back.
jggimi
24th January 2004, 03:51
I haven't tried the ac3 plugin, but I did attempt using directshowsource, and gave it up. The audio came through choppy. In my case, I was working for a stereo downmix to ogg vorbis, so I didn't need to retain ac3.
datascab
25th January 2004, 23:51
Hello again.
Well after a bit of playing around I think I found a way to do it.
After getting several *.d2v & *.ac3 files, I created dummy *.avi's using vfapiconv.
Then mux'd each ac3 with its avi then appended each avi.
Then i was able to demux the full ac3 file ready for encoding in AutoRV9.
I got the dummy avi into AutoRV9 using Avisynth.
Any comments?
Data
Oh Bugger... It did work apart from a small problem i found with vdubmod. I did end up getting around it though and it works a treat :)
See this URL for details: -
http://forum.doom9.org/showthread.php?s=&threadid=69557
Data
jggimi
26th January 2004, 03:48
That's why my script used "++" -- it is shorthand for AlignedSplice() (http://www.avisynth.org/index.php?page=Splice) . It eliminates your Vdub problem.
datascab
26th January 2004, 11:22
Hi,
Thanks for that info.
Does the ++ command require wav file input or will it work with ac3 files?
Can I ammend the script to join the 12 dummy avi's and the 12 ac3/wav files and produce a single avi?
Something else I noticed last night is that some wav/ace files were longer than the video component. Would the ++ option ignore this and make the audio the same length as the video part?
To do this manually I added the stream in vdubmod and then saved the avi, this then cut the end to the right length.
Thanks for your help on this one.
Data
I wrote this script: -
v1=avisource("f:\temp\dvd2avi\d2v\01_d2v_vfapi.avi")
v2=avisource("f:\temp\dvd2avi\d2v\02_d2v_vfapi.avi")
v3=avisource("f:\temp\dvd2avi\d2v\03_d2v_vfapi.avi")
v4=avisource("f:\temp\dvd2avi\d2v\04_d2v_vfapi.avi")
v5=avisource("f:\temp\dvd2avi\d2v\05_d2v_vfapi.avi")
v6=avisource("f:\temp\dvd2avi\d2v\06_d2v_vfapi.avi")
v7=avisource("f:\temp\dvd2avi\d2v\07_d2v_vfapi.avi")
v8=avisource("f:\temp\dvd2avi\d2v\08_d2v_vfapi.avi")
v9=avisource("f:\temp\dvd2avi\d2v\09_d2v_vfapi.avi")
v10=avisource("f:\temp\dvd2avi\d2v\10_d2v_vfapi.avi")
v11=avisource("f:\temp\dvd2avi\d2v\11_d2v_vfapi.avi")
v12=avisource("f:\temp\dvd2avi\d2v\12_d2v_vfapi.avi")
a1=wavsource("f:\temp\dvd2avi\ac3\01 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a2=wavsource("f:\temp\dvd2avi\ac3\02 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a3=wavsource("f:\temp\dvd2avi\ac3\03 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a4=wavsource("f:\temp\dvd2avi\ac3\04 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a5=wavsource("f:\temp\dvd2avi\ac3\05 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a6=wavsource("f:\temp\dvd2avi\ac3\06 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a7=wavsource("f:\temp\dvd2avi\ac3\07 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a8=wavsource("f:\temp\dvd2avi\ac3\08 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a9=wavsource("f:\temp\dvd2avi\ac3\09 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a10=wavsource("f:\temp\dvd2avi\ac3\10 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a11=wavsource("f:\temp\dvd2avi\ac3\11 AC3 T01 2_0ch 224Kbps DELAY 0ms.wav")
a12=wavsource("f:\temp\dvd2avi\ac3\12 AC3 T01 2_0ch 224Kbps DELAY 96ms.wav")
p1=audiodub(v1,a1)
p2=audiodub(v2,a2)
p3=audiodub(v3,a3)
p4=audiodub(v4,a4)
p5=audiodub(v5,a5)
p6=audiodub(v6,a6)
p7=audiodub(v7,a7)
p8=audiodub(v8,a8)
p9=audiodub(v9,a9)
p10=audiodub(v10,a10)
p11=audiodub(v11,a11)
p12=audiodub(v12,a12)
p1++p2++p3++p4++p5++p6++p7++p8++p9++p10++p11+p12
When I saved the wav i got a file of the exact right size.
Excellent, now i dont need to examine each wav and append silence in bewsweet :)
Thanks
Data
jggimi
26th January 2004, 18:23
I'm very glad that the technique worked for you!
Regarding your question on AC3:
I note that you converted to .wav sound, as I have done.
As mentioned previously in the thread, there is an AC3 Plugin that Manono described but that I have not tried. While AviSynth 2.5x has limited support of other sound codecs, that capability is brand new, dependant on operating system services, and didn't work for me.
datascab
30th January 2004, 18:35
Hello again.
Well i got some good news and bad news.
The bad news is that the method of using d2v files etc proved rather troublesome since i kept getting innaccurate stream lengths etc.
So i'll tell you how i ended up doing it and its 100% accurate and is easy to do as well. :)
I had 12 clips, using smartripper I demux each stream to get *.m2v's and *.ac3.
I used besweet to get *.wav.
The i opened each *.m2v in vdubmod, added the *.wav, set full video processing and rgb compression then frameserved this to a vdub file.
I end up with 12 frame serving sessions.
Then I write a script in avisynth which combines them all as an avisource with alignedsplice.
Frame length is the sum of all individual *.m2v's and all *.wav's get trimmed or extended in the vdubmod frameserving process.
Absolutely brilliant!
Just thought it might be of some interest, sorry dvd2avi dint play a part in the final solution.
Thanks for scripting help though, couldnt of done it all without you :)
Data
anadistributors
2nd February 2004, 01:22
Thank you! I have been looking for this exact information!
anadistributors
5th February 2004, 07:08
Hi, I am trying to use your technique and could use a little help.
Originally posted by datascab
Hello again.
Well i got some good news and bad news.
The bad news is that the method of using d2v files etc proved rather troublesome since i kept getting innaccurate stream lengths etc.
So i'll tell you how i ended up doing it and its 100% accurate and is easy to do as well. :)
I had 12 clips, using smartripper I demux each stream to get *.m2v's and *.ac3.
I used besweet to get *.wav.
The i opened each *.m2v in vdubmod, added the *.wav, set full video processing and rgb compression
I get everything up to this point done.
then frameserved this to a vdub file.
I end up with 12 frame serving sessions.
Then I write a script in avisynth which combines them all as an avisource with alignedsplice.
Frame length is the sum of all individual *.m2v's and all *.wav's get trimmed or extended in the vdubmod frameserving process.
Absolutely brilliant!
Just thought it might be of some interest, sorry dvd2avi dint play a part in the final solution.
Thanks for scripting help though, couldnt of done it all without you :)
Data
Can you tell me exactly how to do this please?
datascab
5th February 2004, 12:48
Hi,
When you frameserve from virtualdub(mod) you get a vdr file.
I had 12 clips so this gave me 12 *.vdr's (01-12).
The you need to write a script using notepad like......
clip01=avisource("f:\dvd\01.vdr")
.
.
.
.
.
clip12=avisource("f:\dvd\12.vdr")
then you need to join them up...
clip01++clip02.............++clip12
This will give you the combined clips and you can check it in vdub.
But hold the press.... i've found a way of doing this now that means I dont have to use vdub for frameserving at all. This means your encoding program gets all the cpu resources instead of sharing with vdub.
All you need is 1 script and it also negates the need for doing any deinterlacing.
All I have now is 1 avisynth script, it works perfectly and is very simple.
Please let me know if this method interests you.
Data
anadistributors
5th February 2004, 15:42
I am very interested in your new method. Please share it with us.
datascab
5th February 2004, 18:11
Basically here's the script: -
v01=directshowsource("F:\DVD\data\01.m2v")
a01=wavsource("F:\DVD\data\01.wav")
c01=audiodub(v01,a01)
v02=directshowsource("F:\DVD\data\02.m2v")
a02=wavsource("F:\DVD\data\02.wav")
c02=audiodub(v02,a02)
c01++c02
crop(8,0,708,480)
limiter()
killaudio()
This only shows for 2 clips but you get the idea.
To get the best out of the directshow input I recommend the following mpeg2 decoder (and its free!)........
http://prdownloads.sourceforge.net/gplmpgdec/MpegDecoder012.msi?download
I would advise that you make sure this is the only directshow based mpeg2 decoder installed.... that way you can be sure this decoder will be doing the delivering.
This decoder nicely deinterlaces my source, it has an auto option.
You may notice i have the 'kill audio' part. I do this since i dont want my encoder package to get the audio since I encode it in nero.
So to get the joined wave output, simply REM that line out as follows: -
#killaudio()
Then open you *.avs in vdubmod and save wav.
There you go.
I hope that helps.
Its much better since your encoding package can hog the CPU for itself and the way the directshow filter handles the video stream made deinterlacing easy. You get a end result just like playing the *.m2v on its own.
Data
datascab
5th February 2004, 23:06
Hi mate.
I sent you a PM with some better contact options for me.
Look forward to hearing from you.
Data
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.