View Full Version : Trimming bad frames off an AVI
aklendathu
1st April 2004, 11:55
I have an AVI file which contains a few bad frames and causes AVISynth to crash while re-encoding to MPEG-2.
Say, frames 9900 to 10005. How can I use TRIM in AVISynth to remove these frames off the file on-the-fly while processing ?
I've tried breaking up the file into two pieces but then I get a slight A/V sync problem after the bad frames.
TIA.
jimmy basushi
1st April 2004, 12:58
a=trim(0,9900)
b=trim(10005,endofmovie)
a+b
is that what your after? it should remove the the video frames, im not sure about how the audio goes tho
aklendathu
1st April 2004, 14:36
Yes, that's something like that, thanks. I had previously experimented with trim but never got the results I wanted.
In your script:
a=trim(0,9900)
b=trim(10005,endofmovie)
a+b
will the second trim still apply to the original AVI file ?
and will 'a+b' just concatenate the two trimmed clips ?
stickboy
1st April 2004, 16:05
Originally posted by aklendathu
will the second trim still apply to the original AVI file ?Yes.
and will 'a+b' just concatenate the two trimmed clips ?Yes.
(If you're not sure, you could try it.)
aklendathu
1st April 2004, 16:43
Yes, when in doubt, give it a try :D
I only asked to be sure, because I'm not reading this from home.
Thanks again.
Soulhunter
1st April 2004, 22:05
You could also try this (http://forum.doom9.org/showthread.php?s=&threadid=66372) to replace bad frames... ;)
Bye
aklendathu
2nd April 2004, 18:37
That's a good idea but unfortunately I have about 220 bad frames (looks like the key frame is shot but the delta-frames are OK).
esby
3rd April 2004, 06:10
If the frames are such bad they crash avs,
using soulHunter proposal might not be a solution,
since avs might crash when evaluating these...
trimming out might be the only solution left
esby
aklendathu
3rd April 2004, 20:59
Well, I ended up having 5 different blocks of bad frames... but
the conversion is finally done.
Thanks all for your suggestions.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.