VideoCaptureProperties
import { VideoCaptureProperties } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods.
cv::VideoCapture generic properties identifier.
Reading / writing properties involves many layers. Some unexpected result might happens along this chain. Effective behaviour depends from device hardware, driver and API Backend. See: videoio_flags_others, VideoCapture::get(), VideoCapture::set()
Constructors and members
static CAP_PROP_UNKNOWN
Returned by VideoCapture::get if the requested property is unknown or unsupported
CAP_PROP_UNKNOWN: VideoCapturePropertiesValue<-1>,static CAP_PROP_POS_MSEC
Current position of the video file in milliseconds.
CAP_PROP_POS_MSEC: VideoCapturePropertiesValue<0>,static CAP_PROP_POS_FRAMES
0-based index of the frame to be decoded/captured next. When the index i is set in RAW mode (CAP_PROP_FORMAT == -1) this will seek to the key frame k, where k <= i.
CAP_PROP_POS_FRAMES: VideoCapturePropertiesValue<1>,static CAP_PROP_POS_AVI_RATIO
Relative position of the video file: 0=start of the film, 1=end of the film.
CAP_PROP_POS_AVI_RATIO: VideoCapturePropertiesValue<2>,static CAP_PROP_FRAME_WIDTH
Width of the frames in the video stream.
CAP_PROP_FRAME_WIDTH: VideoCapturePropertiesValue<3>,static CAP_PROP_FRAME_HEIGHT
Height of the frames in the video stream.
CAP_PROP_FRAME_HEIGHT: VideoCapturePropertiesValue<4>,static CAP_PROP_FPS
VideoCaptureProperties.CAP_PROP_FPS: Frame rate.
CAP_PROP_FPS: VideoCapturePropertiesValue<5>,static CAP_PROP_FOURCC
4-character code of codec. see VideoWriter::fourcc .
CAP_PROP_FOURCC: VideoCapturePropertiesValue<6>,static CAP_PROP_FRAME_COUNT
Number of frames in the video file.
CAP_PROP_FRAME_COUNT: VideoCapturePropertiesValue<7>,static CAP_PROP_FORMAT
FFmpeg back-end only - Indicates whether the Last Raw Frame (LRF), output from VideoCapture::read() when VideoCapture is initialized with VideoCapture::open(CAP_FFMPEG, {CAP_PROP_FORMAT, -1}) or VideoCapture::set(CAP_PROP_FORMAT,-1) is called before the first call to VideoCapture::read(), contains encoded data for a key frame.
CAP_PROP_FORMAT: VideoCapturePropertiesValue<8>,static CAP_PROP_MODE
Backend-specific value indicating the current capture mode.
CAP_PROP_MODE: VideoCapturePropertiesValue<9>,static CAP_PROP_BRIGHTNESS
Brightness of the image (only for those cameras that support).
CAP_PROP_BRIGHTNESS: VideoCapturePropertiesValue<10>,static CAP_PROP_CONTRAST
Contrast of the image (only for cameras).
CAP_PROP_CONTRAST: VideoCapturePropertiesValue<11>,static CAP_PROP_SATURATION
Saturation of the image (only for cameras).
CAP_PROP_SATURATION: VideoCapturePropertiesValue<12>,static CAP_PROP_HUE
Hue of the image (only for cameras).
CAP_PROP_HUE: VideoCapturePropertiesValue<13>,static CAP_PROP_GAIN
Gain of the image (only for those cameras that support).
CAP_PROP_GAIN: VideoCapturePropertiesValue<14>,static CAP_PROP_EXPOSURE
Exposure (only for those cameras that support).
CAP_PROP_EXPOSURE: VideoCapturePropertiesValue<15>,static CAP_PROP_CONVERT_RGB
Boolean flags indicating whether images should be converted to BGR. <br/>
CAP_PROP_CONVERT_RGB: VideoCapturePropertiesValue<16>,static CAP_PROP_WHITE_BALANCE_BLUE_U
Currently unsupported.
CAP_PROP_WHITE_BALANCE_BLUE_U: VideoCapturePropertiesValue<17>,static CAP_PROP_RECTIFICATION
Rectification flag for stereo cameras (note: only supported by DC1394 v 2.x backend currently).
CAP_PROP_RECTIFICATION: VideoCapturePropertiesValue<18>,static CAP_PROP_MONOCHROME
Rectification flag for stereo cameras (note: only supported by DC1394 v 2.x backend currently).
CAP_PROP_MONOCHROME: VideoCapturePropertiesValue<19>,static CAP_PROP_SHARPNESS
cap prop sharpness constant (20), defined by OpenCV for cv.
CAP_PROP_SHARPNESS: VideoCapturePropertiesValue<20>,static CAP_PROP_AUTO_EXPOSURE
DC1394: exposure control done by camera, user can adjust reference level using this feature.
CAP_PROP_AUTO_EXPOSURE: VideoCapturePropertiesValue<21>,static CAP_PROP_GAMMA
DC1394: exposure control done by camera, user can adjust reference level using this feature.
CAP_PROP_GAMMA: VideoCapturePropertiesValue<22>,static CAP_PROP_TEMPERATURE
cap prop temperature constant (23), defined by OpenCV for cv.
CAP_PROP_TEMPERATURE: VideoCapturePropertiesValue<23>,static CAP_PROP_TRIGGER
cap prop trigger constant (24), defined by OpenCV for cv.
CAP_PROP_TRIGGER: VideoCapturePropertiesValue<24>,static CAP_PROP_TRIGGER_DELAY
cap prop trigger delay constant (25), defined by OpenCV for cv.
CAP_PROP_TRIGGER_DELAY: VideoCapturePropertiesValue<25>,static CAP_PROP_WHITE_BALANCE_RED_V
cap prop white balance red v constant (26), defined by OpenCV for cv.
CAP_PROP_WHITE_BALANCE_RED_V: VideoCapturePropertiesValue<26>,static CAP_PROP_ZOOM
Android: May switch physical cameras/lenses. Factor and range are hardware-dependent.
CAP_PROP_ZOOM: VideoCapturePropertiesValue<27>,static CAP_PROP_FOCUS
Android: May switch physical cameras/lenses. Factor and range are hardware-dependent.
CAP_PROP_FOCUS: VideoCapturePropertiesValue<28>,static CAP_PROP_GUID
cap prop guid constant (29), defined by OpenCV for cv.
CAP_PROP_GUID: VideoCapturePropertiesValue<29>,static CAP_PROP_ISO_SPEED
cap prop iso speed constant (30), defined by OpenCV for cv.
CAP_PROP_ISO_SPEED: VideoCapturePropertiesValue<30>,static CAP_PROP_BACKLIGHT
cap prop backlight constant (32), defined by OpenCV for cv.
CAP_PROP_BACKLIGHT: VideoCapturePropertiesValue<32>,static CAP_PROP_PAN
cap prop pan constant (33), defined by OpenCV for cv.
CAP_PROP_PAN: VideoCapturePropertiesValue<33>,static CAP_PROP_TILT
cap prop tilt constant (34), defined by OpenCV for cv.
CAP_PROP_TILT: VideoCapturePropertiesValue<34>,static CAP_PROP_ROLL
cap prop roll constant (35), defined by OpenCV for cv.
CAP_PROP_ROLL: VideoCapturePropertiesValue<35>,static CAP_PROP_IRIS
cap prop iris constant (36), defined by OpenCV for cv.
CAP_PROP_IRIS: VideoCapturePropertiesValue<36>,static CAP_PROP_SETTINGS
Pop up video/camera filter dialog (note: only supported by DSHOW backend currently. The property value is ignored)
CAP_PROP_SETTINGS: VideoCapturePropertiesValue<37>,static CAP_PROP_BUFFERSIZE
Pop up video/camera filter dialog (note: only supported by DSHOW backend currently. The property value is ignored)
CAP_PROP_BUFFERSIZE: VideoCapturePropertiesValue<38>,static CAP_PROP_AUTOFOCUS
cap prop autofocus constant (39), defined by OpenCV for cv.
CAP_PROP_AUTOFOCUS: VideoCapturePropertiesValue<39>,static CAP_PROP_SAR_NUM
Sample aspect ratio: num/den (num)
CAP_PROP_SAR_NUM: VideoCapturePropertiesValue<40>,static CAP_PROP_SAR_DEN
Sample aspect ratio: num/den (den)
CAP_PROP_SAR_DEN: VideoCapturePropertiesValue<41>,static CAP_PROP_BACKEND
Current backend (enum VideoCaptureAPIs). Read-only property
CAP_PROP_BACKEND: VideoCapturePropertiesValue<42>,static CAP_PROP_CHANNEL
Video input or Channel Number (only for those cameras that support)
CAP_PROP_CHANNEL: VideoCapturePropertiesValue<43>,static CAP_PROP_AUTO_WB
enable/ disable auto white-balance
CAP_PROP_AUTO_WB: VideoCapturePropertiesValue<44>,static CAP_PROP_WB_TEMPERATURE
white-balance color temperature
CAP_PROP_WB_TEMPERATURE: VideoCapturePropertiesValue<45>,static CAP_PROP_CODEC_PIXEL_FORMAT
(read-only) codec's pixel format. 4-character code - see VideoWriter::fourcc . Subset of AV_PIX_FMT_* or -1 if unknown
CAP_PROP_CODEC_PIXEL_FORMAT: VideoCapturePropertiesValue<46>,static CAP_PROP_BITRATE
(read-only) Video bitrate in kbits/s
CAP_PROP_BITRATE: VideoCapturePropertiesValue<47>,static CAP_PROP_ORIENTATION_META
(read-only) Frame rotation defined by stream meta (applicable for FFmpeg and AVFoundation back-ends only)
CAP_PROP_ORIENTATION_META: VideoCapturePropertiesValue<48>,static CAP_PROP_ORIENTATION_AUTO
if true - rotates output frames of CvCapture considering video file's metadata (applicable for FFmpeg and AVFoundation back-ends only) (https://github.com/opencv/opencv/issues/15499)
CAP_PROP_ORIENTATION_AUTO: VideoCapturePropertiesValue<49>,static CAP_PROP_HW_ACCELERATION
(open-only) Hardware acceleration type (see #VideoAccelerationType). Setting supported only via params parameter in cv::VideoCapture constructor / .open() method. Default value is backend-specific.
CAP_PROP_HW_ACCELERATION: VideoCapturePropertiesValue<50>,static CAP_PROP_HW_DEVICE
(open-only) Hardware device index (select GPU if multiple available). Device enumeration is acceleration type specific.
CAP_PROP_HW_DEVICE: VideoCapturePropertiesValue<51>,static CAP_PROP_HW_ACCELERATION_USE_OPENCL
(open-only) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between HW accelerated decoder and cv::UMat.
CAP_PROP_HW_ACCELERATION_USE_OPENCL: VideoCapturePropertiesValue<52>,static CAP_PROP_OPEN_TIMEOUT_MSEC
(open-only) timeout in milliseconds for opening a video capture (applicable for FFmpeg and GStreamer back-ends only)
CAP_PROP_OPEN_TIMEOUT_MSEC: VideoCapturePropertiesValue<53>,static CAP_PROP_READ_TIMEOUT_MSEC
(open-only) timeout in milliseconds for reading from a video capture (applicable for FFmpeg and GStreamer back-ends only)
CAP_PROP_READ_TIMEOUT_MSEC: VideoCapturePropertiesValue<54>,static CAP_PROP_STREAM_OPEN_TIME_USEC
(read-only) time in microseconds since Jan 1 1970 when stream was opened. Applicable for FFmpeg backend only. Useful for RTSP and other live streams
CAP_PROP_STREAM_OPEN_TIME_USEC: VideoCapturePropertiesValue<55>,static CAP_PROP_VIDEO_TOTAL_CHANNELS
(read-only) Number of video channels
CAP_PROP_VIDEO_TOTAL_CHANNELS: VideoCapturePropertiesValue<56>,static CAP_PROP_VIDEO_STREAM
(open-only) Specify video stream, 0-based index. Use -1 to disable video stream from file or IP cameras. Default value is 0.
CAP_PROP_VIDEO_STREAM: VideoCapturePropertiesValue<57>,static CAP_PROP_AUDIO_STREAM
(open-only) Specify stream in multi-language media files, -1 - disable audio processing or microphone. Default value is -1.
CAP_PROP_AUDIO_STREAM: VideoCapturePropertiesValue<58>,static CAP_PROP_AUDIO_POS
(read-only) Audio position is measured in samples. Accurate audio sample timestamp of previous grabbed fragment. See CAP_PROP_AUDIO_SAMPLES_PER_SECOND and CAP_PROP_AUDIO_SHIFT_NSEC.
CAP_PROP_AUDIO_POS: VideoCapturePropertiesValue<59>,static CAP_PROP_AUDIO_SHIFT_NSEC
(read only) Contains the time difference between the start of the audio stream and the video stream in nanoseconds. Positive value means that audio is started after the first video frame. Negative value means that audio is started before the first video frame.
CAP_PROP_AUDIO_SHIFT_NSEC: VideoCapturePropertiesValue<60>,static CAP_PROP_AUDIO_DATA_DEPTH
(open, read) Alternative definition to bits-per-sample, but with clear handling of 32F / 32S
CAP_PROP_AUDIO_DATA_DEPTH: VideoCapturePropertiesValue<61>,static CAP_PROP_AUDIO_SAMPLES_PER_SECOND
(open, read) determined from file/codec input. If not specified, then selected audio sample rate is 44100
CAP_PROP_AUDIO_SAMPLES_PER_SECOND: VideoCapturePropertiesValue<62>,static CAP_PROP_AUDIO_BASE_INDEX
(read-only) Index of the first audio channel for .retrieve() calls. That audio channel number continues enumeration after video channels.
CAP_PROP_AUDIO_BASE_INDEX: VideoCapturePropertiesValue<63>,static CAP_PROP_AUDIO_TOTAL_CHANNELS
(read-only) Number of audio channels in the selected audio stream (mono, stereo, etc)
CAP_PROP_AUDIO_TOTAL_CHANNELS: VideoCapturePropertiesValue<64>,static CAP_PROP_AUDIO_TOTAL_STREAMS
(read-only) Number of audio streams.
CAP_PROP_AUDIO_TOTAL_STREAMS: VideoCapturePropertiesValue<65>,static CAP_PROP_AUDIO_SYNCHRONIZE
(open, read) Enables audio synchronization.
CAP_PROP_AUDIO_SYNCHRONIZE: VideoCapturePropertiesValue<66>,static CAP_PROP_LRF_HAS_KEY_FRAME
FFmpeg back-end only - Indicates whether the Last Raw Frame (LRF), output from VideoCapture::read() when VideoCapture is initialized with VideoCapture::open(CAP_FFMPEG, {CAP_PROP_FORMAT, -1}) or VideoCapture::set(CAP_PROP_FORMAT,-1) is called before the first call to VideoCapture::read(), contains encoded data for a key frame.
CAP_PROP_LRF_HAS_KEY_FRAME: VideoCapturePropertiesValue<67>,static CAP_PROP_CODEC_EXTRADATA_INDEX
Positive index indicates that returning extra data is supported by the video back end. This can be retrieved as cap.retrieve(data, <returned index>). E.g. When reading from a h264 encoded RTSP stream, the FFmpeg backend could return the SPS and/or PPS if available (if sent in reply to a DESCRIBE request), from calls to cap.retrieve(data, <returned index>).
CAP_PROP_CODEC_EXTRADATA_INDEX: VideoCapturePropertiesValue<68>,static CAP_PROP_FRAME_TYPE
(read-only) FFmpeg back-end only - Frame type ascii code (73 = 'I', 80 = 'P', 66 = 'B' or 63 = '?' if unknown) of the most recently read frame.
CAP_PROP_FRAME_TYPE: VideoCapturePropertiesValue<69>,static CAP_PROP_N_THREADS
(open-only) Set the maximum number of threads to use. Use 0 to use as many threads as CPU cores (applicable for FFmpeg back-end only).
CAP_PROP_N_THREADS: VideoCapturePropertiesValue<70>,static CAP_PROP_PTS
(read-only) FFmpeg back-end only - maximum difference between presentation (pts) and decompression timestamps (dts) using FPS time base. e.g. delay is maximum when frame_num = 0, if true, VideoCapture::get(CAP_PROP_PTS) = 0 and VideoCapture::get(CAP_PROP_DTS_DELAY) = 2, dts = -2. Non zero values usually imply the stream is encoded using B-frames which are not decoded in presentation order.
CAP_PROP_PTS: VideoCapturePropertiesValue<71>,static CAP_PROP_DTS_DELAY
(read-only) FFmpeg back-end only - maximum difference between presentation (pts) and decompression timestamps (dts) using FPS time base. e.g. delay is maximum when frame_num = 0, if true, VideoCapture::get(CAP_PROP_PTS) = 0 and VideoCapture::get(CAP_PROP_DTS_DELAY) = 2, dts = -2. Non zero values usually imply the stream is encoded using B-frames which are not decoded in presentation order.
CAP_PROP_DTS_DELAY: VideoCapturePropertiesValue<72>,static CAP_PROP_IMAGE_SEQ_START
(open-only) Start number for image sequences opened with a printf-style pattern (e.g. frame_%05d.dpx). Sets the initial frame number and disables automatic first-frame detection. Applicable to CAP_FFMPEG (passed as the image2 demuxer start_number) and CAP_IMAGES backends. Default: not set (automatic detection).
CAP_PROP_IMAGE_SEQ_START: VideoCapturePropertiesValue<73>These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.