QVideoEncoderSettings 类

QVideoEncoderSettings 类提供一组视频编码器设置。 更多...

头: #include <QVideoEncoderSettings>
qmake: QT += multimedia

公共函数

QVideoEncoderSettings (const QVideoEncoderSettings & other )
QVideoEncoderSettings ()
QVideoEncoderSettings & operator= (const QVideoEncoderSettings & other )
~QVideoEncoderSettings ()
int bitRate () const
QString codec () const
QMultimedia::EncodingMode encodingMode () const
QVariant encodingOption (const QString & option ) const
QVariantMap encodingOptions () const
qreal frameRate () const
bool isNull () const
QMultimedia::EncodingQuality quality () const
QSize resolution () const
void setBitRate (int value )
void setCodec (const QString & codec )
void setEncodingMode (QMultimedia::EncodingMode mode )
void setEncodingOption (const QString & option , const QVariant & value )
void setEncodingOptions (const QVariantMap & options )
void setFrameRate (qreal rate )
void setQuality (QMultimedia::EncodingQuality quality )
void setResolution (const QSize & resolution )
void setResolution (int width , int height )
bool operator!= (const QVideoEncoderSettings & other ) const
bool operator== (const QVideoEncoderSettings & other ) const

详细描述

视频编码器设置对象用于指定视频编码器设置使用通过 QMediaRecorder . Video encoder settings are selected by constructing a QVideoEncoderSettings object, setting the desired properties and then passing it to a QMediaRecorder instance using the QMediaRecorder::setEncodingSettings () 函数。

QVideoEncoderSettings videoSettings;
videoSettings.setCodec("video/mpeg2");
videoSettings.setResolution(640, 480);
recorder->setVideoSettings(videoSettings);
					

另请参阅 QMediaRecorder and QVideoEncoderSettingsControl .

成员函数文档编制

QVideoEncoderSettings:: QVideoEncoderSettings (const QVideoEncoderSettings & other )

Constructs a copy of the video encoder settings object other .

QVideoEncoderSettings:: QVideoEncoderSettings ()

Constructs a null video encoder settings object.

QVideoEncoderSettings &QVideoEncoderSettings:: operator= (const QVideoEncoderSettings & other )

Assigns the value of other to a video encoder settings object.

QVideoEncoderSettings:: ~QVideoEncoderSettings ()

Destroys a video encoder settings object.

int QVideoEncoderSettings:: bitRate () const

Returns bit rate of the encoded video stream in bits per second.

另请参阅 setBitRate ().

QString QVideoEncoderSettings:: codec () const

Returns the video codec.

另请参阅 setCodec ().

QMultimedia::EncodingMode QVideoEncoderSettings:: encodingMode () const

返回视频编码模式。

另请参阅 setEncodingMode () 和 QMultimedia::EncodingMode .

QVariant QVideoEncoderSettings:: encodingOption (const QString & option ) const

返回值为编码 option .

另请参阅 setEncodingOption () 和 encodingOptions ().

QVariantMap QVideoEncoderSettings:: encodingOptions () const

返回所有编码选项按 QVariantMap .

另请参阅 encodingOption () 和 setEncodingOptions ().

qreal QVideoEncoderSettings:: frameRate () const

返回视频帧速率。

另请参阅 setFrameRate ().

bool QVideoEncoderSettings:: isNull () const

Identifies if a video encoder settings object is uninitalized.

Returns true if the settings are null, and false if they are not.

QMultimedia::EncodingQuality QVideoEncoderSettings:: quality () const

返回视频编码品质。

另请参阅 setQuality ().

QSize QVideoEncoderSettings:: resolution () const

Returns the resolution of the encoded video.

另请参阅 setResolution ().

void QVideoEncoderSettings:: setBitRate ( int value )

Sets the bit rate of the encoded video stream to value .

另请参阅 bitRate ().

void QVideoEncoderSettings:: setCodec (const QString & codec )

设置视频 codec .

另请参阅 codec ().

void QVideoEncoderSettings:: setEncodingMode ( QMultimedia::EncodingMode mode )

Sets the video encoding mode .

QMultimedia::ConstantQualityEncoding is set, the quality encoding parameter is used and bit rate is ignored, otherwise the bitrate is used.

The rest of encoding settings are respected regardless of encoding mode.

另请参阅 encodingMode () 和 QMultimedia::EncodingMode .

void QVideoEncoderSettings:: setEncodingOption (const QString & option , const QVariant & value )

设置编码 option value .

The supported set and meaning of encoding options are system and selected codec specific.

另请参阅 encodingOption () 和 setEncodingOptions ().

void QVideoEncoderSettings:: setEncodingOptions (const QVariantMap & options )

Replace all the encoding options with options .

The supported set and meaning of encoding options are system and selected codec specific.

另请参阅 encodingOptions (), encodingOption (),和 setEncodingOption ().

void QVideoEncoderSettings:: setFrameRate ( qreal rate )

Sets the video frame rate .

A value of 0 indicates the encoder should make an optimal choice based on what is available from the video source and the limitations of the codec.

另请参阅 frameRate ().

void QVideoEncoderSettings:: setQuality ( QMultimedia::EncodingQuality quality )

Sets the video encoding quality .

Setting the video quality parameter allows backend to choose the balanced set of encoding parameters to achieve the desired quality level.

The quality settings parameter is only used in the constant quality encoding mode quality settings parameter is only used in the constant quality encoding mode .

另请参阅 quality ().

void QVideoEncoderSettings:: setResolution (const QSize & resolution )

设置 resolution of the encoded video.

QSize indicates the encoder should make an optimal choice based on what is available from the video source and the limitations of the codec.

另请参阅 resolution ().

void QVideoEncoderSettings:: setResolution ( int width , int height )

设置 width and height of the resolution of the encoded video.

这是重载函数。

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

Determines if other is of equal value to a video encoder settings object.

Returns true if the settings objects are not of equal value, and false if they are of equal value.

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

Determines if other is of equal value to a video encoder settings object.

Returns true if the settings objects are of equal value, and false if they are not of equal value.