QImageCapture

The QImageCapture class is used for the recording of media content. More

Inheritance diagram of PySide6.QtMultimedia.QImageCapture

Synopsis

Functions

Slots

Signals

Static functions

Detailed Description

The QImageCapture class is a high level images recording class. It’s not intended to be used alone but for accessing the media recording functions of other media objects, like QCamera .

captureSession = QMediaCaptureSession()
camera = QCamera
captureSession.setCamera(camera)
preview = QVideoWidget()
preview.show()
captureSession.setVideoOutput(preview)
imageCapture = QImageCapture(camera)
captureSession.setImageCapture(imageCapture)
camera.start()        #on shutter button pressed
imageCapture.capture()

See also

QCamera

class PySide6.QtMultimedia.QImageCapture([parent=None])
Parameters

parentPySide6.QtCore.QObject

Constructs a image capture object, from a parent, that can capture individual still images produced by a camera.

You must connect both an image capture object and a QCamera to a capture session to capture images.

PySide6.QtMultimedia.QImageCapture.Error

Constant

Description

QImageCapture.NoError

No Errors.

QImageCapture.NotReadyError

The service is not ready for capture yet.

QImageCapture.ResourceError

Device is not ready or not available.

QImageCapture.OutOfSpaceError

No space left on device.

QImageCapture.NotSupportedFeatureError

Device does not support stillimages capture.

QImageCapture.FormatError

Current format is not supported.

PySide6.QtMultimedia.QImageCapture.Quality

Enumerates quality encoding levels.

Constant

Description

QImageCapture.VeryLowQuality

QImageCapture.LowQuality

QImageCapture.NormalQuality

QImageCapture.HighQuality

QImageCapture.VeryHighQuality

PySide6.QtMultimedia.QImageCapture.FileFormat
PySide6.QtMultimedia.QImageCapture.addMetaData(metaData)
Parameters

metaDataPySide6.QtMultimedia.QMediaMetaData

Adds additional metaData to any existing meta data, that is embedded into the captured image.

PySide6.QtMultimedia.QImageCapture.capture()
Return type

int

Capture the image and make it available as a QImage . This operation is asynchronous in majority of cases, followed by signals imageExposed() , imageCaptured() or error() .

returns the capture Id parameter, used with imageExposed() , imageCaptured() and imageSaved() signals.

PySide6.QtMultimedia.QImageCapture.captureSession()
Return type

PySide6.QtMultimedia.QMediaCaptureSession

Returns the capture session this camera is connected to, or a nullptr if the camera is not connected to a capture session.

Use setImageCapture() to connect the image capture to a session.

PySide6.QtMultimedia.QImageCapture.captureToFile([location=""])
Parameters

location – str

Return type

int

Capture the image and save it to file. This operation is asynchronous in majority of cases, followed by signals imageExposed() , imageCaptured() , imageSaved() or error() .

If an empty file is passed, the camera back end chooses the default location and naming scheme for photos on the system, if only file name without full path is specified, the image will be saved to the default directory, with a full path reported with imageCaptured() and imageSaved() signals.

QCamera saves all the capture parameters like exposure settings or image processing parameters, so changes to camera parameters after capture() is called do not affect previous capture requests.

capture returns the capture Id parameter, used with imageExposed() , imageCaptured() and imageSaved() signals.

PySide6.QtMultimedia.QImageCapture.error()
Return type

Error

PySide6.QtMultimedia.QImageCapture.errorChanged()
PySide6.QtMultimedia.QImageCapture.errorOccurred(id, error, errorString)
Parameters
  • id – int

  • errorError

  • errorString – str

PySide6.QtMultimedia.QImageCapture.errorString()
Return type

str

PySide6.QtMultimedia.QImageCapture.fileFormat()
Return type

FileFormat

This property holds The image format..

PySide6.QtMultimedia.QImageCapture.fileFormatChanged()
static PySide6.QtMultimedia.QImageCapture.fileFormatDescription(c)
Parameters

cFileFormat

Return type

str

static PySide6.QtMultimedia.QImageCapture.fileFormatName(c)
Parameters

cFileFormat

Return type

str

PySide6.QtMultimedia.QImageCapture.imageAvailable(id, frame)
Parameters
PySide6.QtMultimedia.QImageCapture.imageCaptured(id, preview)
Parameters
PySide6.QtMultimedia.QImageCapture.imageExposed(id)
Parameters

id – int

PySide6.QtMultimedia.QImageCapture.imageMetadataAvailable(id, metaData)
Parameters
PySide6.QtMultimedia.QImageCapture.imageSaved(id, fileName)
Parameters
  • id – int

  • fileName – str

PySide6.QtMultimedia.QImageCapture.isAvailable()
Return type

bool

Returns true if the images capture service ready to use.

PySide6.QtMultimedia.QImageCapture.isReadyForCapture()
Return type

bool

Holds true if the camera is ready to capture an image immediately. Calling capture() while readyForCapture is false is not permitted and results in an error.

PySide6.QtMultimedia.QImageCapture.metaData()
Return type

PySide6.QtMultimedia.QMediaMetaData

This property holds The meta data that will get embedded into the image..

Note

Additional fields such as a time stamp or location may get added by the camera back end.

PySide6.QtMultimedia.QImageCapture.metaDataChanged()
PySide6.QtMultimedia.QImageCapture.quality()
Return type

Quality

This property holds The image encoding quality..

PySide6.QtMultimedia.QImageCapture.qualityChanged()
PySide6.QtMultimedia.QImageCapture.readyForCaptureChanged(ready)
Parameters

ready – bool

PySide6.QtMultimedia.QImageCapture.resolution()
Return type

PySide6.QtCore.QSize

Returns the resolution of the encoded image.

See also

setResolution()

PySide6.QtMultimedia.QImageCapture.resolutionChanged()
PySide6.QtMultimedia.QImageCapture.setFileFormat(format)
Parameters

formatFileFormat

Sets the image format.

See also

fileFormat()

PySide6.QtMultimedia.QImageCapture.setMetaData(metaData)
Parameters

metaDataPySide6.QtMultimedia.QMediaMetaData

This property holds The meta data that will get embedded into the image..

Note

Additional fields such as a time stamp or location may get added by the camera back end.

PySide6.QtMultimedia.QImageCapture.setQuality(quality)
Parameters

qualityQuality

Sets the image encoding quality.

See also

quality()

PySide6.QtMultimedia.QImageCapture.setResolution(arg__1)
Parameters

arg__1PySide6.QtCore.QSize

Sets the resolution of the encoded image.

An empty QSize indicates the encoder should make an optimal choice based on what is available from the image source and the limitations of the codec.

See also

resolution()

PySide6.QtMultimedia.QImageCapture.setResolution(width, height)
Parameters
  • width – int

  • height – int

Sets the width and height of the resolution of the encoded image.

This is an overloaded function.

static PySide6.QtMultimedia.QImageCapture.supportedFormats()
Return type