PDA

View Full Version : Triming non-sequential frames from multiple AVIs


groundradar
12th January 2006, 04:11
Forgive us if this is a simple question coming from newbies, but we have searched the forum and have not found a solution.

We have a directory containing a number of compressed AVI files (video only) at 50 fps (720 X 480). There are less than 30 of these input files, but each one may be up to 30 GB. We also have a text list of video file names, frame numbers and subtitles, eg.:

AVI_filename | framenumber | “Text to be placed in subtitle1”|”Text2 to be placed in subtitle”
AVI_filename | framenumber | “Text to be placed in subtitle1”|”Text2 to be placed in subtitle”
AVI_filename | framenumber | “Text to be placed in subtitle1”|”Text2 to be placed in subtitle”.

We need to figure out a way to extract each frame from the list, overlay a new subtitle for each frame, and finally output the frames as, say, a 10 fps uncompressed AVI at the same resolution. The frames we need to extract are not necessarily sequential in the source AVI files, and there may be up to 100,000 frames to extract and re-combine.

Can this be done, even in segments, using Avisynth? Is this completely impossible?

Any help would be greatly appreciated.

Jan

trolltuning
13th January 2006, 19:33
Would ConditionalReader() do the job for you?

groundradar
15th January 2006, 17:38
ConditionalReader() won't work, as it does not allow strings as variables.

As a simple example, we can output a ebmp file with our required subtitle as such:

ImageWriter(SubTitle ("c:\testvideo.avi", "Text_1",algin=2),"c:\",start=50,end=50)

How then do we create another ebmp in the same script? Being absolute newbies, it appears that AVISynth only interprets the last command? We would like to be able to do something like (except 50,000 lines long):

ImageWriter(SubTitle ("c:\testvideo.avi", "Text_1",algin=2),"c:\",start=50,end=50)
ImageWriter(SubTitle ("c:\testvideo.avi", "Text_2",algin=2),"c:\",start=55,end=55)
ImageWriter(SubTitle ("c:\testvideo.avi", "Text_3",algin=2),"c:\",start=59,end=59)

We can then re-combine the eBMP files back into a new AVI. How does one run through multiple commands like this?

Thanks!