Skip to content

MediaRecorder

Qt Base Class: QMediaRecorder

Signature: QMediaRecorder(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QMediaRecorder
PySide6.QtMultimedia
QMediaRecorder(self, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473573985120["multimedia.MediaRecorder"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473573924608["QtMultimedia.QMediaRecorder"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473573985120
  140713234304496 --> 1473299815024
  1473573924608 --> 1473573985120
  1473288842240 --> 1473573924608
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ObjectMixin, QMediaRecorder

Source code in prettyqt\multimedia\mediarecorder.py
class MediaRecorder(core.ObjectMixin, QtMultimedia.QMediaRecorder):
    def set_output_location(self, url: datatypes.UrlType | os.PathLike | None = None):
        url = datatypes.to_local_url(url)
        self.setOutputLocation(url)

    def get_recorder_state(self) -> RecorderStateStr:
        """Return current recorder state.

        Returns:
            recorder state
        """
        return RECORDER_STATE.inverse[self.recorderState()]

    def get_encoding_mode(self) -> EncodingModeStr:
        """Return current encoding mode.

        Returns:
            encoding mode
        """
        return ENCODING_MODE.inverse[self.encodingMode()]

    def set_encoding_mode(self, mode: EncodingModeStr):
        """Set encoding mode.

        Args:
            mode: encoding mode to use
        """
        self.setEncodingMode(ENCODING_MODE[mode])

    def get_quality(self) -> QualityStr:
        """Return current quality setting.

        Returns:
            quality setting
        """
        return QUALITY.inverse[self.quality()]

    def set_quality(self, quality: QualityStr):
        """Set quality.

        Args:
            quality: quality to use
        """
        self.setQuality(QUALITY[quality])

    def get_error(self) -> ErrorStr:
        """Return error type.

        Returns:
            error type
        """
        return ERROR.inverse[self.error()]

get_encoding_mode() -> EncodingModeStr

Return current encoding mode.

Source code in prettyqt\multimedia\mediarecorder.py
def get_encoding_mode(self) -> EncodingModeStr:
    """Return current encoding mode.

    Returns:
        encoding mode
    """
    return ENCODING_MODE.inverse[self.encodingMode()]

get_error() -> ErrorStr

Return error type.

Source code in prettyqt\multimedia\mediarecorder.py
def get_error(self) -> ErrorStr:
    """Return error type.

    Returns:
        error type
    """
    return ERROR.inverse[self.error()]

get_quality() -> QualityStr

Return current quality setting.

Source code in prettyqt\multimedia\mediarecorder.py
def get_quality(self) -> QualityStr:
    """Return current quality setting.

    Returns:
        quality setting
    """
    return QUALITY.inverse[self.quality()]

get_recorder_state() -> RecorderStateStr

Return current recorder state.

Source code in prettyqt\multimedia\mediarecorder.py
def get_recorder_state(self) -> RecorderStateStr:
    """Return current recorder state.

    Returns:
        recorder state
    """
    return RECORDER_STATE.inverse[self.recorderState()]

set_encoding_mode(mode: EncodingModeStr)

Set encoding mode.

Parameters:

Name Type Description Default
mode EncodingModeStr

encoding mode to use

required
Source code in prettyqt\multimedia\mediarecorder.py
def set_encoding_mode(self, mode: EncodingModeStr):
    """Set encoding mode.

    Args:
        mode: encoding mode to use
    """
    self.setEncodingMode(ENCODING_MODE[mode])

set_quality(quality: QualityStr)

Set quality.

Parameters:

Name Type Description Default
quality QualityStr

quality to use

required
Source code in prettyqt\multimedia\mediarecorder.py
def set_quality(self, quality: QualityStr):
    """Set quality.

    Args:
        quality: quality to use
    """
    self.setQuality(QUALITY[quality])

⌗ Property table

Qt Property Type Doc
objectName QString
recorderState QMediaRecorder::RecorderState
duration qlonglong
outputLocation QUrl
actualLocation QUrl
metaData QMediaMetaData
error QMediaRecorder::Error
errorString QString
mediaFormat QMediaFormat
quality QMediaRecorder::Quality