Log in

View Full Version : Help please with removing frames of audio and video.


Mr_Frenillo
10th November 2005, 17:35
:helpful: Hi, I have a problem with a function of avisynth...

The problem is this: I need a remove the frames 10515 to 10529 so i used this function: Trim(0,10515)+Trim(10529,0) and its result all good but the audio is wrong because modify the video frames, then use the option 'false' in the third parameter of the function like saw in the description of the url.

Trim(100,0) # delete the first 100 frames, audio padded
# or trimmed to match the video length.
Trim(100,0,false) # delete the first 100 frames of audio and video,
# the resulting stream lengths remain independant.
Trim(100,-100) # is the same as trim(100,199)
Trim(100,199,false) # audio will be trimmed if longer but not
# padded if shorter to frame 199
Trim(0,-1) # returns only the first frame
Trim(0,100)+Trim(200,300) # returns frames 0 to 100 and 200 to 300 (i.e. removing 101 to 199)

But this cause error when i try to open the script with virtualdubmod.

Thanks in advance.

communist
10th November 2005, 18:08
But this cause error when i try to open the script with virtualdubmod.

What error is it reporting?

Mr_Frenillo
10th November 2005, 18:18
This error:

http://69.57.130.61/~animeraw/dibujo.jpg

gzarkadas
10th November 2005, 20:52
You apparently passed wrong arguments to Trim.

However to be able to help you, we must have the original script that caused the error (or a cut-down version that can reproduce it) instead of the Avisynth's documentation example.

AVIL
10th November 2005, 23:01
@Mr_Frenillo

You mus pass to trim a clip as parameter.

In your sentence:

Trim(0,10515)+Trim(10529,0)

the first trim can use the default clip (last) because is the first filter in the line but the second can't do it and throw this message to announce the lack of the clip.

Try instead:

last.Trim(0,10515)+last.Trim(10529,0)

or

c=last
c.Trim(0,10515)+c.Trim(10529,0)

I think they are equivalents.

Good luck

foxyshadis
11th November 2005, 04:10
Minor nitpicks:
If the clip has audio, you really should use ++ as well, otherwise it may not sync up correctly.

Correct me if I'm wrong, but you want to remove frames 10515-10529? The way you're doing it will also include those first and last frames in the range. (ie, trim gives [x,y], not (x,y).)

stickboy
11th November 2005, 04:34
The third argumenet to Trim was added in AviSynth 2.5.6.