CaptureSession QML Type
允许捕捉音频和视频内容。更多
Import Statement: | import QtMultimedia |
In C++: | QMediaCaptureSession |
属性
- audioInput : AudioInput
- audioOutput : AudioOutput
- camera : Camera
- imageCapture : ImageCapture
- recorder : MediaRecorder
- screenCapture : ScreenCapture
(since 6.5)
- videoOutput : VideoOutput
- windowCapture : WindowCapture
(since 6.6)
信号
- audioInputChanged()
- audioOutputChanged()
- cameraChanged()
- imageCaptureChanged()
- recorderChanged()
- videoOutputChanged()
详细说明
这是管理本地设备上媒体捕获的中心类型。
通过为相关属性分配摄像头和AudioInput 对象,可将摄像头和麦克风连接到 CaptureSession。
将ScreenCapture 对象连接到screenCapture 属性,即可捕捉屏幕。
将WindowCapture 对象连接到windowCapture 属性,即可捕获窗口。
将VideoOutput 元素分配给videoOutput 属性,以启用捕获媒体的预览。
通过将AudioOutput 对象指定给audioOutput 属性,将音频路由到输出设备。
通过为imageCapture 属性分配ImageCapture ,从摄像头捕捉静态图像。
通过将MediaRecorder 分配给录音机属性来录制音频/视频。
CaptureSession { id: captureSession camera: Camera { id: camera } imageCapture: ImageCapture { id: imageCapture } recorder: MediaRecorder { id: recorder } videoOutput: preview }
另请参阅 Camera,MediaDevices,MediaRecorder,ImageCapture,ScreenCapture,WindowCapture,AudioInput 和VideoOutput 。
属性文档
audioInput : AudioInput |
该属性包含用于捕获音频的音频输入。
audioOutput : AudioOutput |
捕获会话的音频输出设备。
将AudioOutput 设备添加到捕获会话,以启用来自AudioInput 设备的音频路由。
camera : Camera |
用于采集视频的摄像头。
使用此属性将摄像机添加到捕获会话,以录制视频或拍摄图像。
imageCapture : ImageCapture |
用于捕捉静态图像的对象。
将ImageCapture 接口添加到捕捉会话,以便从摄像机捕捉静态图像。
recorder : MediaRecorder |
用于捕捉音频/视频的记录器对象。
为捕获会话添加一个 MediaRcorder 对象,以便从捕获会话中录制音频和/或视频。
screenCapture : ScreenCapture |
用于捕捉屏幕的对象。
使用此属性向捕获会话添加屏幕捕获对象,从而记录屏幕。
此属性在 Qt 6.5 中引入。
videoOutput : VideoOutput |
作为捕获会话视频预览的VideoOutput 。
基于VideoOutput 的预览预计会有一个可调用的 videoSink() 方法,该方法会返回一个QVideoSink 。
先前设置的预览将被分离。
windowCapture : WindowCapture |
用于捕捉窗口的对象。
使用此属性将窗口捕获对象添加到捕获会话中,从而记录窗口。
此属性在 Qt 6.6 中引入。
信号文档
audioInputChanged() |
audioOutputChanged() |
cameraChanged() |
imageCaptureChanged() |
recorderChanged() |
videoOutputChanged() |
© 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.