VideoHelp Forum




+ Reply to Thread
Results 1 to 2 of 2
  1. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    Afternoon all,
    just a quick question for those AVIsynth scripters out there.

    I have a number of HOWTO guides w/ AVIsynth. But, NOT A ONE has an
    actuall sample script showing how to applish this, yet these guides
    talking about scripts and VARIABLES, etc.

    I'm having trouble w/ VARIABLES.
    I'm trying to use the following few lines, so that I only have to set
    the initial filename string once, and AVIsynth will sequtially pick up
    the rest of the sequence numbers, ie, 0.01.avi, 0.02.avi, 0.03.avi
    Here is the troubled code snipplit:
    av="d:\00_0.01.avi"
    SegmentedAVISource(av)

    This is what I normally use, and every time I want to change all the avi's
    in my script, I have to manually input EVERY .avi file in both these lines:
    DirectShowSource("d:\00_1.01.avi")+DirectShowSourc e("d:\00_1.02.avi")
    WAVsource("d:\00_1.01.avi")+WAVsource("d:\00_1.02. avi")
    . . .

    I would much rather just a VARIABLE to hold both my avi and wav ie,
    myAVI="0.01.avi"
    myWAV="0.01.avi" # <-- case our wav is different type of wave...

    DirectShowSource(myAVI)
    WAVsource(myWAV)
    . . .

    Thank you all for your support.
    -vhelp
    Quote Quote  
  2. I continually use AviSynth v0.3, and I don't think it would give the desired result with either your before or after samples. You could have a later version than I do. Someone published a 1.0 version, but I don't use it because it crashes with my more complex scripts.

    Anyway, here's a lengthy list of suggestions based on the version I use. They should work on the later versions too, but you can reject anything that's not helpful. I'm numbering them just to aid discussion:

    1. AviSynth lets you store video streams in variables, so while myAVI="0.01.avi" probably won't work, you can store the avi itself using myAI=AviSource("0.01.avi").

    2. Your AVI file appears to be stored in segments, which can be tedious to paste together. Instead of loading each segment, try SegmentedAviSource("d:\00_1.avi"). To use SegmentedAviSource you must omit the numbered increments (".01", ".02", etc.) from the filename. It'll add those numbers as needed.

    3. Your WAVSource statement will discard the results of the DirectShowSource statement on the line above it. This is the biggest source of confusion when AviSynth: every line in an AviSynth script must be assigned to a variable, even though don't need to put a variable name on every line. If you don't assign the statement to a variable, AVISynth just assigns the statement to a variable called "last". Confused? No wonder you wanted examples!

    So here's what I think you wanted in the first place. I've added comments on the lines starting with #.

    # Load segments 00_1.00.avi, 00_1.01.avi, 00_1.02.avi, etc.
    myAVI=SegmentedAviSource("d:\00_1.avi")

    # Use the same file as the wav source
    myWAV=myAVI

    # If you'd want to use a different file for sound, add something like
    #myWAV=WAVSource("alternate.wav")

    # Combine the audio and video into a single variable (we have to do this somewhere)
    last=AudioDub( myAVI, myWAV )

    # If you want to add any other AVISynth functions, put them here.
    # For example, if you want to resize the picture, add:
    #last=BilinearResize(352,240,last)

    # Finally, return the result:
    return (last)


    Some of the steps aren't strictly necessary, but the script should work as-is, so long as the AVI filename is right. You sound like you have some programming experience, so I used a format that more closely resembles an orthodox computer program. Don't omit any variable assignments or the return statement until you get it working this way. Note that the WAVSource and BilinearResize lines are commented out, so remove the # sign if you want to use them.

    This might not be what you want, but I hope it's a good place to start. At least this provides a sample script that ought to work for starters, so then you can augment it.

    -tacosalad
    Quote Quote  



Similar Threads

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