QMediaCaptureSession#

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

Inheritance diagram of PySide6.QtMultimedia.QMediaCaptureSession

New in version 6.1.

Synopsis#

Properties#

Functions#

Signals#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

The QMediaCaptureSession is the central class that manages capturing of media on the local device.

You can connect a video input to QMediaCaptureSession using setCamera() , setScreenCapture() or setWindowCapture() . A preview of the captured media can be seen by setting a QVideoWidget or QGraphicsVideoItem using setVideoOutput() .

You can connect a microphone to QMediaCaptureSession using setAudioInput() . The captured sound can be 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.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.QtMultimedia.QMediaCaptureSession.audioInput: PySide6.QtMultimedia.QAudioInput#

Returns the device that is being used to capture audio.

Access functions:
property PᅟySide6.QtMultimedia.QMediaCaptureSession.audioOutput: PySide6.QtMultimedia.QAudioOutput#

Returns the audio output for the session.

Access functions:
property PᅟySide6.QtMultimedia.QMediaCaptureSession.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.

Access functions:
property PᅟySide6.QtMultimedia.QMediaCaptureSession.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.

Access functions:
property PᅟySide6.QtMultimedia.QMediaCaptureSession.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.

Access functions:
property PᅟySide6.QtMultimedia.QMediaCaptureSession.screenCapture: PySide6.QtMultimedia.QScreenCapture#

This property holds The object used to capture a screen..

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

Access functions:
property PᅟySide6.QtMultimedia.QMediaCaptureSession.videoOutput: PySide6.QtCore.QObject#

Returns the video output for the session.

Access functions:
property PᅟySide6.QtMultimedia.QMediaCaptureSession.windowCapture: PySide6.QtMultimedia.QWindowCapture#

This property holds The object used to capture a window..

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

Access functions:
PySide6.QtMultimedia.QMediaCaptureSession.audioInput()#
Return type:

PySide6.QtMultimedia.QAudioInput

See also

setAudioInput()

Getter of property audioInput .

PySide6.QtMultimedia.QMediaCaptureSession.audioInputChanged()#

Notification signal of property audioInput .

PySide6.QtMultimedia.QMediaCaptureSession.audioOutput()#
Return type:

PySide6.QtMultimedia.QAudioOutput

See also

setAudioOutput()

Getter of property audioOutput .

PySide6.QtMultimedia.QMediaCaptureSession.audioOutputChanged()#

Notification signal of property audioOutput .

PySide6.QtMultimedia.QMediaCaptureSession.camera()#
Return type:

PySide6.QtMultimedia.QCamera

See also

setCamera()

Getter of property camera .

PySide6.QtMultimedia.QMediaCaptureSession.cameraChanged()#

Notification signal of property camera .

PySide6.QtMultimedia.QMediaCaptureSession.imageCapture()#
Return type:

PySide6.QtMultimedia.QImageCapture

Getter of property imageCapture .

PySide6.QtMultimedia.QMediaCaptureSession.imageCaptureChanged()#

Notification signal of property imageCapture .

PySide6.QtMultimedia.QMediaCaptureSession.recorder()#
Return type:

PySide6.QtMultimedia.QMediaRecorder

See also

setRecorder()

Getter of property recorder .

PySide6.QtMultimedia.QMediaCaptureSession.recorderChanged()#

Notification signal of property recorder .

PySide6.QtMultimedia.QMediaCaptureSession.screenCapture()#
Return type:

PySide6.QtMultimedia.QScreenCapture

Getter of property screenCapture .

PySide6.QtMultimedia.QMediaCaptureSession.screenCaptureChanged()#

Notification signal of property screenCapture .

PySide6.QtMultimedia.QMediaCaptureSession.setAudioInput(input)#
Parameters:

inputPySide6.QtMultimedia.QAudioInput

Sets the audio input device to input. If setting it to an empty QAudioDevice the capture session will use the default input as defined by the operating system.

See also

audioInput()

Setter of property audioInput .

PySide6.QtMultimedia.QMediaCaptureSession.setAudioOutput(output)#
Parameters:

outputPySide6.QtMultimedia.QAudioOutput

Sets the audio output device to output.

Setting an audio output device enables audio routing from an audio input device.

See also

audioOutput()

Setter of property audioOutput .

PySide6.QtMultimedia.QMediaCaptureSession.setCamera(camera)#
Parameters:

cameraPySide6.QtMultimedia.QCamera

See also

camera()

Setter of property camera .

PySide6.QtMultimedia.QMediaCaptureSession.setImageCapture(imageCapture)#
Parameters:

imageCapturePySide6.QtMultimedia.QImageCapture

See also

imageCapture()

Setter of property imageCapture .

PySide6.QtMultimedia.QMediaCaptureSession.setRecorder(recorder)#
Parameters:

recorderPySide6.QtMultimedia.QMediaRecorder

See also

recorder()

Setter of property recorder .

PySide6.QtMultimedia.QMediaCaptureSession.setScreenCapture(screenCapture)#
Parameters:

screenCapturePySide6.QtMultimedia.QScreenCapture

See also

screenCapture()

Setter of property screenCapture .

PySide6.QtMultimedia.QMediaCaptureSession.setVideoOutput(output)#
Parameters:

outputPySide6.QtCore.QObject

Sets a QObject, (output), to a video preview for the capture session.

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

The previously set preview is detached.

See also

videoOutput()

Setter of property videoOutput .

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 videoSink() method that returns a QVideoSink .

The previously set preview is detached.

See also

videoSink()

PySide6.QtMultimedia.QMediaCaptureSession.setWindowCapture(windowCapture)#
Parameters:

windowCapturePySide6.QtMultimedia.QWindowCapture

See also

windowCapture()

Setter of property windowCapture .

PySide6.QtMultimedia.QMediaCaptureSession.videoOutput()#
Return type:

PySide6.QtCore.QObject

See also

setVideoOutput()

Getter of property videoOutput .

PySide6.QtMultimedia.QMediaCaptureSession.videoOutputChanged()#

Notification signal of property videoOutput .

PySide6.QtMultimedia.QMediaCaptureSession.videoSink()#
Return type:

PySide6.QtMultimedia.QVideoSink

Returns the QVideoSink for the session.

See also

setVideoSink()

PySide6.QtMultimedia.QMediaCaptureSession.windowCapture()#
Return type:

PySide6.QtMultimedia.QWindowCapture

Getter of property windowCapture .

PySide6.QtMultimedia.QMediaCaptureSession.windowCaptureChanged()#

Notification signal of property windowCapture .