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:

  • MovieSaver::Alloc(): Creates a new MovieSaver object.
  • MovieSaver::Free(): Deletes the given MovieSaver object.

Functionality

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

  • MovieSaver::Open(): Opens or creates the given movie file.
  • MovieSaver::Write(): Writes the given BaseBitmap into the movie file.
  • MovieSaver::Close(): Closes the open movie file.
  • MovieSaver::Choose(): Opens the standard dialog to select movie compression settings.
// This example saves multiple bitmaps into a movie file.
AutoAlloc<MovieSaver> movieSaver;
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();
NONE
Definition: asset_browser.h:1
Py_UCS4 * res
Definition: unicodeobject.h:1113
OK
User has selected a font.
Definition: customgui_fontchooser.h:0
#define FILTER_AVI
AVI Movie.
Definition: ge_prepass.h:197
IMAGERESULT
Definition: ge_prepass.h:3947
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
maxon::Int32 Int32
Definition: ge_sys_math.h:51
maxon::Url MaxonConvert(const Filename &fn, MAXONCONVERTMODE convertMode)
PyFrameObject * frame
Definition: pycore_traceback.h:92
#define iferr_return
Definition: resultbase.h:1531

Further Reading