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
- audioCodec : AudioCodec
- fileFormat : FileFormat
- videoCodec : VideoCodec
Ö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.
| Konstante | Wert | Beschreibung |
|---|---|---|
QMediaFormat::AudioCodec::WMA | 9 | Windows Media Audio |
QMediaFormat::AudioCodec::AC3 | 2 | Dolby Digital |
QMediaFormat::AudioCodec::AAC | 1 | Advanced Audio Coding |
QMediaFormat::AudioCodec::ALAC | 10 | Apple Lossless Audio Codec |
QMediaFormat::AudioCodec::DolbyTrueHD | 5 | Dolby TrueHD |
QMediaFormat::AudioCodec::EAC3 | 3 | Dolby Digital Plus (EAC3) |
QMediaFormat::AudioCodec::MP3 | 0 | MPEG-1 Audio Layer III oder MPEG-2 Audio Layer III |
QMediaFormat::AudioCodec::Wave | 8 | Waveform Audio File Format |
QMediaFormat::AudioCodec::Vorbis | 7 | Ogg Vorbis |
QMediaFormat::AudioCodec::FLAC | 4 | Free Lossless Audio Codec |
QMediaFormat::AudioCodec::Opus | 6 | Opus-Audioformat |
QMediaFormat::AudioCodec::Unspecified | -1 | Nicht 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.
| Konstante | Wert | Beschreibung |
|---|---|---|
QMediaFormat::Encode | 0 | Wird verwendet, um zu prüfen, ob ein bestimmtes Dateiformat oder ein bestimmter Codec kodiert werden kann. |
QMediaFormat::Decode | 1 | Wird 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.
| Konstante | Wert | Beschreibung |
|---|---|---|
QMediaFormat::WMA | 9 | Windows Media Audio |
QMediaFormat::AAC | 8 | Advanced Audio Coding |
QMediaFormat::Matroska | 2 | Matroska (MKV) |
QMediaFormat::WMV | 0 | Windows Media Video |
QMediaFormat::MP3 | 10 | MPEG-1 Audio Layer III oder MPEG-2 Audio Layer III |
QMediaFormat::Wave | 12 | Waveform Audio File Format |
QMediaFormat::Ogg | 4 | Ogg |
QMediaFormat::MPEG4 | 3 | MPEG-4 |
QMediaFormat::AVI | 1 | Audio-Video-Interleave |
QMediaFormat::QuickTime | 5 | QuickTime |
QMediaFormat::WebM | 6 | WebM |
QMediaFormat::Mpeg4Audio | 7 | MPEG-4 Teil 3 oder MPEG-4 Audio (offiziell ISO/IEC 14496-3) |
QMediaFormat::FLAC | 11 | Free Lossless Audio Codec |
QMediaFormat::UnspecifiedFormat | -1 | Das Format ist nicht spezifiziert. |
enum QMediaFormat::ResolveFlags
Beschreibt die Anforderungen für die Festlegung eines geeigneten Formats für QMediaRecorder.
| Konstante | Wert | Beschreibung |
|---|---|---|
QMediaFormat::NoFlags | 0 | Keine Anforderungen |
QMediaFormat::RequiresVideo | 1 | Ein Videocodec ist erforderlich |
Siehe auch resolveForEncoding().
enum class QMediaFormat::VideoCodec
Beschreibt den in einer Multimediadatei oder einem Stream verwendeten Videocodec.
| Konstante | Wert | Beschreibung |
|---|---|---|
QMediaFormat::VideoCodec::VP8 | 5 | VP8 |
QMediaFormat::VideoCodec::MPEG2 | 1 | MPEG-2 |
QMediaFormat::VideoCodec::MPEG1 | 0 | MPEG-1 |
QMediaFormat::VideoCodec::WMV | 9 | Windows Media Video |
QMediaFormat::VideoCodec::H265 | 4 | High Efficiency Video Coding (HEVC) |
QMediaFormat::VideoCodec::H264 | 3 | Advanced Video Coding |
QMediaFormat::VideoCodec::MPEG4 | 2 | MPEG-4 |
QMediaFormat::VideoCodec::AV1 | 7 | AOMedia Video 1 |
QMediaFormat::VideoCodec::MotionJPEG | 10 | MotionJPEG |
QMediaFormat::VideoCodec::VP9 | 6 | VP9 |
QMediaFormat::VideoCodec::Theora | 8 | Theora |
QMediaFormat::VideoCodec::Unspecified | -1 | Videocodec 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:
- Dateiformat
- Videocodec
- 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.