QMediaCaptureSession#
The QMediaCaptureSession
class allows capturing of audio and video content. More…
New in version 6.1.
Synopsis#
Properties#
camera
- Used to capture videoimageCapture
- The object used to capture still imagesrecorder
- Object used to capture audio/videoscreenCapture
- Object used to capture a screenwindowCapture
- Object used to capture a window
Functions#
def
audioInput
()def
audioOutput
()def
camera
()def
imageCapture
()def
recorder
()def
screenCapture
()def
setAudioInput
(input)def
setAudioOutput
(output)def
setCamera
(camera)def
setImageCapture
(imageCapture)def
setRecorder
(recorder)def
setScreenCapture
(screenCapture)def
setVideoOutput
(output)def
setVideoSink
(sink)def
setWindowCapture
(windowCapture)def
videoOutput
()def
videoSink
()def
windowCapture
()
Signals#
def
audioInputChanged
()def
audioOutputChanged
()def
cameraChanged
()def
imageCaptureChanged
()def
recorderChanged
()def
screenCaptureChanged
()def
videoOutputChanged
()def
windowCaptureChanged
()
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
.
See also
QCamera
QAudioDevice
QMediaRecorder
QImageCapture
QScreenCapture
QWindowCapture
QMediaRecorder
QGraphicsVideoItem
- class PySide6.QtMultimedia.QMediaCaptureSession([parent=None])#
- Parameters:
parent –
PySide6.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:
audioInput
()setAudioInput
(input)Signal
audioInputChanged
()
- property PᅟySide6.QtMultimedia.QMediaCaptureSession.audioOutput: PySide6.QtMultimedia.QAudioOutput#
Returns the audio output for the session.
- Access functions:
audioOutput
()setAudioOutput
(output)Signal
audioOutputChanged
()
- 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:
camera
()setCamera
(camera)Signal
cameraChanged
()
- 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:
imageCapture
()setImageCapture
(imageCapture)Signal
imageCaptureChanged
()
- 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:
recorder
()setRecorder
(recorder)Signal
recorderChanged
()
- 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:
setScreenCapture
(screenCapture)Signal
screenCaptureChanged
()
- property PᅟySide6.QtMultimedia.QMediaCaptureSession.videoOutput: PySide6.QtCore.QObject#
Returns the video output for the session.
- Access functions:
videoOutput
()setVideoOutput
(output)Signal
videoOutputChanged
()
- 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:
setWindowCapture
(windowCapture)Signal
windowCaptureChanged
()
- PySide6.QtMultimedia.QMediaCaptureSession.audioInput()#
- Return type:
See also
Getter of property audioInput
.
- PySide6.QtMultimedia.QMediaCaptureSession.audioInputChanged()#
Notification signal of property audioInput
.
- PySide6.QtMultimedia.QMediaCaptureSession.audioOutput()#
- Return type:
See also
Getter of property audioOutput
.
- PySide6.QtMultimedia.QMediaCaptureSession.audioOutputChanged()#
Notification signal of property audioOutput
.
- PySide6.QtMultimedia.QMediaCaptureSession.camera()#
- Return type:
See also
Getter of property camera
.
- PySide6.QtMultimedia.QMediaCaptureSession.cameraChanged()#
Notification signal of property camera
.
- PySide6.QtMultimedia.QMediaCaptureSession.imageCapture()#
- Return type:
See also
Getter of property imageCapture
.
- PySide6.QtMultimedia.QMediaCaptureSession.imageCaptureChanged()#
Notification signal of property imageCapture
.
- PySide6.QtMultimedia.QMediaCaptureSession.recorder()#
- Return type:
See also
Getter of property recorder
.
- PySide6.QtMultimedia.QMediaCaptureSession.recorderChanged()#
Notification signal of property recorder
.
- PySide6.QtMultimedia.QMediaCaptureSession.screenCapture()#
- Return type:
See also
Getter of property screenCapture
.
- PySide6.QtMultimedia.QMediaCaptureSession.screenCaptureChanged()#
Notification signal of property screenCapture
.
- PySide6.QtMultimedia.QMediaCaptureSession.setAudioInput(input)#
- Parameters:
input –
PySide6.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
Setter of property audioInput
.
- PySide6.QtMultimedia.QMediaCaptureSession.setAudioOutput(output)#
- Parameters:
output –
PySide6.QtMultimedia.QAudioOutput
Sets the audio output device to output
.
Setting an audio output device enables audio routing from an audio input device.
See also
Setter of property audioOutput
.
- PySide6.QtMultimedia.QMediaCaptureSession.setCamera(camera)#
- Parameters:
camera –
PySide6.QtMultimedia.QCamera
See also
Setter of property camera
.
- PySide6.QtMultimedia.QMediaCaptureSession.setImageCapture(imageCapture)#
- Parameters:
imageCapture –
PySide6.QtMultimedia.QImageCapture
See also
Setter of property imageCapture
.
- PySide6.QtMultimedia.QMediaCaptureSession.setRecorder(recorder)#
- Parameters:
recorder –
PySide6.QtMultimedia.QMediaRecorder
See also
Setter of property recorder
.
- PySide6.QtMultimedia.QMediaCaptureSession.setScreenCapture(screenCapture)#
- Parameters:
screenCapture –
PySide6.QtMultimedia.QScreenCapture
See also
Setter of property screenCapture
.
- PySide6.QtMultimedia.QMediaCaptureSession.setVideoOutput(output)#
- Parameters:
output –
PySide6.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
Setter of property videoOutput
.
- 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 videoSink()
method that returns a QVideoSink
.
The previously set preview is detached.
See also
- PySide6.QtMultimedia.QMediaCaptureSession.setWindowCapture(windowCapture)#
- Parameters:
windowCapture –
PySide6.QtMultimedia.QWindowCapture
See also
Setter of property windowCapture
.
- PySide6.QtMultimedia.QMediaCaptureSession.videoOutput()#
- Return type:
See also
Getter of property videoOutput
.
- PySide6.QtMultimedia.QMediaCaptureSession.videoOutputChanged()#
Notification signal of property videoOutput
.
- PySide6.QtMultimedia.QMediaCaptureSession.videoSink()#
- Return type:
Returns the QVideoSink
for the session.
See also
- PySide6.QtMultimedia.QMediaCaptureSession.windowCapture()#
- Return type:
See also
Getter of property windowCapture
.
- PySide6.QtMultimedia.QMediaCaptureSession.windowCaptureChanged()#
Notification signal of property windowCapture
.