VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Member
    Join Date
    Aug 2002
    Location
    United States
    Search Comp PM
    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,8)
    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
    Quote Quote  
  2. I have an example of a script that I have used in the past:-


    photo=ImageSource(file="c:\avisynth scripts\photo scripts\mycar1.jpg",end=125,fps=25).Lanczos4Resize (720,576)
    photoflip=flipvertical(photo)
    return photoflip

    This creates a 5 second clip of one jpeg photo (PAL). The flipvertical was required by me as the image was upside down. Just load this into VirtualDub ,apply any compression you want and save as...

    Hope this helps
    Quote Quote  
  3. Member
    Join Date
    Aug 2002
    Location
    United States
    Search Comp PM
    I'm trying to do this for a series of files, not just one.
    So I could change the ImageSource to what I posted initially and use 'end=150, fps=29.97' instead of what you have.

    Could the resize call go on a line by itself, without the '.' ? (What does '.' do anyway?)
    Would this work:

    photo=ImageSource("d:\TEMP\name%d.jpg",end=150,fps =29.97)
    Lanczos4Resize(704, 480)
    AddBorders(0,8,0,8 )
    return photo

    Then I choose 'Save as avi'?
    thanks

    To anyone else, still interested in knowing if I can also do his by updating the jpg files w/o generating an avi file.
    Quote Quote  
  4. The "." just denotes a continuation without having to specify a "clip". In theory ,because I've designated a label of 'photo' for the first line I would have to make the Lanczos4Resize look like 'Lanczos4Resize(photo,720,576)' instead of just Lanczos4Resize(720,576) if I use the "." syntax. Just a matter of individual preference is all. In your case you don't need to use the label 'photo' so your script would look like this:-

    ImageSource("d:\TEMP\name%d.jpg",end=150,fps=29.97 )
    Lanczos4Resize(704, 480)
    AddBorders(0,8,0,8 )

    just play around and see what works for you
    Quote Quote  
  5. Member
    Join Date
    Aug 2002
    Location
    United States
    Search Comp PM
    I was able to use the following to update a series of JPG files:

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

    the 0,10 represents name (0).jpg thru name (10).jpg
    This created files 000000.jpg thru 000010.jpg after I chose 'preview output from start' in Vdub.

    The files all had to be the same size or ImageSource wouldn't read in past the 1st one. So I cropped my photos to a 4:3 ratio and used Irfanview to batch resample all of them to 704x480. The above script padded them out to 720x480

    Wasn't able to generate an AVI output properly using:
    ImageSource("d:\TEMP\name (%d).jpg", 0,10, end=330, fps=29.97)
    AddBorders(8,0,8,0)

    This just sequenced from pic 0 thru pic 10 30 times rather than 30 pic 0's, then 30 pic 1's etc.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!