Log in

View Full Version : Joining clips and sorting audio


1576
17th February 2004, 13:13
Forgive me if my request seems dim. I have spent a long time searching through posts, and havent seen one which answers my question.
I have a movie on 3 cds (MPEG1 format) and I want to create a script which joins the three files, keeping the audio in Synch, but the problem is that there are some frames which I want to cut out as they are pixellated (at the end of the files), plus there's a load of crap at the begining which I want to cut out.
I've even gone as far as converting each MPEG file to DivX, joining in VDub, then using a script for the DivX file. I realise that Im losing quality all the time, so would rather use the MPEG as the source.
I know I have to use the trim command to select frames, but will this keep my audio in synch? Ive never used Trim before. How should I incorporate the audio in the script? I would normally have extracted a wav, and resampled in Besweet, but if the frame count is edited, Im at a loss.

I'd be very grateful if someone could take the time to give me an example or two of a script line which would be relevant to my problem, as I appear to be going round in circles.
Im using Avisynth 2.54, CCE 2.67....23, Win XP SP1

sh0dan
17th February 2004, 16:42
DirectShowSource("file1.mpg")
trim(0,2500) # only select the first 2500 frames for example
#insert more filters for file 1 here
v1 = last

DirectShowSource("file2.mpg")
trim(0,2500) # only select the first 2500 frames for example
#insert more filters for file 2 here
v2 = last


DirectShowSource("file3.mpg")
trim(0,2500) # only select the first 2500 frames for example
#insert more filters for file 3 here
v3 = last


v1 ++ v2 ++ v3

1576
17th February 2004, 17:30
Thankyou for your input Shodan. The trim part makes sense. What I dont understand is the =last command.
What about the audio? Is it possible to integrate the audio which corresponds to the trimmed frames from the video? Ive tried editing the MPEGS themselves, but unfortunately whatever apps I've used had resulted in Synch issues. I'd rather do the lot in Avisynth, and Im sure it can be done.

Thanks for your patience.


EDIT: Just thought, maybe Directshowsource allows for the audio problem?? If so, can someone just confirm that for me? God I feel so dumb on this one!

Wilbert
17th February 2004, 17:59
See http://forum.doom9.org/showthread.php?s=&threadid=71023

directshow(...)
filter1(...)
...
filtery(...)
v = last

is shorthand for

clip = directshow(...)
clip2 = filter1(clip)
...

clipy = filtery(clip_(y-1))
v = clipy

Nothing to worry about, if you don't understand that yet ...

sh0dan
17th February 2004, 18:23
Regarding audio. It will be automatically imported by DSS, and kept through your filters and properly spliced in the end. You should consider demuxing the audio as suggested by Wilbert (in the linked thread). You can save it to WAV from vdub, and import it through WAVSource.

Search for futher information.

1576
17th February 2004, 19:36
Thanks guys, I'll give it a whirl right now. Thanks for taking the time.