Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th July 2004, 16:55   #1  |  Link
DaisyF
Registered User
 
Join Date: Jun 2004
Posts: 10
generate avs-script for similar sourcefiles in directory

Hi,

I backup old tv-episodes (from .rm) and use an avs-script to feed each file to the encoder.

Thing is : I have a directory with 356 episodes, they all need the same kind of script.

This is an example for 16 may 2003 :
--begin----------
filename is 20030516.avs

DirectShowSource("c:\RealMedia\20030516.rm",25)
BilinearResize(352,288)
--end------------

For each realmediafile I need to change the .rm-filename in the above example and save it under its own .avs-filename

Is there a way to automate this for an entire directory ? I have been searching for a week but no luck.

Anyone ?

Daisy
__________________
Daisy D Fetherweight

I compressed my programming to code.avi and now it looks real good.
DaisyF is offline   Reply With Quote
Old 6th July 2004, 17:51   #2  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
From the command prompt, you can do something like:
Code:
for %x in (*.rm) do (
echo.DirectShowSource^("%x",25^)
echo.BilinearResize^(352,288^)
) > "%~nx.avs"
If your scripts need to be any more advanced than that, then you should put that stuff into a common .avs file:
Code:
function DoIt(string filename)
{
    DirectShowSource(filename, 25)
    BilinearResize(352, 288)
    # ... other AviSynth processing commands...
    return last
}
and then in the auto-generated .avs files:
Code:
for %x in (*.rm) do (
echo.Import^("common.avs"^)
echo.DoIt^("%x"^)
) > "%~nx.avs"

Last edited by stickboy; 6th July 2004 at 18:00.
stickboy is offline   Reply With Quote
Old 6th July 2004, 19:59   #3  |  Link
DaisyF
Registered User
 
Join Date: Jun 2004
Posts: 10
I'm trying this out now and hope I can make it work. Then I will look into the syntaxis some more because this is real interesting stuff.

Thanks and I will post feedback

D
__________________
Daisy D Fetherweight

I compressed my programming to code.avi and now it looks real good.
DaisyF is offline   Reply With Quote
Old 6th July 2004, 22:44   #4  |  Link
DaisyF
Registered User
 
Join Date: Jun 2004
Posts: 10
When you say :

-----------
From the command prompt, you can do something like:

code:
for %x in (*.rm) do (
echo.DirectShowSource^("%x",25^)
echo.BilinearResize^(352,288^)
) > "%~nx.avs"
---------------

What kind of prompt do you mean ? Since reading your reply I have looked into .vcf, sylia and also java script, since I assume that is the environment where you use that type of code. I nowhere find the syntax for

%x = string being filename; I don't find what % means in this expression
*.rm = whatever.rm
%~nx.avs = building all the filenames

In my day to day life I don't do that much programming (not counting turbo pascal for math).

Could you point me to a faq that could cover this ? Or suggest an environment for the command line. I will try to figure this out for myself but the curve right now is too steep.

Daisy
__________________
Daisy D Fetherweight

I compressed my programming to code.avi and now it looks real good.
DaisyF is offline   Reply With Quote
Old 6th July 2004, 22:47   #5  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally posted by DaisyF
What kind of prompt do you mean?
The newfangled DOS prompt-replacement that ships with Windows 2000/XP, aka CMD.EXE.

Just select "Run..." in your start menu, enter "cmd" and hit enter. There also should be a "Command Prompt" shortcut somewhere around the "Accessories" folder in your programs folder in the start menu.

np: Wagon Christ - The Funnies (Sorry I Make You Lush)
Leak is offline   Reply With Quote
Old 7th July 2004, 09:23   #6  |  Link
DaisyF
Registered User
 
Join Date: Jun 2004
Posts: 10
That prompt, ah, I use it all the time.

Really I do... I feel manure-like for not having tried that.

OK, so I just did it.

F*********k, (pardon my french) that is some powerfull instruction. It's making my day as we speak. I'm looking at a whole directory full of .avs

Thanks,

D
__________________
Daisy D Fetherweight

I compressed my programming to code.avi and now it looks real good.

Last edited by sh0dan; 8th July 2004 at 09:58.
DaisyF is offline   Reply With Quote
Old 8th July 2004, 10:02   #7  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Just beeeped out a little. No profanities here!

Anyway - I have made a webpage that allows you to generate a zip-file containing all the scripts you need. I wrote a bit about it here [avisynth.org].

It's quite simple - you insert the script in one box, and the filenames in the second, press "Generate" and download the Zip-file containing your avs files.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 8th July 2004, 11:51   #8  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,547
that's very cool sh0dan...
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 8th July 2004, 15:23   #9  |  Link
niamh
Dismembered
 
niamh's Avatar
 
Join Date: Nov 2003
Location: Craggy Island
Posts: 873
What about avisynthesizer?
Basically you create one template, and then all you have to do is right click the file and send to asynther, and the script is created

first link I found on google
niamh is offline   Reply With Quote
Old 8th July 2004, 16:44   #10  |  Link
DaisyF
Registered User
 
Join Date: Jun 2004
Posts: 10
Thanks for the help. I haven't tried avisynth yet but I will...

At the moment I wrote two template avs-scripts which I then apply on a directory with doIt.

In the time of Dos (386-486) I was into Amiga so I lost out on that. I need to catch up

D
__________________
Daisy D Fetherweight

I compressed my programming to code.avi and now it looks real good.
DaisyF is offline   Reply With Quote
Old 28th May 2006, 17:04   #11  |  Link
Eric B
Registered User
 
Join Date: May 2002
Location: France/Germany
Posts: 119
I ve first tried the script described above (for %x in (*.rm ...) in a batch file, but my cmd does not like it.
So I went to http://www.avisynth.org/BatchScripting
And then, it works.
Thanks sh0dan.

Last edited by Eric B; 28th May 2006 at 17:11.
Eric B is offline   Reply With Quote
Old 28th May 2006, 19:44   #12  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
Quote:
Originally Posted by Eric B
I ve first tried the script described above (for %x in (*.rm ...) in a batch file, but my cmd does not like it.
And exactly what happened? What OS are you using? Simply saying that it doesn't work is not helpful.

If you tried it in a .bat/.cmd file, you need to replace %x with %%x .
stickboy is offline   Reply With Quote
Old 1st June 2006, 18:55   #13  |  Link
Eric B
Registered User
 
Join Date: May 2002
Location: France/Germany
Posts: 119
Oh, you answered. Great!
As I find the batch solution even easier, I ve tried again. First, with %%, it is already much better. But what I ve done is still not correct:
my makeAvs.bat (WinXP) is
Code:
for %%x in (*.mov) do (
echo.Import^("makeAvs_template.avs"^)
echo.DoIt^("%%x"^)
) > "%%~nx.avs"
and may makeAvs_template.avs:
Code:
function DoIt(string filename)
{
	LoadPlugin("UnDot.dll")
	LoadPlugin("FluxSmooth.dll")
	DirectShowSource(filename , fps=30)
	ConvertToYV12()
	Undot()
	FluxSmoothST(7,7)
	return last
}
The avs file are generated, but they contains for example:
Code:
Import("makeAvs_template.avs")
DoIt("P1030015.MOV")
, which I find logical regarding the echo cmd. I probably did not correctly understood. Can the cmd shell really work with function ?
Eric B is offline   Reply With Quote
Old 2nd June 2006, 07:34   #14  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
Quote:
Originally Posted by Eric B
The avs file are generated, but they contains for example:
Code:
Import("makeAvs_template.avs")
DoIt("P1030015.MOV")
, which I find logical regarding the echo cmd. I probably did not correctly understood.
I'm not following what you mean; the generated .avs file looks correct to me. What's wrong with it?
Quote:
Can the cmd shell really work with function ?
The cmd shell is perfectly capable of generating all those .avs files, but you'll need to open them and process them with something else (like using VirtualDub's batch mode).
stickboy is offline   Reply With Quote
Old 19th July 2010, 21:35   #15  |  Link
diffid
Registered User
 
Join Date: Nov 2008
Posts: 22
Does anyone know how to create .avs files from a directory listing using a template on Linux with or without wine. I've tried wine's cmd.exe with directions in #2 of this thread, but it doesn't like the syntax. I've tried searching for a batch script GUI but the only one that looks suitable needs gawd awful ActiveX to work and fails dismally on Linux.
diffid is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:31.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.