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 Development
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th June 2004, 06:35   #1  |  Link
Cyberia
Moderator
 
Cyberia's Avatar
 
Join Date: Nov 2002
Location: Inside
Posts: 718
Request for Version()

Would it be possible to modify the Version() command so that if a video is loaded already, it simply prints the version string on screen?

If no video is loaded, function as it does now.

Alternatively, the version could be displayed in the Info() display.

Also, could Version() be fixed so it does not generate an error in WMP9?
Cyberia is offline   Reply With Quote
Old 20th June 2004, 07:46   #2  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
If you really want, you can use Subtitle(VersionString()).

Also, although it would be possible to modify Version to accept the following:
Code:
AVISource("foo.avi")
Version(last)
the following would not produce your desired result:
Code:
AVISource("foo.avi")
Version()
There is no implicit last for functions whose first parameter is an optional clip. (If this weren't the case, it would be nearly impossible to opt out of feeding a clip to such functions.)

Last edited by stickboy; 20th June 2004 at 08:03.
stickboy is offline   Reply With Quote
Old 20th June 2004, 15:19   #3  |  Link
Bidoche
Avisynth 3.0 Developer
 
Join Date: Jan 2002
Location: France
Posts: 639
if Subtitle(VersionString()) works, then it should be made as such.

There is no point in modifying filters when a trivial line of code performs as well.


Quote:
There is no implicit last for functions whose first parameter is an optional clip. (If this weren't the case, it would be nearly impossible to opt out of feeding a clip to such functions.)
Are you sure of that ?
I doubt the parser is smart enought to make the distinction.
Bidoche is offline   Reply With Quote
Old 20th June 2004, 19:28   #4  |  Link
Cyberia
Moderator
 
Cyberia's Avatar
 
Join Date: Nov 2002
Location: Inside
Posts: 718
Quote:
Originally posted by stickboy
If you really want, you can use Subtitle(VersionString()).
Subtitle(VersionString()) gives me this error:
Code:
Script error: Invalid arguments to function "subtitle"
Cyberia is offline   Reply With Quote
Old 20th June 2004, 19:54   #5  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Quote:
Originally posted by Bidoche
Are you sure of that ?
I doubt the parser is smart enought to make the distinction.
Yes. Try it and see.
Code:
function Foo(clip "c")
{
    return Default(c, MessageString("bye"))
}

MessageString("hi")
Foo()
The result is the "bye" clip. However, you get the "hi" clip if you explicitly call Foo(last).

You also can see this behavior with BlankClip, which I think is the only internal function that takes an optional clip as its first argument.
Quote:
Originally posted by Cyberia:
Code:
Script error: Invalid arguments to function "subtitle"
Did you assign something to last?

Last edited by stickboy; 20th June 2004 at 20:09.
stickboy is offline   Reply With Quote
Old 20th June 2004, 20:19   #6  |  Link
Cyberia
Moderator
 
Cyberia's Avatar
 
Join Date: Nov 2002
Location: Inside
Posts: 718
No. How do I do that?
Cyberia is offline   Reply With Quote
Old 20th June 2004, 20:50   #7  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Either implicitly:
Code:
AVISource("foo.avi") 
# since the resulting clip was not assigned to a variable, 
# AviSynth automatically assigned it to the variable <last>

Subtitle(VersionString())
or explicitly:
Code:
c = AVISource("foo.avi")
# since the resulting clip *was* assigned to a variable,
# <last> is unassigned at this point

last = c
Subtitle(VersionString())
In the latter case, though, you could use c directly:
Code:
c = AVISource("foo.avi")
c.Subtitle(VersionString())  # alternatively: Subtitle(c, VersionString())
The way that AviSynth "knows" that a clip is loaded is through this implicit last mechanism. See the "Implicit 'last'" section from BenRG's original AviSynth tutorial.

Last edited by stickboy; 20th June 2004 at 20:57.
stickboy is offline   Reply With Quote
Old 20th June 2004, 21:23   #8  |  Link
Cyberia
Moderator
 
Cyberia's Avatar
 
Join Date: Nov 2002
Location: Inside
Posts: 718
Ok thank you, I was assigning the clip to a variable, and using the explicit method works. Thanks.
Cyberia is offline   Reply With Quote
Reply


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 05:16.


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