QMediaCaptureSession

The QMediaCaptureSession class allows capturing of audio and video content. More

Inheritance diagram of PySide6.QtMultimedia.QMediaCaptureSession

New in version 6.1.

Synopsis

Functions

Signals

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

parentPySide6.QtCore.QObject

Creates a session for media capture from the parent object.

PySide6.QtMultimedia.QMediaCaptureSession.audioInput()
Return type

PySide6.QtMultimedia.QAudioInput

PySide6.QtMultimedia.QMediaCaptureSession.audioInputChanged()
PySide6.QtMultimedia.QMediaCaptureSession.audioOutput()
Return type

PySide6.QtMultimedia.QAudioOutput

PySide6.QtMultimedia.QMediaCaptureSession.audioOutputChanged()
PySide6.QtMultimedia.QMediaCaptureSession.camera()
Return type

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.cameraChanged()
PySide6.QtMultimedia.QMediaCaptureSession.imageCapture()
Return type

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.imageCaptureChanged()
PySide6.QtMultimedia.QMediaCaptureSession.recorder()
Return type

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.recorderChanged()
PySide6.QtMultimedia.QMediaCaptureSession.setAudioInput(input)
Parameters

inputPySide6.QtMultimedia.QAudioInput

PySide6.QtMultimedia.QMediaCaptureSession.setAudioOutput(output)
Parameters

outputPySide6.QtMultimedia.QAudioOutput

PySide6.QtMultimedia.QMediaCaptureSession.setCamera(camera)
Parameters

cameraPySide6.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

imageCapturePySide6.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

recorderPySide6.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

outputPySide6.QtCore.QObject

PySide6.QtMultimedia.QMediaCaptureSession.setVideoSink(sink)
Parameters

sinkPySide6.QtMultimedia.QVideoSink

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.QtCore.QObject

PySide6.QtMultimedia.QMediaCaptureSession.videoOutputChanged()
PySide6.QtMultimedia.QMediaCaptureSession.videoSink()
Return type

PySide6.QtMultimedia.QVideoSink