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);
if (res != IMAGERESULT::OK)
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();

Further Reading

IMAGERESULT::OK
@ OK
Image loaded/created.
MovieSaver::Open
IMAGERESULT Open(const Filename &name, BaseBitmap *bm, Int32 fps, Int32 format, BaseContainer *data, SAVEBIT savebits, BaseSound *sound=nullptr)
FILTER_AVI
#define FILTER_AVI
AVI Movie.
Definition: ge_prepass.h:191
MAXONCONVERTMODE::NONE
@ NONE
No check if file exists under case-sensitive drives.
iferr_return
#define iferr_return
Definition: resultbase.h:1465
MAXON_SOURCE_LOCATION
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
MovieSaver::Write
IMAGERESULT Write(BaseBitmap *bm)
MaxonConvert
maxon::Url MaxonConvert(const Filename &fn, MAXONCONVERTMODE convertMode)
Int32
maxon::Int32 Int32
Definition: ge_sys_math.h:60
AutoAlloc
Definition: ge_autoptr.h:36
IMAGERESULT
IMAGERESULT
Definition: ge_prepass.h:3691
MovieSaver::Close
void Close(void)
Closes the movie stream.
SAVEBIT::NONE
@ NONE
None.