mediaFormat QML Value Type▲
-
Import Statement: import QtMultimedia
-
Group: mediaFormat is part of qmlvaluetypes, multimedia_qml
Detailed Description▲
The MediaFormat type describes the format of a media file. It contains three properties that describe the file type and the audio and video codecs that are being used.
MediaFormat can be used to specify the type of file that should be created by a MediaRecorder. The snippet below shows an example that sets up the recorder to create an mpeg4 video with AAC encoded audio and H265 video:
CaptureSession {
... // setup inputs
MediaRecorder {
mediaFormat {
fileFormat
:
MediaFormat.MPEG4
audioCodec
:
MediaFormat.AudioCodec.AAC
videoCodec
:
MediaFormat.VideoCodec.H265
}
}
}
If the specified mediaFormat is not supported, the MediaRecorder will automatically try to find the best possible replacement format and use that instead.
See Also▲
See also MediaRecorder, CaptureSession
Property Documentation▲
audioCodec : enumeration▲
Describes the audio codec used in multimedia file or stream. It can take one of the following values:
Property value |
Description |
---|---|
MediaFormat.WMA |
|
MediaFormat.AC3 |
|
MediaFormat.AAC |
|
MediaFormat.ALAC |
|
MediaFormat.DolbyTrueHD |
|
MediaFormat.EAC3 |
|
MediaFormat.MP3 |
|
MediaFormat.Wave |
|
MediaFormat.Vorbis |
|
MediaFormat.FLAC |
|
MediaFormat.Opus |
|
MediaFormat.Unspecified |
Unspecified codec |
fileFormat : enumeration▲
Describes the container format used in a multimedia file or stream. It can take one of the following values:
Property value |
Description |
---|---|
MediaFormat.WMA |
|
MediaFormat.AAC |
|
MediaFormat.Matroska |
|
MediaFormat.WMV |
|
MediaFormat.MP3 |
|
MediaFormat.Wave |
|
MediaFormat.Ogg |
|
MediaFormat.MPEG4 |
|
MediaFormat.AVI |
|
MediaFormat.QuickTime |
|
MediaFormat.WebM |
|
MediaFormat.Mpeg4Audio |
|
MediaFormat.FLAC |
|
MediaFormat.UnspecifiedFormat |
The format is unspecified. |
videoCodec : enumeration▲
Describes the video codec used in multimedia file or stream. It can take one of the following values:
Property value |
Description |
---|---|
MediaFormat.VP8 |
|
MediaFormat.MPEG2 |
|
MediaFormat.MPEG1 |
|
MediaFormat.WMV |
|
MediaFormat.H265 |
|
MediaFormat.H264 |
|
MediaFormat.MPEG4 |
|
MediaFormat.AV1 |
|
MediaFormat.MotionJPEG |
|
MediaFormat.VP9 |
|
MediaFormat.Theora |
|
MediaFormat.Unspecified |
Video codec not specified |
Method Documentation▲
string audioCodecDescription(codec)▲
Returns a description for codec.
string audioCodecName(codec)▲
Returns a string based name for codec.
string fileFormatDescription(fileFormat)▲
Returns a description for fileFormat.
string fileFormatName(fileFormat)▲
Returns a string based name for fileFormat.
list<AudioCodec> supportedAudioFormats(conversionMode)▲
Returns a list of audio codecs for the chosen file format and video codec (conversionMode).
To get all supported audio codecs, run this query on a default constructed MediaFormat. To get a list of supported audio codecs for a specific combination of a file format and a video codec, you can set the fileFormat and videoCodec properties before running this query.
See Also▲
See also QMediaFormat::ConversionMode
list<FileFormat> supportedFileFormats(conversionMode)▲
Returns a list of file formats for the audio and video codec indicated by conversionMode.
To get all supported file formats, run this query on a default constructed MediaFormat. To get a list of file formats supporting a specific combination of an audio and video codec, you can set the audioCodec and videoCodec properties before running this query.
See Also▲
See also QMediaFormat::ConversionMode
list<VideoCodec> supportedVideoCodecs(conversionMode)▲
Returns a list of video codecs for the chosen file format and audio codec (conversionMode).
To get all supported video codecs, run this query on a default constructed MediaFormat. To get a list of supported video codecs for a specific combination of a file format and an audio codec, you can set the fileFormat and audioCodec properties before running this query.
See Also▲
See also QMediaFormat::ConversionMode
string videoCodecDescription(codec)▲
Returns a description for codec.
string videoCodecName(codec)▲
Returns a string based name for codec.