Auf dieser Seite

QMediaFormat Class

Beschreibt ein Kodierungsformat für eine Multimediadatei oder einen Multimediastream. Mehr...

Kopfzeile: #include <QMediaFormat>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia

Öffentliche Typen

enum class AudioCodec { WMA, AC3, AAC, ALAC, DolbyTrueHD, …, Unspecified }
enum ConversionMode { Encode, Decode }
enum FileFormat { WMA, AAC, Matroska, WMV, MP3, …, UnspecifiedFormat }
enum ResolveFlags { NoFlags, RequiresVideo }
enum class VideoCodec { VP8, MPEG2, MPEG1, WMV, H265, …, Unspecified }

Eigenschaften

Öffentliche Funktionen

QMediaFormat(QMediaFormat::FileFormat format = UnspecifiedFormat)
QMediaFormat(const QMediaFormat &other)
QMediaFormat(QMediaFormat &&other)
~QMediaFormat()
QMediaFormat::AudioCodec audioCodec() const
QMediaFormat::FileFormat fileFormat() const
bool isSupported(QMediaFormat::ConversionMode mode) const
QMimeType mimeType() const
void resolveForEncoding(QMediaFormat::ResolveFlags flags)
void setAudioCodec(QMediaFormat::AudioCodec codec)
void setFileFormat(QMediaFormat::FileFormat f)
void setVideoCodec(QMediaFormat::VideoCodec codec)
QList<QMediaFormat::AudioCodec> supportedAudioCodecs(QMediaFormat::ConversionMode m)
QList<QMediaFormat::FileFormat> supportedFileFormats(QMediaFormat::ConversionMode m)
QList<QMediaFormat::VideoCodec> supportedVideoCodecs(QMediaFormat::ConversionMode m)
void swap(QMediaFormat &other)
QMediaFormat::VideoCodec videoCodec() const
bool operator!=(const QMediaFormat &other) const
QMediaFormat &operator=(QMediaFormat &&other)
QMediaFormat &operator=(const QMediaFormat &other)
bool operator==(const QMediaFormat &other) const

Statische öffentliche Mitglieder

QString audioCodecDescription(QMediaFormat::AudioCodec codec)
QString audioCodecName(QMediaFormat::AudioCodec codec)
QString fileFormatDescription(QMediaFormat::FileFormat fileFormat)
QString fileFormatName(QMediaFormat::FileFormat fileFormat)
QString videoCodecDescription(QMediaFormat::VideoCodec codec)
QString videoCodecName(QMediaFormat::VideoCodec codec)

Ausführliche Beschreibung

QMediaFormat beschreibt ein Kodierungsformat für eine Multimediadatei oder einen Multimediastream.

Mit QMediaFormat können Sie prüfen, ob ein bestimmtes Medienformat zum Kodieren oder Dekodieren verwendet werden kann.

Dokumentation zum Mitgliedstyp

enum class QMediaFormat::AudioCodec

Beschreibt den in einer Multimediadatei oder einem Multimediastream verwendeten Audio-Codec.

KonstanteWertBeschreibung
QMediaFormat::AudioCodec::WMA9Windows Media Audio
QMediaFormat::AudioCodec::AC32Dolby Digital
QMediaFormat::AudioCodec::AAC1Advanced Audio Coding
QMediaFormat::AudioCodec::ALAC10Apple Lossless Audio Codec
QMediaFormat::AudioCodec::DolbyTrueHD5Dolby TrueHD
QMediaFormat::AudioCodec::EAC33Dolby Digital Plus (EAC3)
QMediaFormat::AudioCodec::MP30MPEG-1 Audio Layer III oder MPEG-2 Audio Layer III
QMediaFormat::AudioCodec::Wave8Waveform Audio File Format
QMediaFormat::AudioCodec::Vorbis7Ogg Vorbis
QMediaFormat::AudioCodec::FLAC4Free Lossless Audio Codec
QMediaFormat::AudioCodec::Opus6Opus-Audioformat
QMediaFormat::AudioCodec::Unspecified-1Nicht näher bezeichneter Codec

enum QMediaFormat::ConversionMode

In vielen Fällen verfügen Systeme über asymmetrische Funktionen und können oft mehr Formate oder Codecs dekodieren als kodieren. Diese Aufzählung beschreibt den gewünschten Konvertierungsmodus, der bei der Überprüfung verwendet werden soll, ob ein bestimmtes Dateiformat oder ein bestimmter Codec unterstützt wird.

KonstanteWertBeschreibung
QMediaFormat::Encode0Wird verwendet, um zu prüfen, ob ein bestimmtes Dateiformat oder ein bestimmter Codec kodiert werden kann.
QMediaFormat::Decode1Wird verwendet, um zu prüfen, ob ein bestimmtes Dateiformat oder ein bestimmter Codec dekodiert werden kann.

Siehe auch „ supportedFileFormats “, „ supportedAudioCodecs “ und „ supportedVideoCodecs “.

enum QMediaFormat::FileFormat

Beschreibt das in einer Multimediadatei oder einem Multimediastream verwendete Containerformat.

KonstanteWertBeschreibung
QMediaFormat::WMA9Windows Media Audio
QMediaFormat::AAC8Advanced Audio Coding
QMediaFormat::Matroska2Matroska (MKV)
QMediaFormat::WMV0Windows Media Video
QMediaFormat::MP310MPEG-1 Audio Layer III oder MPEG-2 Audio Layer III
QMediaFormat::Wave12Waveform Audio File Format
QMediaFormat::Ogg4Ogg
QMediaFormat::MPEG43MPEG-4
QMediaFormat::AVI1Audio-Video-Interleave
QMediaFormat::QuickTime5QuickTime
QMediaFormat::WebM6WebM
QMediaFormat::Mpeg4Audio7MPEG-4 Teil 3 oder MPEG-4 Audio (offiziell ISO/IEC 14496-3)
QMediaFormat::FLAC11Free Lossless Audio Codec
QMediaFormat::UnspecifiedFormat-1Das Format ist nicht spezifiziert.

enum QMediaFormat::ResolveFlags

Beschreibt die Anforderungen für die Festlegung eines geeigneten Formats für QMediaRecorder.

KonstanteWertBeschreibung
QMediaFormat::NoFlags0Keine Anforderungen
QMediaFormat::RequiresVideo1Ein Videocodec ist erforderlich

Siehe auch resolveForEncoding().

enum class QMediaFormat::VideoCodec

Beschreibt den in einer Multimediadatei oder einem Stream verwendeten Videocodec.

KonstanteWertBeschreibung
QMediaFormat::VideoCodec::VP85VP8
QMediaFormat::VideoCodec::MPEG21MPEG-2
QMediaFormat::VideoCodec::MPEG10MPEG-1
QMediaFormat::VideoCodec::WMV9Windows Media Video
QMediaFormat::VideoCodec::H2654High Efficiency Video Coding (HEVC)
QMediaFormat::VideoCodec::H2643Advanced Video Coding
QMediaFormat::VideoCodec::MPEG42MPEG-4
QMediaFormat::VideoCodec::AV17AOMedia Video 1
QMediaFormat::VideoCodec::MotionJPEG10MotionJPEG
QMediaFormat::VideoCodec::VP96VP9
QMediaFormat::VideoCodec::Theora8Theora
QMediaFormat::VideoCodec::Unspecified-1Videocodec nicht angegeben

Eigenschaftsdokumentation

audioCodec : AudioCodec

Diese Eigenschaft enthält den Audio-Codec des Mediums.

Zugriffsfunktionen:

QMediaFormat::AudioCodec audioCodec() const
void setAudioCodec(QMediaFormat::AudioCodec codec)

Siehe auch „ QMediaFormat::AudioCodec “.

fileFormat : FileFormat

Diese Eigenschaft gibt das Datei- (Container-)Format des Mediums an.

Zugriffsfunktionen:

QMediaFormat::FileFormat fileFormat() const
void setFileFormat(QMediaFormat::FileFormat f)

Siehe auch „ QMediaFormat::FileFormat “.

videoCodec : VideoCodec

Diese Eigenschaft enthält den Videocodec der Mediendatei.

Zugriffsfunktionen:

QMediaFormat::VideoCodec videoCodec() const
void setVideoCodec(QMediaFormat::VideoCodec codec)

Siehe auch „ QMediaFormat::VideoCodec “.

Dokumentation zu den Mitgliedsfunktionen

QMediaFormat::QMediaFormat(QMediaFormat::FileFormat format = UnspecifiedFormat)

Erstellt ein QMediaFormat-Objekt für „ format “.

[noexcept] QMediaFormat::QMediaFormat(const QMediaFormat &other)

Erstellt ein QMediaFormat-Objekt durch Kopieren aus „ other “.

[constexpr noexcept default] QMediaFormat::QMediaFormat(QMediaFormat &&other)

Erstellt ein QMediaFormat-Objekt, indem es von other abgerufen wird.

[noexcept] QMediaFormat::~QMediaFormat()

Löscht das „ QMediaFormat “-Objekt.

QMediaFormat::AudioCodec QMediaFormat::audioCodec() const

Gibt den in diesem Format verwendeten Audio-Codec zurück.

Hinweis: Getter -Funktion für die Eigenschaft „audioCodec“.

Siehe auch „ setAudioCodec()“ und „ QMediaFormat::AudioCodec “.

[static invokable] QString QMediaFormat::audioCodecDescription(QMediaFormat::AudioCodec codec)

Gibt eine Beschreibung für „ codec “ zurück.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

[static invokable] QString QMediaFormat::audioCodecName(QMediaFormat::AudioCodec codec)

Gibt einen als Zeichenkette formatierten Namen für ` codec` zurück.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

[static invokable] QString QMediaFormat::fileFormatDescription(QMediaFormat::FileFormat fileFormat)

Gibt eine Beschreibung für „ fileFormat “ zurück.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

[static invokable] QString QMediaFormat::fileFormatName(QMediaFormat::FileFormat fileFormat)

Gibt einen als String dargestellten Namen für „ fileFormat “ zurück.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

[invokable] bool QMediaFormat::isSupported(QMediaFormat::ConversionMode mode) const

Gibt „ true “ zurück, wenn „ Qt Multimedia “ dieses Format kodieren oder dekodieren kann, abhängig von „ mode “.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

QMimeType QMediaFormat::mimeType() const

Gibt den MIME-Typ für das in diesem Medienformat verwendete Dateiformat zurück.

void QMediaFormat::resolveForEncoding(QMediaFormat::ResolveFlags flags)

Konvertiert das Format auf der Grundlage von flags in ein Format, das von QMediaRecorder unterstützt wird.

Diese Methode versucht, für nicht angegebene Einstellungen die bestmögliche Übereinstimmung zu finden. Einstellungen, die vom Recorder nicht unterstützt werden, werden so angepasst, dass sie der nächstgelegenen unterstützten Einstellung entsprechen.

Bei der Konvertierung wird die Priorität in der folgenden Reihenfolge gewährt:

  1. Dateiformat
  2. Videocodec
  3. Audio-Codec

void QMediaFormat::setAudioCodec(QMediaFormat::AudioCodec codec)

Setzt den Audio-Codec auf „ codec “.

Hinweis: Setter -Funktion für die Eigenschaft „ audioCodec “.

Siehe auch „ audioCodec()“ und „ QMediaFormat::AudioCodec “.

void QMediaFormat::setVideoCodec(QMediaFormat::VideoCodec codec)

Legt den Videocodec auf „ codec “ fest.

Hinweis: Setter -Funktion für die Eigenschaft „ videoCodec “.

Siehe auch „ videoCodec()“ und „ QMediaFormat::VideoCodec “.

[invokable] QList<QMediaFormat::AudioCodec> QMediaFormat::supportedAudioCodecs(QMediaFormat::ConversionMode m)

Gibt eine Liste der Audio-Codecs für das ausgewählte Dateiformat und den Video-Codec zurück (m).

Um alle unterstützten Audio-Codecs abzurufen, führen Sie diese Abfrage auf einem standardmäßig erstellten ` QMediaFormat` aus.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

Siehe auch QMediaFormat::ConversionMode.

[invokable] QList<QMediaFormat::FileFormat> QMediaFormat::supportedFileFormats(QMediaFormat::ConversionMode m)

Gibt eine Liste der Dateiformate für den durch m angegebenen Audio- und Videocodec zurück.

Um alle unterstützten Dateiformate abzurufen, führen Sie diese Abfrage auf einem standardmäßig erstellten ` QMediaFormat` aus.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

Siehe auch „ QMediaFormat::ConversionMode “.

[invokable] QList<QMediaFormat::VideoCodec> QMediaFormat::supportedVideoCodecs(QMediaFormat::ConversionMode m)

Gibt eine Liste der Video-Codecs für das ausgewählte Dateiformat und den Audio-Codec zurück (m).

Um alle unterstützten Videocodecs abzurufen, führen Sie diese Abfrage auf einem standardmäßig erstellten `MediaFormat` aus.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

Siehe auch QMediaFormat::ConversionMode.

[noexcept] void QMediaFormat::swap(QMediaFormat &other)

Wechselt das Medienformat mit „ other “.

QMediaFormat::VideoCodec QMediaFormat::videoCodec() const

Gibt den in diesem Format verwendeten Videocodec zurück.

Hinweis: Getter -Funktion für die Eigenschaft „videoCodec“.

Siehe auch „ setVideoCodec()“ und „ QMediaFormat::VideoCodec “.

[static invokable] QString QMediaFormat::videoCodecDescription(QMediaFormat::VideoCodec codec)

Gibt eine Beschreibung für „ codec “ zurück.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

[static invokable] QString QMediaFormat::videoCodecName(QMediaFormat::VideoCodec codec)

Gibt einen als Zeichenkette dargestellten Namen für „ codec “ zurück.

Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.

bool QMediaFormat::operator!=(const QMediaFormat &other) const

Gibt „ true “ zurück, wenn „ other “ nicht mit dem aktuellen Medienformat übereinstimmt; andernfalls wird „ false “ zurückgegeben.

[noexcept] QMediaFormat &QMediaFormat::operator=(QMediaFormat &&other)

Verschiebt „ other “ in diese „ QMediaFormat “-Objekte.

[noexcept] QMediaFormat &QMediaFormat::operator=(const QMediaFormat &other)

Kopiert „ other “ in dieses „ QMediaFormat “-Objekt.

bool QMediaFormat::operator==(const QMediaFormat &other) const

Gibt „ true “ zurück, wenn „ other “ dem aktuellen Medienformat entspricht; andernfalls wird „ false “ zurückgegeben.

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