MovieSaver Manual

About

The MovieSaver class is used to save image data to a movie file. Supported movie containers are either AVI (FILTER_AVI) or QuickTime (FILTER_MOVIE).

Warning
For MAXON API media input and output see Media Sessions Manual.

Allocation/Deallocation

A MovieSaver can be created with the usual tools:

Functionality

A MovieSaver object simply opens a movie file and writes multiple frames into that file:

// This example saves multiple bitmaps into a movie file.
if (movieSaver == nullptr)
return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION);
// open the movie file
const IMAGERESULT res = movieSaver->Open(saveMovieFile,
typicalFrame, 25, FILTER_AVI, nullptr, SAVEBIT::NONE);
return maxon::IoError(MAXON_SOURCE_LOCATION, MaxonConvert(saveMovieFile, MAXONCONVERTMODE::NONE), "Could not create movie file."_s);
// store each frame
for (Int32 frame = 0; frame < frameCnt; ++frame)
{
// get bitmap content
// this is a just a custom function
GetBitmapOfFrame(bitmap, frame) iferr_return;
// store bitmap data
if (movieSaver->Write(bitmap) != IMAGERESULT::OK)
return maxon::UnknownError(MAXON_SOURCE_LOCATION);
}
movieSaver->Close();
maxon::Url MaxonConvert(const Filename &fn, MAXONCONVERTMODE convertMode)
@ NONE
No check if file exists under case-sensitive drives.
Definition: ge_autoptr.h:37
Py_UCS4 * res
Definition: unicodeobject.h:1113
maxon::Int32 Int32
Definition: ge_sys_math.h:56
#define FILTER_AVI
AVI Movie.
Definition: ge_prepass.h:198
IMAGERESULT
Definition: ge_prepass.h:3925
@ OK
Image loaded/created.
@ NONE
None.
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
PyFrameObject * frame
Definition: pycore_traceback.h:92
#define iferr_return
Definition: resultbase.h:1524

Further Reading