Automatic script generation
- Cannonaire
- Joined: Wed May 05, 2010 5:59 pm
- Status: OVERLOAD
- Location: Oregon
Automatic script generation
I was wondering if there is a way to automatically generate AviSynth scripts for a batch of files, and if so if you can specify some lines to be added to all of them. Sorry if this has been asked before, but I did try a few searches and I couldn't find anything.

- mirkosp
- The Absolute Mudman
- Joined: Mon Apr 24, 2006 6:24 am
- Status: (」・ワ・)」(⊃・ワ・)⊃
- Location: Gallarate (VA), Italy
- Contact:
Re: Automatic script generation
http://www.animemusicvideos.org/forum/v ... 45&t=88059
That thread holds a few solutions, I think Phantasmagoriat's might be the best one for what you're looking for. Or perhaps something else, I dunno. But yeah, it's kinda hard to find... maybe I should sticky it...
That thread holds a few solutions, I think Phantasmagoriat's might be the best one for what you're looking for. Or perhaps something else, I dunno. But yeah, it's kinda hard to find... maybe I should sticky it...
- Cannonaire
- Joined: Wed May 05, 2010 5:59 pm
- Status: OVERLOAD
- Location: Oregon
Re: Automatic script generation
Thank you.

-
- Joined: Tue Dec 25, 2007 8:26 am
- Status: better than you
- Contact:
Re: Automatic script generation
There are some online perl scripts for doing this and other things, you'd probably need to ask someone in Darkhold for links though. I know there is one for insertsign() that could be easily modified to load sources. You could probably even make a small batch file for it. I just use shell one liners to do this kind of thing, echo and directed output is good enough.
- Phantasmagoriat
- Joined: Mon Feb 06, 2006 11:26 pm
- Status: ☁SteamPunked≈☂
- Contact:
Re: Automatic script generation
oh yeah, I remember writing that
although when I think about it now, it might be easier to just learn a few DOS commands.
[assuming you are running windows] you can simply tell your computer:
"for all of the files of the type specified, print *blah* to an avisynth script with the same name"
and it's easy to see which part you need to copy/modify if you want to make changes.
-Just paste this into a .txt file, and change it to .bat
-Then run it in the same folder that contains your files
I should note that a single ' > ' overwrites any old scripts whereas ' >> ' adds a new line

although when I think about it now, it might be easier to just learn a few DOS commands.
[assuming you are running windows] you can simply tell your computer:
"for all of the files of the type specified, print *blah* to an avisynth script with the same name"
Code: Select all
SET TYPE=avi
mkdir SCRIPTS
for %%f in (*.%TYPE%) do echo avisource("..\%%f") > "SCRIPTS\%%f.avs"
for %%f in (*.%TYPE%) do echo trim(2158,31888) >> "SCRIPTS\%%f.avs"
for %%f in (*.%TYPE%) do echo killaudio() >> "SCRIPTS\%%f.avs"
for %%f in (*.%TYPE%) do echo changefps(29.97) >> "SCRIPTS\%%f.avs"
for %%f in (*.%TYPE%) do echo converttoyv12() >> "SCRIPTS\%%f.avs"
for %%f in (*.%TYPE%) do echo crop(8,0,-8,0) >> "SCRIPTS\%%f.avs"
for %%f in (*.%TYPE%) do echo spline36resize(848,480) >> "SCRIPTS\%%f.avs"
for %%f in (*.%TYPE%) do echo gradfun2db() >> "SCRIPTS\%%f.avs"
for %%f in (*.%TYPE%) do echo limitedsharpen(strength=50) >> "SCRIPTS\%%f.avs"
-Just paste this into a .txt file, and change it to .bat
-Then run it in the same folder that contains your files
I should note that a single ' > ' overwrites any old scripts whereas ' >> ' adds a new line
PLAY FREEDOOM!! | Phan Picks! | THE424SHOW | YouTube | "Painkiller" | Vanilla MIDI's
"Effort to Understand; Effort to be Understood; to See through Different Eyes."
"Effort to Understand; Effort to be Understood; to See through Different Eyes."
- Cannonaire
- Joined: Wed May 05, 2010 5:59 pm
- Status: OVERLOAD
- Location: Oregon
Re: Automatic script generation
That's enormously useful, Phantasmagoriat. It's pathetic how little I know about DOS commands for how long I've been using windows computers. Thanks for your help, everyone.
