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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th August 2003, 23:27   #1  |  Link
yonatan
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
yonatan is offline   Reply With Quote
Old 6th August 2003, 11:24   #2  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
002.bmp - 015.bmp 14 images 2 black frames, 14 frames
It adds black frames from zero till the numbering of your bmp's starts. So in this case it starts with two black frames (as 000 and 001).

Easiest is to renumber them beginning at zero (using Total Commander for example).
Wilbert is offline   Reply With Quote
Old 6th August 2003, 11:29   #3  |  Link
yonatan
Registered User
 
Join Date: Dec 2001
Posts: 12
I can see what you say - but I thought that I give it the range
of numbers to look for as the 2nd and 3rd parameter?
If it always starts counting at zero -what does the 2nd parameter do ?


yonatan is offline   Reply With Quote
Old 6th August 2003, 12:16   #4  |  Link
yonatan
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]
yonatan is offline   Reply With Quote
Old 6th August 2003, 17:53   #5  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Quote:
Originally posted by Wilbert
Easiest is to renumber them beginning at zero (using Total Commander for example).
That's silly. Just trim off the extra frames.

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
}
(see my thread about Trim for my Trim3 function)

Last edited by stickboy; 6th August 2003 at 20:23.
stickboy is offline   Reply With Quote
Old 6th August 2003, 22:20   #6  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
That's silly. Just trim off the extra frames.
Yes, entirely correct
Wilbert is offline   Reply With Quote
Old 10th August 2003, 07:00   #7  |  Link
yonatan
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(
yonatan is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.