QMediaFormat¶
Describes an encoding format for a multimedia file or stream. More…
New in version 6.1.
Synopsis¶
Functions¶
def
__eq__
(other)def
__ne__
(other)def
audioCodec
()def
fileFormat
()def
isSupported
(mode)def
mimeType
()def
resolveForEncoding
(flags)def
setAudioCodec
(codec)def
setFileFormat
(f)def
setVideoCodec
(codec)def
supportedAudioCodecs
(m)def
supportedFileFormats
(m)def
supportedVideoCodecs
(m)def
swap
(other)def
videoCodec
()
Static functions¶
def
audioCodecDescription
(codec)def
audioCodecName
(codec)def
fileFormatDescription
(fileFormat)def
fileFormatName
(fileFormat)def
videoCodecDescription
(codec)def
videoCodecName
(codec)
Detailed Description¶
QMediaFormat
describes an encoding format for a multimedia file or stream.
You can check whether a certain media format can be used for encoding or decoding using QMediaFormat
.
- class PySide6.QtMultimedia.QMediaFormat([format=QMediaFormat.FileFormat.UnspecifiedFormat])¶
PySide6.QtMultimedia.QMediaFormat(other)
- Parameters
format –
FileFormat
Constructs a QMediaFormat
object for format
.
- PySide6.QtMultimedia.QMediaFormat.FileFormat¶
Describes the container format used in a multimedia file or stream.
Constant
Description
QMediaFormat.WMA
QMediaFormat.AAC
QMediaFormat.Matroska
QMediaFormat.WMV
QMediaFormat.MP3
QMediaFormat.Wave
QMediaFormat.Ogg
QMediaFormat.MPEG4
QMediaFormat.AVI
QMediaFormat.QuickTime
QMediaFormat.WebM
QMediaFormat.Mpeg4Audio
QMediaFormat.FLAC
QMediaFormat.UnspecifiedFormat
The format is unspecified.
- PySide6.QtMultimedia.QMediaFormat.AudioCodec¶
Describes the audio codec used in multimedia file or stream.
Constant
Description
QMediaFormat.AudioCodec.WMA
QMediaFormat.AudioCodec.AC3
QMediaFormat.AudioCodec.AAC
QMediaFormat.AudioCodec.ALAC
QMediaFormat.AudioCodec.DolbyTrueHD
QMediaFormat.AudioCodec.EAC3
QMediaFormat.AudioCodec.MP3
QMediaFormat.AudioCodec.Wave
QMediaFormat.AudioCodec.Vorbis
QMediaFormat.AudioCodec.FLAC
QMediaFormat.AudioCodec.Opus
QMediaFormat.AudioCodec.Unspecified
Unspecified codec
- PySide6.QtMultimedia.QMediaFormat.VideoCodec¶
Describes the video coded used in multimedia file or stream.
Constant
Description
QMediaFormat.VideoCodec.VP8
QMediaFormat.VideoCodec.MPEG2
QMediaFormat.VideoCodec.MPEG1
QMediaFormat.VideoCodec.WMV
QMediaFormat.VideoCodec.H265
QMediaFormat.VideoCodec.H264
QMediaFormat.VideoCodec.MPEG4
QMediaFormat.VideoCodec.AV1
QMediaFormat.VideoCodec.MotionJPEG
MotionJPEG
QMediaFormat.VideoCodec.VP9
QMediaFormat.VideoCodec.Theora
QMediaFormat.VideoCodec.Unspecified
Video codec not specified
- PySide6.QtMultimedia.QMediaFormat.ConversionMode¶
In many cases, systems have asymmetric capabilities and can often decode more formats or codecs than can be encoded. This enum describes the requested conversion mode to be used when checking whether a certain file format or codec is supported.
Constant
Description
QMediaFormat.Encode
Used to check whether a certain file format or codec can be encoded.
QMediaFormat.Decode
Used to check whether a certain file format or codec can be decoded.
- PySide6.QtMultimedia.QMediaFormat.ResolveFlags¶
Describes the requirements for resolving a suitable format for QMediaRecorder
.
Constant
Description
QMediaFormat.NoFlags
No requirements
QMediaFormat.RequiresVideo
A video codec is required
See also
- PySide6.QtMultimedia.QMediaFormat.fmt¶
- PySide6.QtMultimedia.QMediaFormat.audio¶
- PySide6.QtMultimedia.QMediaFormat.video¶
- PySide6.QtMultimedia.QMediaFormat.audioCodec()¶
- Return type
This property holds The audio codec of the media..
See also
AudioCodec
- static PySide6.QtMultimedia.QMediaFormat.audioCodecDescription(codec)¶
- Parameters
codec –
AudioCodec
- Return type
str
Returns a description for codec
.
- static PySide6.QtMultimedia.QMediaFormat.audioCodecName(codec)¶
- Parameters
codec –
AudioCodec
- Return type
str
Returns a string based name for codec
.
- PySide6.QtMultimedia.QMediaFormat.fileFormat()¶
- Return type
This property holds The file (container) format of the media..
See also
FileFormat
- static PySide6.QtMultimedia.QMediaFormat.fileFormatDescription(fileFormat)¶
- Parameters
fileFormat –
FileFormat
- Return type
str
Returns a description for fileFormat
.
- static PySide6.QtMultimedia.QMediaFormat.fileFormatName(fileFormat)¶
- Parameters
fileFormat –
FileFormat
- Return type
str
Returns a string based name for fileFormat
.
- PySide6.QtMultimedia.QMediaFormat.isSupported(mode)¶
- Parameters
mode –
ConversionMode
- Return type
bool
Returns true
if Qt Multimedia can encode or decode this format, depending on mode
.
- PySide6.QtMultimedia.QMediaFormat.mimeType()¶
- Return type
Returns the MIME type for the file format used in this media format.
- PySide6.QtMultimedia.QMediaFormat.__ne__(other)¶
- Parameters
- Return type
bool
- PySide6.QtMultimedia.QMediaFormat.__eq__(other)¶
- Parameters
- Return type
bool
- PySide6.QtMultimedia.QMediaFormat.resolveForEncoding(flags)¶
- Parameters
flags –
ResolveFlags
Resolves the format, based on flags
, to a format that is supported by QMediaRecorder
.
This method tries to find the best possible match for unspecified settings. Settings that are not supported by the recorder will be modified to the closest match that is supported.
When resolving, priority is given in the following order:
File format
Video codec
Audio codec
- PySide6.QtMultimedia.QMediaFormat.setAudioCodec(codec)¶
- Parameters
codec –
AudioCodec
This property holds The audio codec of the media..
See also
AudioCodec
- PySide6.QtMultimedia.QMediaFormat.setFileFormat(f)¶
- Parameters
f –
FileFormat
This property holds The file (container) format of the media..
See also
FileFormat
- PySide6.QtMultimedia.QMediaFormat.setVideoCodec(codec)¶
- Parameters
codec –
VideoCodec
This property holds The video codec of the media..
See also
VideoCodec
- PySide6.QtMultimedia.QMediaFormat.supportedAudioCodecs(m)¶
- Parameters
m –
ConversionMode
- Return type
Returns a list of audio codecs for the chosen file format and video codec (m
).
To get all supported audio codecs, run this query on a default constructed QMediaFormat
.
See also
ConversionMode
- PySide6.QtMultimedia.QMediaFormat.supportedFileFormats(m)¶
- Parameters
m –
ConversionMode
- Return type
Returns a list of file formats for the audio and video codec indicated by m
.
To get all supported file formats, run this query on a default constructed QMediaFormat
.
See also
ConversionMode
- PySide6.QtMultimedia.QMediaFormat.supportedVideoCodecs(m)¶
- Parameters
m –
ConversionMode
- Return type
Returns a list of video codecs for the chosen file format and audio codec (m
).
To get all supported video codecs, run this query on a default constructed MediaFormat.
See also
ConversionMode
- PySide6.QtMultimedia.QMediaFormat.swap(other)¶
- Parameters
- PySide6.QtMultimedia.QMediaFormat.videoCodec()¶
- Return type
This property holds The video codec of the media..
See also
VideoCodec
- static PySide6.QtMultimedia.QMediaFormat.videoCodecDescription(codec)¶
- Parameters
codec –
VideoCodec
- Return type
str
Returns a description for codec
.
- static PySide6.QtMultimedia.QMediaFormat.videoCodecName(codec)¶
- Parameters
codec –
VideoCodec
- Return type
str
Returns a string based name for codec
.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.