QCameraImageCapture

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

Inheritance diagram of PySide2.QtMultimedia.QCameraImageCapture

Synopsis

Functions

Slots

Signals

Detailed Description

The QCameraImageCapture 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 .

camera = new QCamera;

viewfinder = new QCameraViewfinder();
viewfinder->show();

camera->setViewfinder(viewfinder);

imageCapture = new QCameraImageCapture(camera);

camera->setCaptureMode(QCamera::CaptureStillImage);
camera->start();
//on half pressed shutter button
camera->searchAndLock();

//on shutter button pressed
imageCapture->capture();

//on shutter button released
camera->unlock();

See also

QCamera

class PySide2.QtMultimedia.QCameraImageCapture(mediaObject[, parent=None])

Constructs a media recorder which records the media produced by mediaObject .

The parent is passed to QMediaObject .

PySide2.QtMultimedia.QCameraImageCapture.Error

Constant

Description

QCameraImageCapture.NoError

No Errors.

QCameraImageCapture.NotReadyError

The service is not ready for capture yet.

QCameraImageCapture.ResourceError

Device is not ready or not available.

QCameraImageCapture.OutOfSpaceError

No space left on device.

QCameraImageCapture.NotSupportedFeatureError

Device does not support stillimages capture.

QCameraImageCapture.FormatError

Current format is not supported.

PySide2.QtMultimedia.QCameraImageCapture.DriveMode

Constant

Description

QCameraImageCapture.SingleImageCapture

Drive mode is capturing a single picture.

PySide2.QtMultimedia.QCameraImageCapture.CaptureDestination

Constant

Description

QCameraImageCapture.CaptureToFile

Capture the image to a file.

QCameraImageCapture.CaptureToBuffer

Capture the image to a buffer for further processing.

PySide2.QtMultimedia.QCameraImageCapture.availability()
Return type:

AvailabilityStatus

Returns the availability of this functionality.

PySide2.QtMultimedia.QCameraImageCapture.bufferFormat()
Return type:

PixelFormat

Returns the buffer image capture format being used.

PySide2.QtMultimedia.QCameraImageCapture.bufferFormatChanged(format)
Parameters:

formatPixelFormat

PySide2.QtMultimedia.QCameraImageCapture.cancelCapture()

Cancel incomplete capture requests. Already captured and queused for proicessing images may be discarded.

PySide2.QtMultimedia.QCameraImageCapture.capture([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 backend choses 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 is called do not affect previous capture requests.

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

PySide2.QtMultimedia.QCameraImageCapture.captureDestination()
Return type:

CaptureDestinations

Returns the image capture destination being used.

PySide2.QtMultimedia.QCameraImageCapture.captureDestinationChanged(destination)
Parameters:

destinationCaptureDestinations

PySide2.QtMultimedia.QCameraImageCapture.encodingSettings()
Return type:

PySide2.QtMultimedia.QImageEncoderSettings

Returns the image encoder settings being used.

PySide2.QtMultimedia.QCameraImageCapture.error()
Return type:

Error

Returns the current error state.

See also

errorString()

PySide2.QtMultimedia.QCameraImageCapture.error(id, error, errorString)
Parameters:
  • id – int

  • errorError

  • errorString – str

PySide2.QtMultimedia.QCameraImageCapture.errorString()
Return type:

str

Returns a string describing the current error state.

See also

error()

PySide2.QtMultimedia.QCameraImageCapture.imageAvailable(id, frame)
Parameters:
PySide2.QtMultimedia.QCameraImageCapture.imageCaptured(id, preview)
Parameters:
PySide2.QtMultimedia.QCameraImageCapture.imageCodecDescription(codecName)
Parameters:

codecName – str

Return type:

str

Returns a description of an image codec .

PySide2.QtMultimedia.QCameraImageCapture.imageExposed(id)
Parameters:

id – int

PySide2.QtMultimedia.QCameraImageCapture.imageMetadataAvailable(id, key, value)
Parameters:
  • id – int

  • key – str

  • value – object

PySide2.QtMultimedia.QCameraImageCapture.imageSaved(id, fileName)
Parameters:
  • id – int

  • fileName – str

PySide2.QtMultimedia.QCameraImageCapture.isAvailable()
Return type:

bool

Returns true if the images capture service ready to use.

PySide2.QtMultimedia.QCameraImageCapture.isCaptureDestinationSupported(destination)
Parameters:

destinationCaptureDestinations

Return type:

bool

Returns true if the image capture destination is supported; otherwise returns false.

PySide2.QtMultimedia.QCameraImageCapture.isReadyForCapture()
Return type:

bool

This property holds whether the service is ready to capture a an image immediately..

Calling capture() while readyForCapture is false is not permitted and results in an error.

PySide2.QtMultimedia.QCameraImageCapture.readyForCaptureChanged(ready)
Parameters:

ready – bool

PySide2.QtMultimedia.QCameraImageCapture.setBufferFormat(format)
Parameters:

formatPixelFormat

Sets the buffer image capture format to be used.

PySide2.QtMultimedia.QCameraImageCapture.setCaptureDestination(destination)
Parameters:

destinationCaptureDestinations

Sets the capture destination to be used.

PySide2.QtMultimedia.QCameraImageCapture.setEncodingSettings(settings)
Parameters:

settingsPySide2.QtMultimedia.QImageEncoderSettings

Sets the image encoding settings .

If some parameters are not specified, or null settings are passed, the encoder choose the default encoding parameters.

PySide2.QtMultimedia.QCameraImageCapture.supportedBufferFormats()
Return type:

Returns the list of supported buffer image capture formats.

PySide2.QtMultimedia.QCameraImageCapture.supportedImageCodecs()
Return type:

list of strings

Returns a list of supported image codecs.