Log in

View Full Version : VD_Subtitler ?


storebror
17th July 2004, 19:58
Hi. getting a syntax-error when trying to load this script, and can't figure it out
-----------------------------------------------------------
function VD_Subtitler(clip clip, string filename)
{
LoadVirtualdubPlugin("D:\VirtualDub\plugins\subtitler.vdf","_VD_Subtitler")
return clip._VD_Subtitler(1, The_Jackal.avi )
}
VD_Subtitler("D:\Movies\The Jackal\The_Jackal.ssa")

-------------------------------------------------------------
All help will be appreciated:)

Thx

edit Wilbert: changed title

scharfis_brain
17th July 2004, 21:29
you should have posted the line, AVISynth is claiming the error! (posting the char by char error msg is needed!)

but at least I can see two missing quotation marks and a variable called like a defined keyword (clip)

function VD_Subtitler(clip i, string filename)
{
LoadVirtualdubPlugin("D:\VirtualDub\plugins\subtitler.vdf","_VD_Subtitler")
return i._VD_Subtitler(1, "The_Jackal.avi" )
}

VD_Subtitler("D:\Movies\The Jackal\The_Jackal.ssa")

stickboy
17th July 2004, 21:55
Originally posted by scharfis_brain
but at least I can see two missing quotation marks and a variable called like a defined keyword (clip)Surprisingly, I think that's allowed.
function DoNothing(clip clip) { return clip }Of course, such constructs probably are best avoided, if only for style.
function VD_Subtitler(clip i, string filename)
{
LoadVirtualdubPlugin("D:\VirtualDub\plugins\subtitler.vdf","_VD_Subtitler")
return i._VD_Subtitler(1, "The_Jackal.avi" )
}

VD_Subtitler("D:\Movies\The Jackal\The_Jackal.ssa")You know, this function doesn't even make any sense. filename isn't even used anywhere, and the filename that's supposed to be passed to _VD_Subtitler is supposed to be of the subtitle file, not of the AVI file. The original version of VD_Subtitler from the VirtualDub import script looks like:function VD_Subtitler(clip clip, string filename)
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\subtitler.vdf", "_VD_Subtitler")
return clip._VD_Subtitler(1, filename)
}storebror, why did you modify VD_Subtitler at all?

storebror
17th July 2004, 22:55
He;) Because, 1. I'm a newbie. 2. I'm curious. 3. I'm on my way going nuts because of all those procedures that seem to be sooo- complicated, but what da heck. Thanks to you guys, people like me are catching up with some new real useful knowledge :D

Thx.

storebror
18th July 2004, 00:30
OK, I'm trying to figure this out. Not a programmer but quite familiar to code, not a mastermind though. However, can't seem to get this in place. Anyone out there with an AviSynth-Tutorial-subtitle example?Feel like i'm riddling along with "the coloured cube" on this one, lol.

Wilbert
18th July 2004, 00:34
function VD_Subtitler(clip clip, string filename)
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\subtitler.vdf", "_VD_Subtitler")
return clip._VD_Subtitler(1, filename)
}

video = AviSource(...)
video2 = ConvertToRGB24(video)
VD_Subtitler(video2, "D:\Movies\The Jackal\The_Jackal.ssa")

or shorter

AviSource(...)
ConvertToRGB24()
VD_Subtitler("D:\Movies\The Jackal\The_Jackal.ssa")

storebror
18th July 2004, 02:59
Ok, this looks great, but..(would i dare to ask?) for a line-to-line explanation, eg. are those lines relative or absolute in their arguments? Meaning, do i have to replace any strings with searchpaths or similar?..

manono
18th July 2004, 07:30
I don't get it. Why are you making this more complicated than necessary? Just as a learning exercise?

Install VobSub along with the TextSub Plugin for VDub and AviSynth (which I guess you've done already). Load the VSFilter, and add the TextSub line to your script:

LoadPlugin("D:\Path\To\VSFilter.dll")
.
.
.
TextSub("D:\Movies\The Jackal\The_Jackal.ssa")

But that's too easy, so I must be missing something. :)

storebror
18th July 2004, 11:13
As usual when one try to figure things out that you don't know about,
people use to make it more complicated than it is, don't we:) ?. So since i'm kind of a n00b i'm falling into that trap, lol.
And thanks alot for your info. Is it really that simple?

Wilbert
18th July 2004, 13:42
In the lines where you load something (clips, subs, audio, whatever) the lines can be used as absolute or relative. In the latter case you have to set the working dir. Example:

SetWorkingDir("c:\temp\")
AviSource("clip.avi")
TextSub("The_Jackal.ssa")

For more syntax related stuff, look up syntax.htm in your documentation.

Leak
18th July 2004, 14:02
Originally posted by Wilbert
In the lines where you load something (clips, subs, audio, whatever) the lines can be used as absolute or relative. In the latter case you have to set the working dir.

Not neccessarily - only in the case that the application that opens the AVS file doesn't change the working directory to the one the AVS file resides in, and at least VirtualDubMod and Media Player Classic do that.

np: Kings Of Convenience - I Don't Know What I Can Save You From (Quiet Is The New Loud)

storebror
18th July 2004, 14:46
Thx Guys. I'll probably be back with some more Q:s:D