View Full Version : Filter programming (ApplyMessage()) question
dattrax
9th January 2003, 14:15
Hi,
I am part way through writing my new filter and have a few questions
1) On Avisynth1.06 I wrote a plugin to do simple PSNR and print it on the screen. I had to copy the code internally from Avisynth to get access to ApplyMessage(). In my new filter I want to do a similar thing. Do I still have to make a local copy of ApplyMessage() or can I print status text on the screen some other way?
2) I have some history buffers which really need resetting on non linear accesses to the AVS file. Is there a mechanism to detect this?
Cheers
Jim
WarpEnterprises
9th January 2003, 14:36
1) maybe env->Invoke with subtitle works.
2) can't you simply remember in your class the last framenumber and compare to the actual one?
Kurosu
9th January 2003, 16:30
1) Have a look at decomb filter, info.h
mpeg2dec3 also has something to write number (quants) as if it was a digital clock
2) As said by WarpEnterprise, make a int Lastframe as a member of your filter class. Init it to a value suiting your need in the GenericVideoFilter function. Then:
GetFrame(int n, ...)
{
//do stuff using value Lastframe
...
//end of that stuff
Lastframe = n;
//do whatever processing
}
btw, MakeWritable() copies data, so if you don't need it, don't use it. A filter written in C increased its speed from 12fps to 16fps by removing 2 Makewritable() out of 3...
dattrax
9th January 2003, 19:55
Thanks for that,
I ust be stupid for missing the GetFrame(n, ..... ah well.
Thanks for your pointers on the text. In the end I just copied the definition of Antialias from the avisynth source which give nice truetype antialiased fonts.
Would it be an idea to export the Class Antialiaser in avisynth.h. Then people would be just able to use it?
Cheers
Jim
Kurosu
9th January 2003, 22:47
Depending on the amount of text to output, I prefer using OutputDebugString() (defined in windows.h) and DebugView (www.sysinternal.com). It's much faster than priting antialiased fonts on the video imho, although it must for debug purpose.
scmccarthy
9th January 2003, 23:50
1) What about env->Sprintf()? What is that for?
Stephen
Bidoche
10th January 2003, 15:29
for outputting the result of printf in a string (char *), I think.
Better use STL string, it's safer.
WarpEnterprises
24th February 2003, 10:02
Would it be possible to make
void ApplyMessage( PVideoFrame* frame, const VideoInfo& vi, const char* message, int size,
int textcolor, int halocolor, int bgcolor, IScriptEnvironment* env )
from text-overlay.cpp possible to call from a plugin?
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.