QCamera#
The QCamera
class provides interface for system camera devices. More…
Synopsis#
Properties#
exposureCompensation
- Exposure compensation in EV unitsexposureMode
- Exposure mode being usedexposureTime
- Camera’s exposure time in secondsflashMode
- Flash mode being usedflashReady
- Indicates if the flash is charged and ready to usefocusMode
- The current camera focus modeisoSensitivity
- Sensor ISO sensitivitymanualIsoSensitivity
- Describes a manually set ISO sensitivitytorchMode
- Torch mode being usedzoomFactor
- Current zoom factor
Functions#
def
cameraDevice
()def
cameraFormat
()def
captureSession
()def
colorTemperature
()def
customFocusPoint
()def
error
()def
errorString
()def
exposureCompensation
()def
exposureMode
()def
exposureTime
()def
flashMode
()def
focusDistance
()def
focusMode
()def
focusPoint
()def
isActive
()def
isAvailable
()def
isExposureModeSupported
(mode)def
isFlashModeSupported
(mode)def
isFlashReady
()def
isFocusModeSupported
(mode)def
isTorchModeSupported
(mode)def
isWhiteBalanceModeSupported
(mode)def
isoSensitivity
()def
manualExposureTime
()def
manualIsoSensitivity
()def
maximumExposureTime
()def
maximumIsoSensitivity
()def
maximumZoomFactor
()def
minimumExposureTime
()def
minimumIsoSensitivity
()def
minimumZoomFactor
()def
setCameraDevice
(cameraDevice)def
setCameraFormat
(format)def
setCustomFocusPoint
(point)def
setFocusDistance
(d)def
setFocusMode
(mode)def
setZoomFactor
(factor)def
supportedFeatures
()def
torchMode
()def
whiteBalanceMode
()def
zoomFactor
()
Slots#
def
setActive
(active)def
setAutoExposureTime
()def
setAutoIsoSensitivity
()def
setColorTemperature
(colorTemperature)def
setExposureCompensation
(ev)def
setExposureMode
(mode)def
setFlashMode
(mode)def
setManualExposureTime
(seconds)def
setManualIsoSensitivity
(iso)def
setTorchMode
(mode)def
setWhiteBalanceMode
(mode)def
start
()def
stop
()def
zoomTo
(zoom, rate)
Signals#
def
activeChanged
(arg__1)def
brightnessChanged
()def
cameraDeviceChanged
()def
cameraFormatChanged
()def
colorTemperatureChanged
()def
contrastChanged
()def
customFocusPointChanged
()def
errorChanged
()def
errorOccurred
(error, errorString)def
exposureCompensationChanged
(arg__1)def
exposureModeChanged
()def
exposureTimeChanged
(speed)def
flashModeChanged
()def
flashReady
(arg__1)def
focusDistanceChanged
(arg__1)def
focusModeChanged
()def
focusPointChanged
()def
hueChanged
()def
isoSensitivityChanged
(arg__1)def
manualExposureTimeChanged
(speed)def
manualIsoSensitivityChanged
(arg__1)def
maximumZoomFactorChanged
(arg__1)def
minimumZoomFactorChanged
(arg__1)def
saturationChanged
()def
supportedFeaturesChanged
()def
torchModeChanged
()def
whiteBalanceModeChanged
()def
zoomFactorChanged
(arg__1)
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#
Warning
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
QCamera
can be used within a QMediaCaptureSession
for video recording and image taking.
You can use QCameraDevice
to list available cameras and choose which one to use.
cameras = QMediaDevices.videoInputs() for cameraDevice in cameras: if cameraDevice.description() == "mycamera": camera = QCamera(cameraDevice)
On hardware that supports it, QCamera
lets you adjust the focus and zoom. This also includes functionality such as a “Macro” mode for close up work (e.g. reading barcodes, or recognizing letters), or “touch to focus” - indicating an interesting area of the image for the hardware to attempt to focus on.
camera.setFocusPointMode(QCamera.FocusModeManual) camera.setCustomFocusPoint(QPointF(0.25f, 0.75f)) # A point near the bottom left, 25% away from the corner, near that shiny vase
The minimumZoomFactor()
and maximumZoomFactor()
methods provide the range of supported zoom factors. The zoomTo()
method allows changing the zoom factor.
camera.setZoomFactor(3.0)
After capturing the raw data for a camera frame, the camera hardware and software performs various image processing tasks to produce the final image. This includes compensating for ambient light color, reducing noise, as well as making some other adjustments to the image.
You can control many of these processing steps through the Camera properties. For example, you can set the white balance (or color temperature) used for processing images:
camera.setWhiteBalanceMode(QCamera.WhiteBalanceFluorescent)
For more information on image processing of camera frames, see Camera Image Processing .
See the camera overview for more information.
- class PySide6.QtMultimedia.QCamera(position[, parent=None])#
PySide6.QtMultimedia.QCamera([parent=None])
PySide6.QtMultimedia.QCamera(cameraDevice[, parent=None])
- Parameters:
position –
Position
cameraDevice –
PySide6.QtMultimedia.QCameraDevice
parent –
PySide6.QtCore.QObject
Construct a QCamera
which uses a hardware camera located a the specified position
.
For example on a mobile phone it can be used to easily choose between front-facing and back-facing cameras.
If no camera is available at the specified position
or if position
is UnspecifiedPosition
, the default camera is used.
Construct a QCamera
with a parent
.
Selects the default camera on the system if more than one camera is available.
Construct a QCamera
from a camera description cameraDevice
and parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtMultimedia.QCamera.active: bool#
Describes whether the camera is currently active.
- Access functions:
isActive
()setActive
(active)Signal
activeChanged
(arg__1)
- property PᅟySide6.QtMultimedia.QCamera.cameraDevice: PySide6.QtMultimedia.QCameraDevice#
Returns the QCameraDevice
object associated with this camera.
- Access functions:
cameraDevice
()setCameraDevice
(cameraDevice)Signal
cameraDeviceChanged
()
- property PᅟySide6.QtMultimedia.QCamera.cameraFormat: PySide6.QtMultimedia.QCameraFormat#
Returns the camera format currently used by the camera.
Note
When using the FFMPEG backend on an Android target device if you request YUV420P format, you will receive either a fully planar 4:2:0 YUV420P or a semi-planar NV12/NV21. This depends on the codec implemented by the device OEM.
See also
- Access functions:
cameraFormat
()setCameraFormat
(format)Signal
cameraFormatChanged
()
- property PᅟySide6.QtMultimedia.QCamera.colorTemperature: int#
Returns the current color temperature if the current white balance mode is WhiteBalanceManual
. For other modes the return value is undefined.
- Access functions:
setColorTemperature
(colorTemperature)Signal
colorTemperatureChanged
()
- property PᅟySide6.QtMultimedia.QCamera.customFocusPoint: PySide6.QtCore.QPointF#
This property represents the position of the custom focus point, in relative frame coordinates: QPointF(0,0) points to the left top frame point, QPointF(0.5,0.5) points to the frame center.
The custom focus point property is used only in FocusPointCustom
focus mode.
You can check whether custom focus points are supported by querying supportedFeatures()
with the Feature. CustomFocusPoint
flag.
- Access functions:
setCustomFocusPoint
(point)Signal
customFocusPointChanged
()
- property PᅟySide6.QtMultimedia.QCamera.error: Error#
Returns the error state of the camera.
- Access functions:
error
()Signal
errorChanged
()
- property PᅟySide6.QtMultimedia.QCamera.errorString: str#
Returns a human readable string describing a camera’s error state.
- Access functions:
errorString
()Signal
errorChanged
()
- property PᅟySide6.QtMultimedia.QCamera.exposureCompensation: float#
This property holds Exposure compensation in EV units..
Exposure compensation property allows to adjust the automatically calculated exposure.
- Access functions:
Signal
exposureCompensationChanged
(arg__1)
- property PᅟySide6.QtMultimedia.QCamera.exposureMode: ExposureMode#
This property holds The exposure mode being used..
See also
- Access functions:
exposureMode
()setExposureMode
(mode)Signal
exposureModeChanged
()
- property PᅟySide6.QtMultimedia.QCamera.exposureTime: float#
This property holds Camera’s exposure time in seconds..
- Access functions:
exposureTime
()Signal
exposureTimeChanged
(speed)
- property PᅟySide6.QtMultimedia.QCamera.flashMode: FlashMode#
This property holds The flash mode being used..
Enables a certain flash mode if the camera has a flash.
See also
FlashMode
isFlashModeSupported
isFlashReady
- Access functions:
flashMode
()setFlashMode
(mode)Signal
flashModeChanged
()
- property PᅟySide6.QtMultimedia.QCamera.flashReady: bool#
This property holds Indicates if the flash is charged and ready to use..
- Access functions:
isFlashReady
()Signal
flashReady
(arg__1)
- property PᅟySide6.QtMultimedia.QCamera.focusDistance: float#
This property return an approximate focus distance of the camera. The value reported is between 0 and 1, 0 being the closest possible focus distance, 1 being as far away as possible. Note that 1 is often, but not always infinity.
Setting the focus distance will be ignored unless the focus mode is set to FocusModeManual
.
- Access functions:
setFocusDistance
(d)Signal
focusDistanceChanged
(arg__1)
- property PᅟySide6.QtMultimedia.QCamera.focusMode: FocusMode#
This property holds the current camera focus mode..
Sets up different focus modes for the camera. All auto focus modes will focus continuously. Locking the focus is possible by setting the focus mode to FocusModeManual
. This will keep the current focus and stop any automatic focusing.
See also
- Access functions:
focusMode
()setFocusMode
(mode)
- property PᅟySide6.QtMultimedia.QCamera.focusPoint: PySide6.QtCore.QPointF#
Returns the point currently used by the auto focus system to focus onto.
- Access functions:
focusPoint
()Signal
focusPointChanged
()
- property PᅟySide6.QtMultimedia.QCamera.isoSensitivity: int#
This property holds The sensor ISO sensitivity..
Describes the ISO sensitivity currently used by the camera.
- Access functions:
Signal
isoSensitivityChanged
(arg__1)
- property PᅟySide6.QtMultimedia.QCamera.manualExposureTime: int#
Set the manual exposure time to seconds
- Access functions:
setManualExposureTime
(seconds)Signal
manualExposureTimeChanged
(speed)
- property PᅟySide6.QtMultimedia.QCamera.manualIsoSensitivity: int#
This property Describes a manually set ISO sensitivity.
Setting this property to -1 (the default), implies that the camera automatically adjusts the ISO sensitivity.
- Access functions:
setManualIsoSensitivity
(iso)Signal
manualIsoSensitivityChanged
(arg__1)
- property PᅟySide6.QtMultimedia.QCamera.maximumZoomFactor: float#
Returns the maximum zoom factor.
This will be 1.0
on cameras that do not support zooming.
- Access functions:
Signal
maximumZoomFactorChanged
(arg__1)
- property PᅟySide6.QtMultimedia.QCamera.minimumZoomFactor: float#
Returns the minimum zoom factor.
This will be 1.0
on cameras that do not support zooming.
- Access functions:
Signal
minimumZoomFactorChanged
(arg__1)
- property PᅟySide6.QtMultimedia.QCamera.supportedFeatures: Combination of QCamera.Feature#
Returns the features supported by this camera.
See also
Feature
- Access functions:
Signal
supportedFeaturesChanged
()
- property PᅟySide6.QtMultimedia.QCamera.torchMode: TorchMode#
This property holds The torch mode being used..
A torch is a continuous source of light. It can be used during video recording in low light conditions. Enabling torch mode will usually override any currently set flash mode.
See also
TorchMode
isTorchModeSupported
flashMode
- Access functions:
torchMode
()setTorchMode
(mode)Signal
torchModeChanged
()
- property PᅟySide6.QtMultimedia.QCamera.whiteBalanceMode: WhiteBalanceMode#
Returns the white balance mode being used.
- Access functions:
setWhiteBalanceMode
(mode)Signal
whiteBalanceModeChanged
()
- property PᅟySide6.QtMultimedia.QCamera.zoomFactor: float#
This property holds The current zoom factor..
Gets or sets the current zoom factor. Values will be clamped between minimumZoomFactor
and maximumZoomFactor
.
- Access functions:
zoomFactor
()setZoomFactor
(factor)Signal
zoomFactorChanged
(arg__1)
- PySide6.QtMultimedia.QCamera.Error#
This enum holds the last error code.
Constant
Description
QCamera.NoError
No errors have occurred.
QCamera.CameraError
An error has occurred.
- PySide6.QtMultimedia.QCamera.FocusMode#
Constant
Description
QCamera.FocusModeAuto
Continuous auto focus mode.
QCamera.FocusModeAutoNear
Continuous auto focus mode on near objects.
QCamera.FocusModeAutoFar
Continuous auto focus mode on objects far away.
QCamera.FocusModeHyperfocal
Focus to hyperfocal distance, with the maximum depth of field achieved. All objects at distances from half of this distance out to infinity will be acceptably sharp.
QCamera.FocusModeInfinity
Focus strictly to infinity.
QCamera.FocusModeManual
Manual or fixed focus mode.
New in version 6.1.
- PySide6.QtMultimedia.QCamera.FlashMode#
Constant
Description
QCamera.FlashOff
Flash is Off.
QCamera.FlashOn
Flash is On.
QCamera.FlashAuto
Automatic flash.
New in version 6.1.
- PySide6.QtMultimedia.QCamera.TorchMode#
Constant
Description
QCamera.TorchOff
Torch is Off.
QCamera.TorchOn
Torch is On.
QCamera.TorchAuto
Automatic torch.
New in version 6.1.
- PySide6.QtMultimedia.QCamera.ExposureMode#
Constant
Description
QCamera.ExposureAuto
Automatic mode.
QCamera.ExposureManual
Manual mode.
QCamera.ExposurePortrait
Portrait exposure mode.
QCamera.ExposureNight
Night mode.
QCamera.ExposureSports
Spots exposure mode.
QCamera.ExposureSnow
Snow exposure mode.
QCamera.ExposureBeach
Beach exposure mode.
QCamera.ExposureAction
Action mode. Since 5.5
QCamera.ExposureLandscape
Landscape mode. Since 5.5
QCamera.ExposureNightPortrait
Night portrait mode. Since 5.5
QCamera.ExposureTheatre
Theatre mode. Since 5.5
QCamera.ExposureSunset
Sunset mode. Since 5.5
QCamera.ExposureSteadyPhoto
Steady photo mode. Since 5.5
QCamera.ExposureFireworks
Fireworks mode. Since 5.5
QCamera.ExposureParty
Party mode. Since 5.5
QCamera.ExposureCandlelight
Candlelight mode. Since 5.5
QCamera.ExposureBarcode
Barcode mode. Since 5.5
New in version 6.1.
- PySide6.QtMultimedia.QCamera.WhiteBalanceMode#
Constant
Description
QCamera.WhiteBalanceAuto
Auto white balance mode.
QCamera.WhiteBalanceManual
Manual white balance. In this mode the white balance should be set with
setColorTemperature()
QCamera.WhiteBalanceSunlight
Sunlight white balance mode.
QCamera.WhiteBalanceCloudy
Cloudy white balance mode.
QCamera.WhiteBalanceShade
Shade white balance mode.
QCamera.WhiteBalanceTungsten
Tungsten (incandescent) white balance mode.
QCamera.WhiteBalanceFluorescent
Fluorescent white balance mode.
QCamera.WhiteBalanceFlash
Flash white balance mode.
QCamera.WhiteBalanceSunset
Sunset white balance mode.
New in version 6.1.
- PySide6.QtMultimedia.QCamera.Feature#
(inherits enum.Flag
) Describes a set of features supported by the camera. The returned value can be a combination of:
Constant
Description
QCamera.Feature.ColorTemperature
The Camera supports setting a custom
colorTemperature
.QCamera.Feature.ExposureCompensation
The Camera supports setting a custom
exposureCompensation
.QCamera.Feature.IsoSensitivity
The Camera supports setting a custom
isoSensitivity
.QCamera.Feature.ManualExposureTime
The Camera supports setting a
manual exposure Time
.QCamera.Feature.CustomFocusPoint
The Camera supports setting a
custom focus point
.QCamera.Feature.FocusDistance
The Camera supports setting the
focusDistance
property.
New in version 6.1.
- PySide6.QtMultimedia.QCamera.activeChanged(arg__1)#
- Parameters:
arg__1 – bool
Notification signal of property active
.
- PySide6.QtMultimedia.QCamera.brightnessChanged()#
- PySide6.QtMultimedia.QCamera.cameraDevice()#
- Return type:
See also
Getter of property cameraDevice
.
- PySide6.QtMultimedia.QCamera.cameraDeviceChanged()#
Notification signal of property cameraDevice
.
- PySide6.QtMultimedia.QCamera.cameraFormat()#
- Return type:
See also
Getter of property cameraFormat
.
- PySide6.QtMultimedia.QCamera.cameraFormatChanged()#
Notification signal of property cameraFormat
.
- PySide6.QtMultimedia.QCamera.captureSession()#
- Return type:
Returns the capture session this camera is connected to, or a nullptr if the camera is not connected to a capture session.
use setCamera()
to connect the camera to a session.
- PySide6.QtMultimedia.QCamera.colorTemperature()#
- Return type:
int
See also
Getter of property colorTemperature
.
- PySide6.QtMultimedia.QCamera.colorTemperatureChanged()#
Notification signal of property colorTemperature
.
- PySide6.QtMultimedia.QCamera.contrastChanged()#
- PySide6.QtMultimedia.QCamera.customFocusPoint()#
- Return type:
See also
Getter of property customFocusPoint
.
- PySide6.QtMultimedia.QCamera.customFocusPointChanged()#
Notification signal of property customFocusPoint
.
Getter of property error
.
- PySide6.QtMultimedia.QCamera.errorChanged()#
Notification signal of property error
.
- PySide6.QtMultimedia.QCamera.errorOccurred(error, errorString)#
- Parameters:
error –
Error
errorString – str
This signal is emitted when error state changes to error
. A description of the error is provided as errorString
.
- PySide6.QtMultimedia.QCamera.errorString()#
- Return type:
str
Getter of property errorString
.
- PySide6.QtMultimedia.QCamera.exposureCompensation()#
- Return type:
float
See also
Getter of property exposureCompensation
.
- PySide6.QtMultimedia.QCamera.exposureCompensationChanged(arg__1)#
- Parameters:
arg__1 – float
Signal emitted when the exposure compensation changes to value
.
Notification signal of property exposureCompensation
.
- PySide6.QtMultimedia.QCamera.exposureMode()#
- Return type:
See also
Getter of property exposureMode
.
- PySide6.QtMultimedia.QCamera.exposureModeChanged()#
Notification signal of property exposureMode
.
- PySide6.QtMultimedia.QCamera.exposureTime()#
- Return type:
float
Returns the current exposure time in seconds.
Getter of property exposureTime
.
- PySide6.QtMultimedia.QCamera.exposureTimeChanged(speed)#
- Parameters:
speed – float
Signals that a camera’s exposure speed
has changed.
Notification signal of property exposureTime
.
- PySide6.QtMultimedia.QCamera.flashMode()#
- Return type:
See also
Getter of property flashMode
.
- PySide6.QtMultimedia.QCamera.flashModeChanged()#
Notification signal of property flashMode
.
- PySide6.QtMultimedia.QCamera.flashReady(arg__1)#
- Parameters:
arg__1 – bool
Signal the flash ready
status has changed.
Notification signal of property flashReady
.
- PySide6.QtMultimedia.QCamera.focusDistance()#
- Return type:
float
See also
Getter of property focusDistance
.
- PySide6.QtMultimedia.QCamera.focusDistanceChanged(arg__1)#
- Parameters:
arg__1 – float
Notification signal of property focusDistance
.
- PySide6.QtMultimedia.QCamera.focusMode()#
- Return type:
See also
Getter of property focusMode
.
- PySide6.QtMultimedia.QCamera.focusModeChanged()#
Signals when the focusMode
changes.
- PySide6.QtMultimedia.QCamera.focusPoint()#
- Return type:
Getter of property focusPoint
.
- PySide6.QtMultimedia.QCamera.focusPointChanged()#
Notification signal of property focusPoint
.
- PySide6.QtMultimedia.QCamera.hueChanged()#
- PySide6.QtMultimedia.QCamera.isActive()#
- Return type:
bool
Returns true if the camera is currently active.
Getter of property active
.
- PySide6.QtMultimedia.QCamera.isAvailable()#
- Return type:
bool
Returns true if the camera can be used.
- PySide6.QtMultimedia.QCamera.isExposureModeSupported(mode)#
- Parameters:
mode –
ExposureMode
- Return type:
bool
Returns true if the exposure mode
is supported.
- PySide6.QtMultimedia.QCamera.isFlashModeSupported(mode)#
- Parameters:
mode –
FlashMode
- Return type:
bool
Returns true if the flash mode
is supported.
- PySide6.QtMultimedia.QCamera.isFlashReady()#
- Return type:
bool
Returns true if flash is charged.
Getter of property flashReady
.
- PySide6.QtMultimedia.QCamera.isFocusModeSupported(mode)#
- Parameters:
mode –
FocusMode
- Return type:
bool
Returns true if the focus mode
is supported by the camera.
- PySide6.QtMultimedia.QCamera.isTorchModeSupported(mode)#
- Parameters:
mode –
TorchMode
- Return type:
bool
Returns true if the torch mode
is supported.
- PySide6.QtMultimedia.QCamera.isWhiteBalanceModeSupported(mode)#
- Parameters:
mode –
WhiteBalanceMode
- Return type:
bool
Returns true if the white balance mode
is supported.
- PySide6.QtMultimedia.QCamera.isoSensitivity()#
- Return type:
int
Getter of property isoSensitivity
.
- PySide6.QtMultimedia.QCamera.isoSensitivityChanged(arg__1)#
- Parameters:
arg__1 – int
Signal emitted when sensitivity changes to value
.
Notification signal of property isoSensitivity
.
- PySide6.QtMultimedia.QCamera.manualExposureTime()#
- Return type:
float
Returns the manual exposure time in seconds, or -1 if the camera is using automatic exposure times.
See also
- PySide6.QtMultimedia.QCamera.manualExposureTimeChanged(speed)#
- Parameters:
speed – float
Notification signal of property manualExposureTime
.
- PySide6.QtMultimedia.QCamera.manualIsoSensitivity()#
- Return type:
int
See also
Getter of property manualIsoSensitivity
.
- PySide6.QtMultimedia.QCamera.manualIsoSensitivityChanged(arg__1)#
- Parameters:
arg__1 – int
Notification signal of property manualIsoSensitivity
.
- PySide6.QtMultimedia.QCamera.maximumExposureTime()#
- Return type:
float
The maximal exposure time in seconds.
- PySide6.QtMultimedia.QCamera.maximumIsoSensitivity()#
- Return type:
int
Returns the maximum ISO sensitivity supported by the camera.
- PySide6.QtMultimedia.QCamera.maximumZoomFactor()#
- Return type:
float
Getter of property maximumZoomFactor
.
- PySide6.QtMultimedia.QCamera.maximumZoomFactorChanged(arg__1)#
- Parameters:
arg__1 – float
Notification signal of property maximumZoomFactor
.
- PySide6.QtMultimedia.QCamera.minimumExposureTime()#
- Return type:
float
The minimal exposure time in seconds.
- PySide6.QtMultimedia.QCamera.minimumIsoSensitivity()#
- Return type:
int
Returns the minimum ISO sensitivity supported by the camera.
- PySide6.QtMultimedia.QCamera.minimumZoomFactor()#
- Return type:
float
Getter of property minimumZoomFactor
.
- PySide6.QtMultimedia.QCamera.minimumZoomFactorChanged(arg__1)#
- Parameters:
arg__1 – float
Notification signal of property minimumZoomFactor
.
- PySide6.QtMultimedia.QCamera.saturationChanged()#
- PySide6.QtMultimedia.QCamera.setActive(active)#
- Parameters:
active – bool
Turns the camera on if active
is true
, or off if it’s false
.
See also
Setter of property active
.
- PySide6.QtMultimedia.QCamera.setAutoExposureTime()#
Use automatically calculated exposure time
- PySide6.QtMultimedia.QCamera.setAutoIsoSensitivity()#
Turn on auto sensitivity
- PySide6.QtMultimedia.QCamera.setCameraDevice(cameraDevice)#
- Parameters:
cameraDevice –
PySide6.QtMultimedia.QCameraDevice
Connects the camera object to the physical camera device described by cameraDevice
. Using a default constructed QCameraDevice
object as cameraDevice
will connect the camera to the system default camera device.
See also
Setter of property cameraDevice
.
- PySide6.QtMultimedia.QCamera.setCameraFormat(format)#
- Parameters:
format –
PySide6.QtMultimedia.QCameraFormat
Tells the camera to use the format described by format
. This can be used to define a specific resolution and frame rate to be used for recording and image capture.
Note
When using the FFMPEG backend on an Android target device if you request YUV420P format, you will receive either a fully planar 4:2:0 YUV420P or a semi-planar NV12/NV21. This depends on the codec implemented by the device OEM.
See also
Setter of property cameraFormat
.
- PySide6.QtMultimedia.QCamera.setColorTemperature(colorTemperature)#
- Parameters:
colorTemperature – int
Sets manual white balance to colorTemperature
. This is used when whiteBalanceMode()
is set to WhiteBalanceManual
. The units are Kelvin.
Setting a color temperature will only have an effect if WhiteBalanceManual
is supported. In this case, setting a temperature greater 0 will automatically set the white balance mode to WhiteBalanceManual
. Setting the temperature to 0 will reset the white balance mode to WhiteBalanceAuto
.
See also
Setter of property colorTemperature
.
- PySide6.QtMultimedia.QCamera.setCustomFocusPoint(point)#
- Parameters:
point –
PySide6.QtCore.QPointF
See also
Setter of property customFocusPoint
.
- PySide6.QtMultimedia.QCamera.setExposureCompensation(ev)#
- Parameters:
ev – float
See also
Setter of property exposureCompensation
.
- PySide6.QtMultimedia.QCamera.setExposureMode(mode)#
- Parameters:
mode –
ExposureMode
See also
Setter of property exposureMode
.
Setter of property flashMode
.
- PySide6.QtMultimedia.QCamera.setFocusDistance(d)#
- Parameters:
d – float
See also
Setter of property focusDistance
.
Setter of property focusMode
.
- PySide6.QtMultimedia.QCamera.setManualExposureTime(seconds)#
- Parameters:
seconds – float
See also
- PySide6.QtMultimedia.QCamera.setManualIsoSensitivity(iso)#
- Parameters:
iso – int
See also
Setter of property manualIsoSensitivity
.
Setter of property torchMode
.
- PySide6.QtMultimedia.QCamera.setWhiteBalanceMode(mode)#
- Parameters:
mode –
WhiteBalanceMode
Sets the white balance to mode
.
See also
Setter of property whiteBalanceMode
.
- PySide6.QtMultimedia.QCamera.setZoomFactor(factor)#
- Parameters:
factor – float
Zooms to a zoom factor factor
at a rate of 1 factor per second.
See also
Setter of property zoomFactor
.
- PySide6.QtMultimedia.QCamera.start()#
Starts the camera.
Same as setActive
(true).
If the camera can’t be started for some reason, the errorOccurred()
signal is emitted.
- PySide6.QtMultimedia.QCamera.stop()#
Stops the camera. Same as setActive
(false).
- PySide6.QtMultimedia.QCamera.supportedFeatures()#
- Return type:
Combination of
QCamera.Feature
Getter of property supportedFeatures
.
- PySide6.QtMultimedia.QCamera.supportedFeaturesChanged()#
Notification signal of property supportedFeatures
.
- PySide6.QtMultimedia.QCamera.torchMode()#
- Return type:
See also
Getter of property torchMode
.
- PySide6.QtMultimedia.QCamera.torchModeChanged()#
Notification signal of property torchMode
.
- PySide6.QtMultimedia.QCamera.whiteBalanceMode()#
- Return type:
See also
Getter of property whiteBalanceMode
.
- PySide6.QtMultimedia.QCamera.whiteBalanceModeChanged()#
Notification signal of property whiteBalanceMode
.
- PySide6.QtMultimedia.QCamera.zoomFactor()#
- Return type:
float
See also
Getter of property zoomFactor
.
- PySide6.QtMultimedia.QCamera.zoomFactorChanged(arg__1)#
- Parameters:
arg__1 – float
Notification signal of property zoomFactor
.
- PySide6.QtMultimedia.QCamera.zoomTo(zoom, rate)#
- Parameters:
zoom – float
rate – float
Zooms to a zoom factor factor
using rate
.
The rate
is specified in powers of two per second. At a rate of 1 it would take 2 seconds to go from a zoom factor of 1 to 4.
Note
Using a specific rate is not supported on all cameras. If not supported, zooming will happen as fast as possible.