QMediaCaptureSession¶
The QMediaCaptureSession
class allows capturing of audio and video content. More…
New in version 6.1.
Synopsis¶
Functions¶
def
audioInput
()def
audioOutput
()def
camera
()def
imageCapture
()def
recorder
()def
setAudioInput
(input)def
setAudioOutput
(output)def
setCamera
(camera)def
setImageCapture
(imageCapture)def
setRecorder
(recorder)def
setVideoOutput
(output)def
setVideoSink
(sink)def
videoOutput
()def
videoSink
()
Signals¶
def
audioInputChanged
()def
audioOutputChanged
()def
cameraChanged
()def
imageCaptureChanged
()def
recorderChanged
()def
videoOutputChanged
()
Detailed Description¶
The QMediaCaptureSession
is the central class that manages capturing of media on the local device.
You can connect a camera and a microphone to QMediaCaptureSession
using setCamera()
and setAudioInput()
. A preview of the captured media can be seen by setting a QVideoSink
of QVideoWidget
using setVideoOutput()
and heard by routing the audio to an output device using setAudioOutput()
.
You can capture still images from a camera by setting a QImageCapture
object on the capture session, and record audio/video using a QMediaRecorder
.
- class PySide6.QtMultimedia.QMediaCaptureSession([parent=None])¶
- Parameters
parent –
PySide6.QtCore.QObject
Creates a session for media capture from the parent
object.
- PySide6.QtMultimedia.QMediaCaptureSession.audioInput()¶
- Return type
- PySide6.QtMultimedia.QMediaCaptureSession.audioInputChanged()¶
- PySide6.QtMultimedia.QMediaCaptureSession.audioOutput()¶
- Return type
- PySide6.QtMultimedia.QMediaCaptureSession.audioOutputChanged()¶
- PySide6.QtMultimedia.QMediaCaptureSession.camera()¶
- Return type
This property holds The camera used to capture video..
Record video or take images by adding a camera to the capture session using this property,
- PySide6.QtMultimedia.QMediaCaptureSession.cameraChanged()¶
- PySide6.QtMultimedia.QMediaCaptureSession.imageCapture()¶
- Return type
This property holds the object used to capture still images..
Add a QImageCapture
object to the capture session to enable capturing of still images from the camera.
- PySide6.QtMultimedia.QMediaCaptureSession.imageCaptureChanged()¶
- PySide6.QtMultimedia.QMediaCaptureSession.recorder()¶
- Return type
This property holds The recorder object used to capture audio/video..
Add a QMediaRecorder
object to the capture session to enable recording of audio and/or video from the capture session.
- PySide6.QtMultimedia.QMediaCaptureSession.recorderChanged()¶
- PySide6.QtMultimedia.QMediaCaptureSession.setAudioInput(input)¶
- Parameters
input –
PySide6.QtMultimedia.QAudioInput
- PySide6.QtMultimedia.QMediaCaptureSession.setAudioOutput(output)¶
- Parameters
output –
PySide6.QtMultimedia.QAudioOutput
- PySide6.QtMultimedia.QMediaCaptureSession.setCamera(camera)¶
- Parameters
camera –
PySide6.QtMultimedia.QCamera
This property holds The camera used to capture video..
Record video or take images by adding a camera to the capture session using this property,
- PySide6.QtMultimedia.QMediaCaptureSession.setImageCapture(imageCapture)¶
- Parameters
imageCapture –
PySide6.QtMultimedia.QImageCapture
This property holds the object used to capture still images..
Add a QImageCapture
object to the capture session to enable capturing of still images from the camera.
- PySide6.QtMultimedia.QMediaCaptureSession.setRecorder(recorder)¶
- Parameters
recorder –
PySide6.QtMultimedia.QMediaRecorder
This property holds The recorder object used to capture audio/video..
Add a QMediaRecorder
object to the capture session to enable recording of audio and/or video from the capture session.
- PySide6.QtMultimedia.QMediaCaptureSession.setVideoOutput(output)¶
- Parameters
output –
PySide6.QtCore.QObject
- PySide6.QtMultimedia.QMediaCaptureSession.setVideoSink(sink)¶
- Parameters
Sets a QVideoSink
, (sink
), to a video preview for the capture session.
A QObject
based preview is expected to have an invokable method that returns a QVideoSink
.
The previously set preview is detached.
- PySide6.QtMultimedia.QMediaCaptureSession.videoOutput()¶
- Return type
- PySide6.QtMultimedia.QMediaCaptureSession.videoOutputChanged()¶
- PySide6.QtMultimedia.QMediaCaptureSession.videoSink()¶
- Return type
© 2022 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.