mediaFormat QML Basic Type

MediaFormat describes the format of a media file. More...

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 MediaRecorder and CaptureSession.

© 2024 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.