MtFootageData Manual

About

A MtFootageData object stores information on the video footage loaded by the parent MotionTrackerObject.

Access

The MtFootageData object is obtained from the parent MotionTrackerObject.

  • MotionTrackerObject::GetFootageData(): Returns a new MtFootageData object.
  • MtFootageData::Free(): Deletes a MtFootageData object.
Warning
The returned object is a copy owned by the caller.
// This example accesses the Motion Tracker object
// to print the used footage filename to the console.
// check if an object is selected and if it is a Motion Tracker object
BaseObject* const obj = doc->GetActiveObject();
if (obj == nullptr || !obj->IsInstanceOf(Omotiontracker))
return maxon::IllegalArgumentError(MAXON_SOURCE_LOCATION);
const MotionTrackerObject* const moTrackObject = static_cast<MotionTrackerObject*>(obj);
MtFootageData* footage = moTrackObject->GetFootageData();
if (footage == nullptr)
return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
const Filename footageName = footage->GetFootageName();
ApplicationOutput("Footage: " + footageName.GetString());
// do not forget to free the copy
MtFootageData::Free(footage);
PyObject * obj
Definition: complexobject.h:60
#define Omotiontracker
Motion tracker.
Definition: ge_prepass.h:1102
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
const char * doc
Definition: pyerrors.h:226

Footage Data

The MtFootageData object provides read-access to several properties of the loaded video footage.

General information on the loaded footage:

  • MtFootageData::GetFootageName(): Returns the Filename of the loaded video file.
  • MtFootageData::GetFirstFrameNumber(): Returns the first frame of the loaded video file.
  • MtFootageData::GetLastFrameNumber() Returns the last frame of the loaded video file.

Video Resolution and Ratio of the loaded footage:

  • MtFootageData::GetResolutionWidthPix(): Returns the resolution width.
  • MtFootageData::GetResolutionHeightPix(): Returns the resolution height.
  • MtFootageData::GetResolutionAspectRatio(): Returns the resolution aspect ratio.
  • MtFootageData::GetPixelAspectRatio(): Returns the pixel aspect ratio.
  • MtFootageData::GetImageAspectRatio(): Returns the result aspect ratio.
  • MtFootageData::GetDownsamplingFactor(): Returns the used downsampling factor.
// This example prints various settings of the
// used footage to the console window.
MtFootageData* footage = moTrackObject->GetFootageData();
if (footage == nullptr)
return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
// AutoFree takes ownership
AutoFree<MtFootageData> freeFootage;
freeFootage.Assign(footage);
// access and print footage filename
const Filename footageName = footage->GetFootageName();
ApplicationOutput("Footage: " + footageName.GetString());
// access footage resolution
const Int32 width = footage->GetResolutionWidthPix(true);
const Int32 height = footage->GetResolutionHeightPix(true);
// print result
const String widthStr = String::IntToString(width);
const String heightStr = String::IntToString(height);
ApplicationOutput("Width: " + widthStr + ", Height: " + heightStr);
maxon::Int32 Int32
Definition: ge_sys_math.h:51
unsigned long Py_ssize_t width
Definition: pycore_traceback.h:88

Further Reading