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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
Registered User
Join Date: Jan 2003
Location: Czech Republic
Posts: 7
|
How to store data in Avisynth plugin?? Varying of fps?
Hi,
I´m just finishing new version of very simple "smart" Logo - off plugin. ( Only because the Logo masters don´t have enough enthusiasm to convert their great RGB filters to YUY2 ot UV12). The plugins is working ( for me good), but I´m not satisfied with the architecture of it. The question is - how to store buffer with data, which are proccesed only once when loading the plugin, and when proccessing every frame it is only reading from this buffer. And how to free ( delete) memory for this buffer after encoding is done? The storing data in some file and repeatedly reading of it for every frame seems to me slightly unhappy solution. // Logo.cpp : Defines the entry point for the DLL application. #include ..... unsigned char* smart = new unsigned char[255*255]; class Logo : public GenericVideoFilter { public: Logo(PClip _child, int _fix, int _fiy, int _f_width, int _f_height, int _c, const char * _fileName, IScriptEnvironment* env) : GenericVideoFilter(_child), fix(_fix), fiy(_fiy), f_width(_f_width), f_height(_f_height), c(_c), fileName(_fileName) { here is smart proccessing } PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env); }; PVideoFrame __stdcall Logo::GetFrame(int n, IScriptEnvironment* env) { Here is only reading from smart } AVSValue ... extern "C" ... The second question - when using Avisynth with some plugin, there is varying of fps when encoding ( in my case between 2-8fps.) Is it normal?? Zdenek W. |
|
|
|
|
|
#2 | Link | ||
|
Retired AviSynth Dev ;)
![]() Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
|
Quote:
Adding: Code:
Logo::~Logo(void)
{
if (smart) delete[] smart;
}
Is there a specific reason why you have a fixed size on your data - will it always be contained within 255*255 bytes? Quote:
Use xvid with "null transform mode" - this will disable encoding, and therefore give a more stable image of the framerate.
__________________
Regards, sh0dan // VoxPod |
||
|
|
|
![]() |
|
|