QMediaFormat Class
Beschreibt ein Kodierungsformat für eine Multimediadatei oder einen Stream. 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) |
Detaillierte Beschreibung
QMediaFormat beschreibt ein Kodierungsformat für eine Multimedia-Datei oder einen Stream.
Mit QMediaFormat können Sie überprüfen, ob ein bestimmtes Medienformat für die Kodierung oder Dekodierung verwendet werden kann.
Dokumentation der Mitgliedstypen
enum class QMediaFormat::AudioCodec
Beschreibt den in der Multimediadatei oder dem Stream verwendeten Audiocodec.
Konstante | Wert | Beschreibung |
---|---|---|
QMediaFormat::AudioCodec::WMA | 9 | Windows Media Audio |
QMediaFormat::AudioCodec::AC3 | 2 | Dolby Digital |
QMediaFormat::AudioCodec::AAC | 1 | Erweiterte Audiocodierung |
QMediaFormat::AudioCodec::ALAC | 10 | Apple Lossless-Audiocodec |
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 Dateiformat |
QMediaFormat::AudioCodec::Vorbis | 7 | Ogg Vorbis |
QMediaFormat::AudioCodec::FLAC | 4 | Freier verlustfreier Audiocodec |
QMediaFormat::AudioCodec::Opus | 6 | Opus Audio Format |
QMediaFormat::AudioCodec::Unspecified | -1 | Nicht spezifizierter Codec |
enum QMediaFormat::ConversionMode
In vielen Fällen haben Systeme asymmetrische Fähigkeiten und können oft mehr Formate oder Codecs dekodieren als kodiert werden können. Diese Aufzählung beschreibt den angeforderten Konvertierungsmodus, der bei der Prüfung, ob ein bestimmtes Dateiformat oder ein Codec unterstützt wird, verwendet werden soll.
Konstante | Wert | Beschreibung |
---|---|---|
QMediaFormat::Encode | 0 | Wird verwendet, um zu prüfen, ob ein bestimmtes Dateiformat oder ein Codec kodiert werden kann. |
QMediaFormat::Decode | 1 | Wird verwendet, um zu prüfen, ob ein bestimmtes Dateiformat oder ein Codec dekodiert werden kann. |
Siehe auch supportedFileFormats, supportedAudioCodecs, und supportedVideoCodecs.
enum QMediaFormat::FileFormat
Beschreibt das in einer Multimediadatei oder einem Stream verwendete Containerformat.
Konstante | Wert | Beschreibung |
---|---|---|
QMediaFormat::WMA | 9 | Windows Media Audio |
QMediaFormat::AAC | 8 | Erweiterte Audiocodierung |
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 | Wellenform-Audio-Dateiformat |
QMediaFormat::Ogg | 4 | Ogg |
QMediaFormat::MPEG4 | 3 | MPEG-4 |
QMediaFormat::AVI | 1 | Audio-Video-Verschachtelung |
QMediaFormat::QuickTime | 5 | QuickTime |
QMediaFormat::WebM | 6 | WebM |
QMediaFormat::Mpeg4Audio | 7 | MPEG-4 Teil 3 oder MPEG-4 Audio (formell ISO/IEC 14496-3) |
QMediaFormat::FLAC | 11 | Freier verlustfreier Audiocodec |
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 der Multimediadatei oder dem Stream verwendeten Videocode.
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 | Hocheffiziente Videokodierung (HEVC) |
QMediaFormat::VideoCodec::H264 | 3 | Erweiterte Videokodierung |
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 | Video-Codec nicht angegeben |
Eigenschaft Dokumentation
audioCodec : AudioCodec
Diese Eigenschaft enthält den Audiocodec des Mediums.
Zugriffsfunktionen:
QMediaFormat::AudioCodec | audioCodec() const |
void | setAudioCodec(QMediaFormat::AudioCodec codec) |
Siehe auch QMediaFormat::AudioCodec.
fileFormat : FileFormat
Diese Eigenschaft enthält das Dateiformat (Container) des Mediums.
Zugriffsfunktionen:
QMediaFormat::FileFormat | fileFormat() const |
void | setFileFormat(QMediaFormat::FileFormat f) |
Siehe auch QMediaFormat::FileFormat.
videoCodec : VideoCodec
Diese Eigenschaft enthält den Videocodec des Mediums.
Zugriffsfunktionen:
QMediaFormat::VideoCodec | videoCodec() const |
void | setVideoCodec(QMediaFormat::VideoCodec codec) |
Siehe auch QMediaFormat::VideoCodec.
Dokumentation der Mitgliedsfunktionen
QMediaFormat::QMediaFormat(QMediaFormat::FileFormat format = UnspecifiedFormat)
Konstruiert ein QMediaFormat-Objekt für format.
[noexcept]
QMediaFormat::QMediaFormat(const QMediaFormat &other)
Konstruiert ein QMediaFormat-Objekt durch Kopieren von other.
[noexcept]
QMediaFormat::QMediaFormat(QMediaFormat &&other)
Konstruiert ein QMediaFormat-Objekt durch Verschieben von other.
[noexcept]
QMediaFormat::~QMediaFormat()
Zerstört das Objekt QMediaFormat.
QMediaFormat::AudioCodec QMediaFormat::audioCodec() const
Gibt den in diesem Format verwendeten Audiocodec 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 Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.
[static invokable]
QString QMediaFormat::audioCodecName(QMediaFormat::AudioCodec codec)
Gibt einen stringbasierten Namen für codec zurück.
Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus 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 Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.
[static invokable]
QString QMediaFormat::fileFormatName(QMediaFormat::FileFormat fileFormat)
Gibt einen stringbasierten Namen für fileFormat zurück.
Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus 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 Meta-Objektsystem und von QML aus 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)
Löst das Format, basierend auf flags, in ein Format auf, das von QMediaRecorder unterstützt wird.
Diese Methode versucht, die bestmögliche Übereinstimmung für nicht spezifizierte Einstellungen zu finden. Einstellungen, die vom Rekorder nicht unterstützt werden, werden auf die nächstmögliche Übereinstimmung geändert, die unterstützt wird.
Bei der Auflösung wird die Priorität in der folgenden Reihenfolge angegeben:
- Dateiformat
- Video-Codec
- Audiocodec
void QMediaFormat::setAudioCodec(QMediaFormat::AudioCodec codec)
Setzt den Audiocodec auf codec.
Hinweis: Setter-Funktion für die Eigenschaft audioCodec.
Siehe auch audioCodec() und QMediaFormat::AudioCodec.
void QMediaFormat::setVideoCodec(QMediaFormat::VideoCodec codec)
Setzt den Videocodec auf codec.
Hinweis: Setter-Funktion für die Eigenschaft videoCodec.
Siehe auch videoCodec() und QMediaFormat::VideoCodec.
[invokable]
QList<QMediaFormat::AudioCodec> QMediaFormat::supportedAudioCodecs(QMediaFormat::ConversionMode m)
Liefert eine Liste von Audio-Codecs für das gewählte Dateiformat und den Video-Codec (m).
Um alle unterstützten Audiocodecs zu erhalten, führen Sie diese Abfrage auf einer standardmäßig konstruierten QMediaFormat aus.
Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.
Siehe auch QMediaFormat::ConversionMode.
[invokable]
QList<QMediaFormat::FileFormat> QMediaFormat::supportedFileFormats(QMediaFormat::ConversionMode m)
Gibt eine Liste von Dateiformaten für den durch m angegebenen Audio- und Videocodec zurück.
Um alle unterstützten Dateiformate zu erhalten, führen Sie diese Abfrage auf einem standardmäßig konstruierten QMediaFormat aus.
Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus 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 gewählte Dateiformat und den Audio-Codec zurück (m).
Um alle unterstützten Videocodecs zu erhalten, führen Sie diese Abfrage für ein standardmäßig konstruiertes MediaFormat aus.
Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.
Siehe auch QMediaFormat::ConversionMode.
[noexcept]
void QMediaFormat::swap(QMediaFormat &other)
Tauscht das Medienformat mit other aus.
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 Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.
[static invokable]
QString QMediaFormat::videoCodecName(QMediaFormat::VideoCodec codec)
Gibt einen stringbasierten Namen für codec zurück.
Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus 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 mit dem aktuellen Medienformat übereinstimmt, andernfalls wird false
zurückgegeben.
© 2025 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.