QMediaFormat Class

멀티미디어 파일 또는 스트림의 인코딩 형식을 설명합니다. 더 보기...

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

공용 유형

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 }

속성

공용 함수

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

정적 공개 멤버

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)

상세 설명

QMediaFormat은 멀티미디어 파일 또는 스트림의 인코딩 포맷을 설명합니다.

특정 미디어 포맷을 인코딩 또는 디코딩에 사용할 수 있는지 여부를 QMediaFormat을 사용하여 확인할 수 있습니다.

멤버 유형 문서

enum class QMediaFormat::AudioCodec

멀티미디어 파일 또는 스트림에 사용되는 오디오 코덱을 설명합니다.

상수설명
QMediaFormat::AudioCodec::WMA9Windows 미디어 오디오
QMediaFormat::AudioCodec::AC32돌비 디지털
QMediaFormat::AudioCodec::AAC1고급 오디오 코딩
QMediaFormat::AudioCodec::ALAC10Apple 무손실 오디오 코덱
QMediaFormat::AudioCodec::DolbyTrueHD5Dolby TrueHD
QMediaFormat::AudioCodec::EAC33돌비 디지털 플러스(EAC3)
QMediaFormat::AudioCodec::MP30MPEG-1 오디오 레이어 III 또는 MPEG-2 오디오 레이어 III
QMediaFormat::AudioCodec::Wave8파형 오디오 파일 포맷
QMediaFormat::AudioCodec::Vorbis7Ogg Vorbis
QMediaFormat::AudioCodec::FLAC4무료 무손실 오디오 코덱
QMediaFormat::AudioCodec::Opus6오퍼스 오디오 포맷
QMediaFormat::AudioCodec::Unspecified-1지정되지 않은 코덱

enum QMediaFormat::ConversionMode

대부분의 경우 시스템에는 비대칭 기능이 있어 인코딩할 수 있는 것보다 더 많은 형식이나 코덱을 디코딩할 수 있는 경우가 많습니다. 이 열거형은 특정 파일 형식이나 코덱이 지원되는지 여부를 확인할 때 사용할 요청된 변환 모드를 설명합니다.

Constant설명
QMediaFormat::Encode0특정 파일 형식 또는 코덱을 인코딩할 수 있는지 여부를 확인하는 데 사용됩니다.
QMediaFormat::Decode1특정 파일 형식 또는 코덱을 디코딩할 수 있는지 여부를 확인할 때 사용합니다.

supportedFileFormats, supportedAudioCodecs, supportedVideoCodecs참조하세요 .

enum QMediaFormat::FileFormat

멀티미디어 파일 또는 스트림에 사용되는 컨테이너 형식을 설명합니다.

상수설명
QMediaFormat::WMA9Windows 미디어 오디오
QMediaFormat::AAC8고급 오디오 코딩
QMediaFormat::Matroska2마트로스카(MKV)
QMediaFormat::WMV0Windows Media 비디오
QMediaFormat::MP310MPEG-1 오디오 레이어 III 또는 MPEG-2 오디오 레이어 III
QMediaFormat::Wave12파형 오디오 파일 포맷
QMediaFormat::Ogg4Ogg
QMediaFormat::MPEG43MPEG-4
QMediaFormat::AVI1오디오 비디오 인터리브
QMediaFormat::QuickTime5QuickTime
QMediaFormat::WebM6WebM
QMediaFormat::Mpeg4Audio7MPEG-4 파트 3 또는 MPEG-4 오디오(공식 ISO/IEC 14496-3)
QMediaFormat::FLAC11무료 무손실 오디오 코덱
QMediaFormat::UnspecifiedFormat-1형식이 지정되지 않았습니다.

enum QMediaFormat::ResolveFlags

QMediaRecorder 에 적합한 형식을 확인하기 위한 요구 사항을 설명합니다.

Constant설명
QMediaFormat::NoFlags0요구 사항 없음
QMediaFormat::RequiresVideo1비디오 코덱이 필요합니다.

resolveForEncoding()도 참조하세요 .

enum class QMediaFormat::VideoCodec

멀티미디어 파일 또는 스트림에 사용된 비디오 코딩을 설명합니다.

상수설명
QMediaFormat::VideoCodec::VP85VP8
QMediaFormat::VideoCodec::MPEG21MPEG-2
QMediaFormat::VideoCodec::MPEG10MPEG-1
QMediaFormat::VideoCodec::WMV9윈도우 미디어 비디오
QMediaFormat::VideoCodec::H2654고효율 비디오 코딩(HEVC)
QMediaFormat::VideoCodec::H2643고급 비디오 코딩
QMediaFormat::VideoCodec::MPEG42MPEG-4
QMediaFormat::VideoCodec::AV17AOMedia 비디오 1
QMediaFormat::VideoCodec::MotionJPEG10MotionJPEG
QMediaFormat::VideoCodec::VP96VP9
QMediaFormat::VideoCodec::Theora8Theora
QMediaFormat::VideoCodec::Unspecified-1비디오 코덱이 지정되지 않음

속성 문서

audioCodec : AudioCodec

이 프로퍼티에는 미디어의 오디오 코덱이 저장됩니다.

액세스 함수:

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

QMediaFormat::AudioCodec참조하세요 .

fileFormat : FileFormat

이 속성은 미디어의 파일(컨테이너) 형식을 저장합니다.

액세스 함수:

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

QMediaFormat::FileFormat참조하세요 .

videoCodec : VideoCodec

이 속성에는 미디어의 비디오 코덱이 저장됩니다.

액세스 기능:

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

QMediaFormat::VideoCodec참조하세요 .

멤버 함수 문서

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

format 에 대한 QMediaFormat 객체를 생성합니다.

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

other 에서 복사하여 QMediaFormat 객체를 생성합니다.

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

other 에서 이동하여 QMediaFormat 객체를 생성합니다.

[noexcept] QMediaFormat::~QMediaFormat()

QMediaFormat 객체를 삭제합니다.

QMediaFormat::AudioCodec QMediaFormat::audioCodec() const

이 형식에 사용된 오디오 코덱을 반환합니다.

참고: 오디오 코덱 속성에 대한 게터 함수입니다.

setAudioCodec() 및 QMediaFormat::AudioCodec참조하세요 .

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

codec 에 대한 설명을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

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

codec 에 대한 문자열 기반 이름을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

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

fileFormat 에 대한 설명을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

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

fileFormat 에 대한 문자열 기반 이름을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

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

true Qt Multimedia 이 이 형식을 인코딩 또는 디코딩할 수 있는 경우 을 반환합니다. mode

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

QMimeType QMediaFormat::mimeType() const

이 미디어 형식에 사용된 파일 형식의 MIME 유형을 반환합니다.

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

flags 을 기준으로 QMediaRecorder 에서 지원하는 형식으로 형식을 확인합니다.

이 메서드는 지정되지 않은 설정에 대해 가능한 가장 일치하는 형식을 찾으려고 시도합니다. 레코더에서 지원하지 않는 설정은 지원되는 가장 가까운 일치 항목으로 수정됩니다.

확인할 때 다음 순서로 우선순위가 부여됩니다:

  1. 파일 형식
  2. 동영상 코덱
  3. 오디오 코덱

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

오디오 코덱을 codec 로 설정합니다.

참고: 속성에 대한 세터 함수 audioCodec.

audioCodec() 및 QMediaFormat::AudioCodec도 참조하세요 .

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

비디오 코덱을 codec 로 설정합니다.

참고: 속성에 대한 세터 함수 videoCodec.

videoCodec() 및 QMediaFormat::VideoCodec도 참조하세요 .

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

선택한 파일 형식 및 비디오 코덱에 대한 오디오 코덱 목록을 반환합니다(m).

지원되는 모든 오디오 코덱을 가져오려면 기본으로 구성된 QMediaFormat 에서 이 쿼리를 실행하세요.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

QMediaFormat::ConversionMode도 참조하세요 .

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

m 으로 지정된 오디오 및 비디오 코덱의 파일 형식 목록을 반환합니다.

지원되는 모든 파일 형식을 가져오려면 기본적으로 구성된 QMediaFormat 에서 이 쿼리를 실행합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

QMediaFormat::ConversionMode도 참조하세요 .

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

선택한 파일 형식에 대한 비디오 코덱 목록과 오디오 코덱(m)을 반환합니다.

지원되는 모든 비디오 코덱을 가져오려면 기본으로 구성된 MediaFormat에서 이 쿼리를 실행하세요.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

QMediaFormat::ConversionMode참조하세요 .

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

미디어 형식을 other 로 바꿉니다.

QMediaFormat::VideoCodec QMediaFormat::videoCodec() const

이 형식에 사용된 비디오 코덱을 반환합니다.

참고: 비디오 코덱 프로퍼티에 대한 게터 함수입니다.

setVideoCodec() 및 QMediaFormat::VideoCodec참조하세요 .

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

codec 에 대한 설명을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

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

codec 에 대한 문자열 기반 이름을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

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

other 이 현재 미디어 형식과 같지 않으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

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

other 을 이 QMediaFormat 객체로 이동합니다.

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

other 을 이 QMediaFormat 객체에 복사합니다.

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

other 이 현재 미디어 형식과 같으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

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