PySide6.QtMultimedia.QMediaCaptureSession¶
- class QMediaCaptureSession¶
The
QMediaCaptureSession
class allows capturing of audio and video content. More…Added in version 6.1.
Synopsis¶
Properties¶
audioBufferInputᅟ
- Object used to send custom audio buffers to QMediaRecordercameraᅟ
- Used to capture videoimageCaptureᅟ
- The object used to capture still imagesrecorderᅟ
- Object used to capture audio/videoscreenCaptureᅟ
- Object used to capture a screenvideoFrameInputᅟ
- Object used to send custom video frames to QMediaRecorder or a video outputwindowCaptureᅟ
- Object used to capture a window
Methods¶
def
__init__()
def
audioInput()
def
audioOutput()
def
camera()
def
imageCapture()
def
recorder()
def
screenCapture()
def
setAudioInput()
def
setAudioOutput()
def
setCamera()
def
setRecorder()
def
setVideoOutput()
def
setVideoSink()
def
videoOutput()
def
videoSink()
def
windowCapture()
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
usingsetCamera()
,setScreenCapture()
,setWindowCapture()
orsetVideoFrameInput()
. A preview of the captured media can be seen by setting aQVideoWidget
orQGraphicsVideoItem
usingsetVideoOutput()
.You can connect a microphone to
QMediaCaptureSession
usingsetAudioInput()
, or set your custom audio input usingsetAudioBufferInput()
. The captured sound can be heard by routing the audio to an output device usingsetAudioOutput()
.You can capture still images from a camera by setting a
QImageCapture
object on the capture session, and record audio/video using aQMediaRecorder
.Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property audioBufferInputᅟ: QAudioBufferInput¶
This property holds The object used to send custom audio buffers to
QMediaRecorder
..- Access functions:
- property audioInputᅟ: QAudioInput¶
Returns the device that is being used to capture audio.
- Access functions:
- property audioOutputᅟ: QAudioOutput¶
Returns the audio output for the session.
- Access functions:
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:
Signal
cameraChanged()
- property imageCaptureᅟ: 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 recorderᅟ: 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 screenCaptureᅟ: 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 videoFrameInputᅟ: QVideoFrameInput¶
This property holds The object used to send custom video frames to
QMediaRecorder
or a video output..- Access functions:
Returns the video output for the session.
- Access functions:
- property windowCaptureᅟ: 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:
Creates a session for media capture from the
parent
object.- audioBufferInput()¶
- Return type:
See also
Getter of property
audioBufferInputᅟ
.- audioBufferInputChanged()¶
Notification signal of property
audioBufferInputᅟ
.- audioInput()¶
- Return type:
See also
Getter of property
audioInputᅟ
.- audioInputChanged()¶
Notification signal of property
audioInputᅟ
.- audioOutput()¶
- Return type:
See also
Getter of property
audioOutputᅟ
.- audioOutputChanged()¶
Notification signal of property
audioOutputᅟ
.- camera()¶
- Return type:
See also
Getter of property
cameraᅟ
.- cameraChanged()¶
Notification signal of property
cameraᅟ
.- imageCapture()¶
- Return type:
See also
Getter of property
imageCaptureᅟ
.- imageCaptureChanged()¶
Notification signal of property
imageCaptureᅟ
.- recorder()¶
- Return type:
See also
Getter of property
recorderᅟ
.- recorderChanged()¶
Notification signal of property
recorderᅟ
.- screenCapture()¶
- Return type:
See also
Getter of property
screenCaptureᅟ
.- screenCaptureChanged()¶
Notification signal of property
screenCaptureᅟ
.- setAudioBufferInput(input)¶
- Parameters:
input –
QAudioBufferInput
See also
Setter of property
audioBufferInputᅟ
.- setAudioInput(input)¶
- Parameters:
input –
QAudioInput
Sets the audio input device to
input
. If setting it to an emptyQAudioDevice
the capture session will use the default input as defined by the operating system.See also
Setter of property
audioInputᅟ
.- setAudioOutput(output)¶
- Parameters:
output –
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ᅟ
.Setter of property
cameraᅟ
.- setImageCapture(imageCapture)¶
- Parameters:
imageCapture –
QImageCapture
See also
Setter of property
imageCaptureᅟ
.- setRecorder(recorder)¶
- Parameters:
recorder –
QMediaRecorder
See also
Setter of property
recorderᅟ
.- setScreenCapture(screenCapture)¶
- Parameters:
screenCapture –
QScreenCapture
See also
Setter of property
screenCaptureᅟ
.- setVideoFrameInput(input)¶
- Parameters:
input –
QVideoFrameInput
See also
Setter of property
videoFrameInputᅟ
.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 aQVideoSink
.The previously set preview is detached.
See also
Setter of property
videoOutputᅟ
.- setVideoSink(sink)¶
- Parameters:
sink –
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 aQVideoSink
.The previously set preview is detached.
See also
- setWindowCapture(windowCapture)¶
- Parameters:
windowCapture –
QWindowCapture
See also
Setter of property
windowCaptureᅟ
.- videoFrameInput()¶
- Return type:
See also
Getter of property
videoFrameInputᅟ
.- videoFrameInputChanged()¶
Notification signal of property
videoFrameInputᅟ
.- videoOutput()¶
- Return type:
See also
Getter of property
videoOutputᅟ
.- videoOutputChanged()¶
Notification signal of property
videoOutputᅟ
.- videoSink()¶
- Return type:
Returns the
QVideoSink
for the session.See also
- windowCapture()¶
- Return type:
See also
Getter of property
windowCaptureᅟ
.- windowCaptureChanged()¶
Notification signal of property
windowCaptureᅟ
.