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. |
|
|
Thread Tools | Search this Thread | Display Modes |
21st August 2012, 20:17 | #1 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,493
|
Can I/how to use env->Invoke to apply subtitles within filter?
I've written a filter and would like to apply a subtitle from within it - either conditionally per frame or to the whole clip at construction time (as well as doing the filter's usual stuff). I don't really understand env->Invoke(...), but is this something it can be used for?
I've tried adding Code:
env->Invoke("invert",""); David |
21st August 2012, 21:28 | #2 | Link |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
See http://avisynth.org/mediawiki/Filter_SDK/Env_Invoke and http://avisynth.org/mediawiki/Cplusplus_API#Invoke for using Invoke.
You can also use ApplyMessage and include "text-overlay.h" (you should license your code GPL in that case though). In v2.60a3 you can also use env->ApplyMessage: http://avisynth.org/mediawiki/Cplusplus_API#ApplyMessage.2C_v5 |
22nd August 2012, 00:29 | #4 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
The 2nd argument is expected to be an AVSValue of type array, which is a list of the arguments to the function you are invoking.
Typically you might do something like this :- Code:
... AVSValue args[1] = {child}; AVSValue child2 = env->Invoke("invert", AVSValue(args, 1)); ... PVideoFrame src2 = child2->GetFrame(n, env); ... Code:
... char *text = "Foo has struck!"; ... AVSValue args[4] = {child, text, "Courier", 48}; char* argnames[4] = { 0, 0, "font", "size" }; AVSValue child2 = env->Invoke("Subtitle", AVSValue(args, 4), argnames); ... |
Thread Tools | Search this Thread |
Display Modes | |
|
|