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¶
Methods
Returns the string describing the last error received while writing the video. |
|
Returns the optional feedback object. |
|
Returns the duration of each frame, in micro-seconds. |
|
Returns the output video frames per second. |
|
Returns the list of input image files. |
|
Sets an optional feedback object, for progress reports and cancellation support. |
|
Sets the list of input image files. |
|
Sets the input image files by searching a directory for files matching a pattern. |
|
Returns the output video frame size. |
|
Starts the video export operation. |
Static Methods
Returns |
Signals
Emitted when the video export finishes. |
- 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]
- 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.