View Full Version : Big Q : How to resize a frame (C++)
morsa
19th February 2004, 06:27
That's my problem and the same thing applyes to many more people.
I have a hard time trying to discover how to manipulate the creation a newvideoframe.
May be I'm really stupid, but, would it be so difficult to ask a couple of the great developers we have here to write a short and simple small guide to explain in short words how to use the basic procedures included in avisynth?
I know Avisynth.h is well documented, but it isn't enough,sorry.
Richard Berg
19th February 2004, 07:14
http://forum.doom9.org/showthread.php?s=&threadid=63966
http://www.avisynth.org/index.php?page=filtersdk
morsa
19th February 2004, 07:41
Are you trying to tell me "stop asking" or something like that???:confused:
I have managed to (I guess) modify the NewVideoFrame dimensions, but I'm getting this error message from Vdubmod:
Avisynth read error:Filter Error: Filter attempted to create Videoframe with invalid pixel_type.
Richard Berg
19th February 2004, 07:47
I thought maybe you'd missed the thread where we described how to resize a frame (its title is not very obvious). Following the second link you should see the "SimpleSample" pages, which step through the filter writing process in clear language just as you requested.
morsa
19th February 2004, 07:52
But I'm the one who asked for it and the one to ask Simon to add it to Avisynth.org.
Now I´m asking for more!!!! .:D
Cause the method describe by Simon didn't work with Simplsample as is.
Many others have the same problem as me, so I've been looking inside the code of many filter that perform resizing operations (external or internal) and none of them are using the method described.:confused:
OK, by now I'm really convinced that I'm in fact a sucker.
Please Richard, if you can , delete this whole thread.
Thank you.
Richard Berg
19th February 2004, 08:13
Sorry, I didn't notice that you were the same person who asked before.
Here is a sample piece of a core filter:
VerticalReduceBy2::VerticalReduceBy2(PClip _child, IScriptEnvironment* env)
: GenericVideoFilter(_child)
{
original_height = vi.height;
vi.height >>= 1;
if (vi.height<3) {
env->ThrowError("VerticalReduceBy2: Image too small to be reduced by 2.");
}
}
Changing vi.height/width in the constructor is all it takes. Really! :)
(assuming you're inheriting from GenericVideoFilter)
Edit: didn't see your edit above. Can you post your code?
morsa
19th February 2004, 08:44
Here it is:
NoName::NoName(PClip _child, IScriptEnvironment* env) :
GenericVideoFilter(_child)
{
PClip child;
VideoInfo vi;
vi.width = vi.width * 2;
vi.height = vi.height * 2;
}
BTW, I'm still writing it and I don't know at this moment, what could happen.
morsa
19th February 2004, 09:29
Well, after two days working with it, this thing seems to be working now!!:D .
I still wonder about the use of SubFrame.....
Wilbert
19th February 2004, 10:32
Well, after two days working with it, this thing seems to be working now!! .
Nice! What did you do wrong?
morsa
19th February 2004, 11:05
Don't know :rolleyes: ...
But it's okay, although I'm still trying to write to all the pixels of the destination image.....well let's see if I can get confortable with the filter interface.....wish me luck!
sh0dan
19th February 2004, 12:33
Originally posted by morsa
PClip child;
VideoInfo vi;
These shouldn't be defined in your class, as they are both inherited from GenericVideoFilter, where they are initialized before your constructor gets called.
morsa
19th February 2004, 14:24
THX.
sh0dan
19th February 2004, 20:20
Any time!
It's always good to have someone new here! :cool:
... and it's always easier when you post the source.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.