CameraRecorder QML Type

Controls video recording with the Camera. 更多...

导入语句: import QtMultimedia 5.8

特性

方法

详细描述

CameraRecorder allows recording camera streams to files, and adjusting recording settings and metadata for videos.

It should not be constructed separately, instead the videoRecorder property of a Camera should be used.

Camera {
    videoRecorder.audioEncodingMode: CameraRecorder.ConstantBitrateEncoding;
    videoRecorder.audioBitRate: 128000
    videoRecorder.mediaContainer: "mp4"
    // ...
}
					

There are many different settings for each part of the recording process (audio, video, and output formats), as well as control over muting and where to store the output file.

另请参阅 QAudioEncoderSettings and QVideoEncoderSettings .

特性文档编制

actualLocation : string

This property holds the actual location of the last saved media content. The actual location is usually available after the recording starts, and reset when new location is set or the new recording starts.


audioBitRate : int

This property holds the audio bit rate (in bits per second) to be used for recording video.


audioChannels : int

This property indicates the number of audio channels to be encoded while recording video (1 is mono, 2 is stereo).


audioCodec : string

This property holds the audio codec to be used for recording video. Typically this is aac or amr-wb .

另请参阅 whileBalanceMode .


audioEncodingMode : enumeration

The type of encoding method to use when recording audio.

描述
ConstantQualityEncoding Encoding will aim to have a constant quality, adjusting bitrate to fit. This is the default. The bitrate setting will be ignored.
ConstantBitRateEncoding Encoding will use a constant bit rate, adjust quality to fit. This is appropriate if you are trying to optimize for space.
AverageBitRateEncoding Encoding will try to keep an average bitrate setting, but will use more or less as needed.

audioSampleRate : int

This property holds the sample rate to be used to encode audio while recording video.


duration : int

This property holds the duration (in miliseconds) of the last recording.


errorCode : enumeration

此特性保持最后错误代码。

描述
NoError No Errors
ResourceError Device is not ready or not available.
FormatError Current format is not supported.
OutOfSpaceError No space left on device.

errorString : string

This property holds the description of the last error.


frameRate : qreal

This property holds the framerate (in frames per second) to be used for recording video.


mediaContainer : string

This property holds the media container to be used for recording video. Typically this is mp4 .


muted : bool

This property indicates whether the audio input is muted during recording.


outputLocation : string

This property holds the destination location of the media content. If the location is empty, the recorder uses the system-specific place and file naming scheme.


recorderState : enumeration

This property holds the current state of the camera recorder object.

The state can be one of these two:

描述
StoppedState The camera is not recording video.
RecordingState The camera is recording video.

recorderStatus : enumeration

This property holds the current status of media recording.

描述
UnavailableStatus Recording is not supported by the camera.
UnloadedStatus The recorder is available but not loaded.
LoadingStatus The recorder is initializing.
LoadedStatus The recorder is initialized and ready to record media.
StartingStatus Recording is requested but not active yet.
RecordingStatus Recording is active.
PausedStatus Recording is paused.
FinalizingStatus Recording is stopped with media being finalized.

resolution : size

This property holds the video frame dimensions to be used for video capture.


videoBitRate : int

This property holds the bit rate (in bits per second) to be used for recording video.


videoCodec : string

This property holds the video codec to be used for recording video. Typically this is h264 .


videoEncodingMode : enumeration

This property holds the type of encoding method to be used for recording video.

The following are the different encoding methods used:

描述
ConstantQualityEncoding Encoding will aim to have a constant quality, adjusting bitrate to fit. This is the default. The bitrate setting will be ignored.
ConstantBitRateEncoding Encoding will use a constant bit rate, adjust quality to fit. This is appropriate if you are trying to optimize for space.
AverageBitRateEncoding Encoding will try to keep an average bitrate setting, but will use more or less as needed.

方法文档编制

record ()

Starts recording.


setMetadata ( key , value )

Sets metadata for the next video to be recorder, with the given key being associated with value .


stop ()

停止录制。