Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
5th August 2003, 23:27 | #1 | Link |
Registered User
Join Date: Dec 2001
Posts: 12
|
black frames in animation sequence
I am trying to use avisynth (v2.52) with virtualdub 1.5.4
to assemble a bunch of bmp files into an animation sequence - I am using multiple calls to ImageReader but am getting black frames in between the clips - what am i doing wrong ? Here is the script fps = 30 a = ImageReader("f:\video\%03d.bmp", 2, 15, fps, false) b = ImageReader("f:\video\015_%1d.bmp", 1, 3, fps, false) c = ImageReader("f:\video\016_%1d.bmp", 1, 6, fps, false) d = ImageReader("f:\video\03d.bmp", 17, 30,fps, false) e = ImageReader("f:\video\031_%1d.bmp", 1, 6, fps, false) f = ImageReader("f:\video\03d.bmp", 32, 39,fps, false) fnl = a+b+c+d+e+f the bmp files are organized as follows - note the number of input images and output frames INPUT OUTPUT 002.bmp - 015.bmp 14 images 2 black frames, 14 frames 015_1.bmp - 015_3.bmp 3 " 1 " 3 " 016_1.bmp - 016_6.bmp 6 " 1 " 6 " 017.bmp - 030.bmp 14 " 18 " 14 " 031_1.bmp - 031_6.bmp 6 " 1 " 6 032.bmp - 039.bmp 8 " 32 " 8 frame total 55 black frames + 51 frames I wanted = 104 frames any other tips for doing animation would also be great thanks Yonatan |
6th August 2003, 11:24 | #2 | Link | |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
Easiest is to renumber them beginning at zero (using Total Commander for example). |
|
6th August 2003, 12:16 | #4 | Link |
Registered User
Join Date: Dec 2001
Posts: 12
|
answeriny my self - it looks like start,end when youre writing an
image refers to which frame in the clip to write - and the software numbers them from zero onwards. Read was written the same way - the start,end refer to which frames in the final clip to read rather than how to index the number that refer to the file. I would regard this as a design bug....symetry between read and write is nice - but only when the situation is really symetrical. I cant image why anyone would want to use a non zero number for 'start' in the read when refering which frame in the clip to read - but it makes a lot of sense when refering to which image file to read. Am i going to have to renumber all of my file or is there a way to achieve what i wanted simply ? writing writing [I] |
6th August 2003, 17:53 | #5 | Link | |
AviSynth Enthusiast
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
|
Quote:
This is what I use. Code:
# ImageSource # # A wrapper function to ImageReader. # # PARAMETERS: # filenameTemplate - the template string used to generate filenames from # frame numbers # start, end - the start and end frame numbers (inclusive) # fps - the desired framerate # (default: 29.97) # function ImageSource(string filenameTemplate, int start, int end, float "fps") { assert(start >= 0 && start <= end, "ImageSource: invalid start frame") assert(end >= 0, "ImageSource: invalid end frame") fps = default(fps, 29.97) ImageReader(filenameTemplate, start, end, 1, true) Trim3(start, length=(end - start + 1)) AssumeFPS(fps) FlipVertical() # this may not need to be here return last } Last edited by stickboy; 6th August 2003 at 20:23. |
|
10th August 2003, 07:00 | #7 | Link |
Registered User
Join Date: Dec 2001
Posts: 12
|
thanks for the help
I just renumbered the files (didn't see the trim reply till it was too late) My solution would be to write a set of wrappers that maek the interface what it should have been (in my opinion) write (clip, path, start_file_no, end_file_no, string format, start_frame_no, end_frame_no) read(path, start_file_no, end_file_no, int fps, bool use_DevIL This would - make read and write compatible - allow any start and end numbers - allow a trim function in write read( |
|
|