QMediaFormat#
Describes an encoding format for a multimedia file or stream. More…
New in version 6.1.
Synopsis#
Properties#
audioCodec
- Audio codec of the mediafileFormat
- File (container) format of the mediavideoCodec
- Video codec of the media
Functions#
def
audioCodec
()def
fileFormat
()def
isSupported
(mode)def
mimeType
()def
__ne__
(other)def
__eq__
(other)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)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
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
.
Constructs a QMediaFormat
object by copying from other
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtMultimedia.QMediaFormat.audioCodec: AudioCodec#
This property holds The audio codec of the media..
See also
AudioCodec
- Access functions:
audioCodec
()setAudioCodec
(codec)
- property PᅟySide6.QtMultimedia.QMediaFormat.fileFormat: FileFormat#
This property holds The file (container) format of the media..
See also
FileFormat
- Access functions:
fileFormat
()setFileFormat
(f)
- property PᅟySide6.QtMultimedia.QMediaFormat.videoCodec: VideoCodec#
This property holds The video codec of the media..
See also
VideoCodec
- Access functions:
videoCodec
()setVideoCodec
(codec)
- 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
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:
Returns the audio codec used in this format.
See also
setAudioCodec()
AudioCodec
Getter of property 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:
See also
Getter of property 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
Returns true
if other
is not equal to the current media format, otherwise returns false
.
- PySide6.QtMultimedia.QMediaFormat.__eq__(other)#
- Parameters:
- Return type:
bool
Returns true
if other
is equal to the current media format, otherwise returns false
.
- 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
Sets the audio codec to codec
.
See also
audioCodec()
AudioCodec
Setter of property audioCodec
.
- PySide6.QtMultimedia.QMediaFormat.setFileFormat(f)#
- Parameters:
f –
FileFormat
See also
Setter of property fileFormat
.
- PySide6.QtMultimedia.QMediaFormat.setVideoCodec(codec)#
- Parameters:
codec –
VideoCodec
Sets the video codec to codec
.
See also
videoCodec()
VideoCodec
Setter of property 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:
Swaps the media format with other
.
- PySide6.QtMultimedia.QMediaFormat.videoCodec()#
- Return type:
Returns the video codec used in this format.
See also
setVideoCodec()
VideoCodec
Getter of property 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
.