CaptureSession QML 類型

允許捕獲音頻/視頻內容。 更多...

import 語句: import QtMultimedia
在 C++: QMediaCaptureSession

特性

信號

詳細描述

This is the central type that manages capturing of media on the local device.

Connect a camera and a microphone to a CaptureSession by assigning Camera and AudioInput objects to the relevant properties.

捕獲屏幕通過連接 ScreenCapture 對象到 screenCapture 特性。

捕獲窗口通過連接 WindowCapture 對象到 windowCapture 特性。

Enable a preview of the captured media by assigning a VideoOutput element to the videoOutput 特性。

Route audio to an output device by assigning an AudioOutput 對象到 audioOutput 特性。

Capture still images from a camera by assigning an ImageCapture imageCapture 特性。

錄製音頻/視頻通過賦值 MediaRecorder 到錄製器特性。

CaptureSession {
    id: captureSession
    camera: Camera {
        id: camera
    }
    imageCapture: ImageCapture {
        id: imageCapture
    }
    recorder: MediaRecorder {
        id: recorder
    }
    videoOutput: preview
    Component.onCompleted: {
        camera.start()
    }
}
					

注意: To ensure the camera starts capturing video frames on all platforms, explicitly call camera.start(), typically in the Component.onCompleted handler.

另請參閱 Camera , MediaDevices , MediaRecorder , ImageCapture , ScreenCapture , WindowCapture , AudioInput ,和 VideoOutput .

特性文檔編製

audioInput : AudioInput

This property holds the audio input that is being used to capture audio.

audioOutput : AudioOutput

The audio output device for the capture session.

添加 AudioOutput device to the capture session to enable audio routing from an AudioInput 設備。

camera : Camera

用於捕獲視頻的攝像頭。

Record video or take images by adding a camera to the capture session using this property.

imageCapture : ImageCapture

The object used to capture still images.

添加 ImageCapture interface to the capture session to enable capturing of still images from the camera.

recorder : MediaRecorder

The recorder object used to capture audio/video.

Add a MediaRcorder object to the capture session to enable recording of audio and/or video from the capture session.

screenCapture : ScreenCapture [since 6.5]

用於捕獲屏幕的對象。

Record a screen by adding a screen capture objet to the capture session using this property.

該特性在 Qt 6.5 引入。

videoOutput : VideoOutput

The VideoOutput that is the video preview for the capture session.

A VideoOutput based preview is expected to have an invokable videoSink() method that returns a QVideoSink .

先前設置的預覽被分離。

windowCapture : WindowCapture [since 6.6]

The object used to capture a window.

Record a window by adding a window capture object to the capture session using this property.

該特性在 Qt 6.6 引入。

信號文檔編製

audioInputChanged ()

This signal is emitted when an audio input has changed.

注意: 相應處理程序是 onAudioInputChanged .

另請參閱 CaptureSession::audioInput .

audioOutputChanged ()

This signal is emitted when the selected audio output has changed.

注意: 相應處理程序是 onAudioOutputChanged .

另請參閱 CaptureSession::audioOutput .

cameraChanged ()

This signal is emitted when the selected camera has changed.

注意: 相應處理程序是 onCameraChanged .

另請參閱 CaptureSession::camera .

imageCaptureChanged ()

This signal is emitted when the selected interface has changed.

注意: 相應處理程序是 onImageCaptureChanged .

另請參閱 CaptureSession::camera .

recorderChanged ()

This signal is emitted when the selected recorder has changed.

注意: 相應處理程序是 onRecorderChanged .

另請參閱 CaptureSession::recorder .

videoOutputChanged ()

This signal is emitted when the selected video output has changed.

注意: 相應處理程序是 onVideoOutputChanged .

另請參閱 CaptureSession::videoOutput .