Class: QgsVideoExporter¶
Handles exports of sequential image files to video formats.
Video export functionality is not available on all systems. The
isAvailable() function can be used to test whether video
export is available on the current system.
Added in version 4.0.
Class Hierarchy¶
Base classes¶
- class qgis.core.QgsVideoExporter[source]¶
Bases:
QObject- __init__(filename: str | None, size: QSize, framesPerSecond: float)
Constructor for QgsVideoExporter.
- Parameters:
filename (Optional[str]) – destination video file name
size (QSize) – output video frame size
framesPerSecond (float) – output video frames per second
- errorString(self) str[source]¶
Returns the string describing the last error received while writing the video.
See also
error()- Return type:
str
- feedback(self) QgsFeedback | None[source]¶
Returns the optional feedback object.
See also
- Return type:
Optional[QgsFeedback]
- signal finished[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- frameDuration(self) int[source]¶
Returns the duration of each frame, in micro-seconds.
See also
- Return type:
int
- framesPerSecond(self) float[source]¶
Returns the output video frames per second.
See also
- Return type:
float
- inputFiles(self) List[str][source]¶
Returns the list of input image
files.See also
- Return type:
List[str]
- static isAvailable() bool[source]¶
Returns
Trueif the video export functionality is available on the current system.- Return type:
bool
- setFeedback(self, feedback: QgsFeedback | None)[source]¶
Sets an optional
feedbackobject, for progress reports and cancellation support.The object must exist for the lifetime of the export, ownership is not transferred.
See also
- Parameters:
feedback (Optional[QgsFeedback])
- setInputFiles(self, files: Iterable[str | None])[source]¶
Sets the list of input image
files.The list must be an ordered list of existing image file paths, which will form the output video frames.
See also
See also
- Parameters:
files (Iterable[Optional[str]])
- setInputFilesByPattern(self, directory: str | None, pattern: str | None)[source]¶
Sets the input image files by searching a
directoryfor files matching apattern.E.g. setting
patternto “*.png” will find all PNG files in thedirectoryand use them as input frames.The frames will be sorted alphabetically by filename.
See also
See also
- Parameters:
directory (Optional[str])
pattern (Optional[str])
- writeVideo(self)[source]¶
Starts the video export operation.
The
finished()signal will be emitted when the operation is complete.- Raises:
QgsNotSupportedException – if writing video is not supported on the current system.