Using Avisynth to add black border to JPG files ques

G

Guest

Guest
Archived from groups: rec.video.desktop (More info?)

Trying to see if I can Use Avisynth to simply add some black borders to
pad out a series of jpg files. I'm just trying to update all the JPG
files
w/o having to edit each on individually.

I started with this (all JPG's are 704x480 - trying to make them
720x480 - I know that 704x480 is also a standard NTSC DVD res):

ImageSource("d:\TEMP\name%d.jpg")
AddBorders(0,8,0,
ImageWriter(start=0, type="jpg")

This loaded all of the jpg's into VdubMod.
But what do you do to activate it?

I looked at 'file->Save Image Sequence' but that menu only gives you
a choice of png/tga/bmp.

When I used the scroll bar to go thru all the input JPG images, it gave
an error message that said 'Image Reader Can not open DevIl library
reading file xxxxx" for numbered pictures that extended past what I had
for input (i.e I had 25 files, that message started with
filename26.jpg). I just want to save the files to a different directory
(or to the same directory with a different name - i.e no overwriting of
the original file)

2nd ques - If I wanted to make an AVI sequence out of them, how would I
modify the script and how to 'run' it? Say I wanted each picture to
last 5 secs @29.97 fps, then I'd need around 150 frames of each
picture. I see there are frame parameters in ImageWriter but I'm not
sure what to do.

thanks
 
G

Guest

Guest
Archived from groups: rec.video.desktop (More info?)

csaagpDIESPAMDIE@yahoo.com wrote:

> Trying to see if I can Use Avisynth to simply add some black borders
> to pad out a series of jpg files. I'm just trying to update all the
> JPG files w/o having to edit each on individually.

And then save them back into the same directory JPEG format? If this is
all what you want to do, you are using a wrong tool for the job. Try
ImageMagick instead: <http://www.imagemagick.org/>.

After you have installed it, you have a bunch of powerful command-line
tools at your disposal. You would probably want to use either "convert"
or "mogrify" for adding the borders:
<http://www.imagemagick.org/www/ImageMagick.html#desc>

> 2nd ques - If I wanted to make an AVI sequence out of them, how would
> I modify the [Avisynth] script and how to 'run' it?

You "run" an Avisynth script by simply opening it as if it was a video
file (for example, you could open an Avisynth script in Windows Media
Player and view the processed video that way, if you wanted to.) If you
want to save the processed data in a _new_ AVI file, just open the
Avisynth script in something like VirtualDub and save.

> Say I wanted each picture to last 5 secs @29.97 fps, then I'd
> need around 150 frames of each picture. I see there are frame
> parameters in ImageWriter but I'm not sure what to do.

As explained above, you do not need to use ImageWriter() at all. Try
something like this instead:

--- 8< ---

# 1 frame per 5 seconds = 0.2 fps
ImageSource("d:\TEMP\name%d.jpg", start=0, end=???, fps=0.2)

# 30000/1001 = 29.97002997002997002997002...
ChangeFPS(30000, 1001)

--- 8< ---

Be sure to add in the correct total number of frames (in the "end=???"
parameter, replacing the question marks.) You might also want to use
something like "%03d" instead of mere "%d" in the filename string if you
want to have null-prefixed numbers ("%03d" gives "000", "001", 002"
etc., mere "%d" results in "0", "1", "2" ...)

--
znark