Home
RecentChanges

Search:

» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Download
»Learn to script
»FAQ
»Manual
»Discussion fora
»Project page
»External filters
»FeedBack

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth

 

Avisynth 
Logo

ChangeFrameSize

The following example code shows how to double the width of the destination frame

public:
	ShowPixelValues(PClip _child, IScriptEnvironment* env) :
	GenericVideoFilter(_child)
	{
	// constructor code	
 
        vi.width = vi.width*2; // width is doubled here
        vi.height = vi.height * 2;  // height is also multiplied by 2
	}
    PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env);
};

PVideoFrame __stdcall ShowPixelValues::GetFrame(int n, IScriptEnvironment* env) {

		PVideoFrame src = child->GetFrame(n, env);
		PVideoFrame dst = env->NewVideoFrame(vi); // new frame is double the size of src
...

A Similar approach has to be used for changing colorspace, framerate etc. There is a bit more information at WorkingWithImages.

SourceForge Logo

 


Edit this document | View document history
Document last modified Wed, 18 Feb 2004 03:25:05