Automatic script generation

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
User avatar
Cannonaire
Joined: Wed May 05, 2010 5:59 pm
Status: OVERLOAD
Location: Oregon
Org Profile

Automatic script generation

Post by Cannonaire » Fri May 28, 2010 7:25 pm

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.
Image Think millionaire, but with cannons. || Resident Maaya Sakamoto fan.

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Automatic script generation

Post by mirkosp » Fri May 28, 2010 7:46 pm

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...
Image

User avatar
Cannonaire
Joined: Wed May 05, 2010 5:59 pm
Status: OVERLOAD
Location: Oregon
Org Profile

Re: Automatic script generation

Post by Cannonaire » Fri May 28, 2010 8:40 pm

Thank you.
Image Think millionaire, but with cannons. || Resident Maaya Sakamoto fan.

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: Automatic script generation

Post by Mister Hatt » Fri May 28, 2010 9:04 pm

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.

User avatar
Phantasmagoriat
Joined: Mon Feb 06, 2006 11:26 pm
Status: ☁SteamPunked≈☂
Contact:
Org Profile

Re: Automatic script generation

Post by Phantasmagoriat » Fri May 28, 2010 9:08 pm

oh yeah, I remember writing that :awesome:
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"
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
Image
Org Profile | AMVGuide | Phan Picks! | THE424SHOW | YouTube | "Painkiller"

"Effort to Understand; Effort to be Understood; to See through Different Eyes."

User avatar
Cannonaire
Joined: Wed May 05, 2010 5:59 pm
Status: OVERLOAD
Location: Oregon
Org Profile

Re: Automatic script generation

Post by Cannonaire » Fri May 28, 2010 9:35 pm

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.
Image Think millionaire, but with cannons. || Resident Maaya Sakamoto fan.

Locked

Return to “AviSynth Help”