OpenCV的视频 I/O 的标志(77)

返回:OpenCV系列文章目录(持续更新中......)
上一篇:OpenCV
下一篇 :OpenCV系列文章目录(持续更新中......)

枚举

|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ### 枚举 | cv::VideoCaptureAPIs { cv::CAP_ANY = 0, cv::CAP_VFW = 200, cv::CAP_V4L = 200, cv::CAP_V4L2 = CAP_V4L, cv::CAP_FIREWIRE = 300, cv::CAP_FIREWARE = CAP_FIREWIRE, cv::CAP_IEEE1394 = CAP_FIREWIRE, cv::CAP_DC1394 = CAP_FIREWIRE, cv::CAP_CMU1394 = CAP_FIREWIRE, cv::CAP_QT = 500, cv::CAP_UNICAP = 600, cv::CAP_DSHOW = 700, cv::CAP_PVAPI = 800, cv::CAP_OPENNI = 900, cv::CAP_OPENNI_ASUS = 910, cv::CAP_ANDROID = 1000, cv::CAP_XIAPI = 1100, cv::CAP_AVFOUNDATION = 1200, cv::CAP_GIGANETIX = 1300, cv::CAP_MSMF = 1400, cv::CAP_WINRT = 1410, cv::CAP_INTELPERC = 1500, cv::CAP_REALSENSE = 1500, cv::CAP_OPENNI2 = 1600, cv::CAP_OPENNI2_ASUS = 1610, cv::CAP_OPENNI2_ASTRA = 1620, cv::CAP_GPHOTO2 = 1700, cv::CAP_GSTREAMER = 1800, cv::CAP_FFMPEG = 1900, cv::CAP_IMAGES = 2000, cv::CAP_ARAVIS = 2100, cv::CAP_OPENCV_MJPEG = 2200, cv::CAP_INTEL_MFX = 2300, cv::CAP_XINE = 2400, cv::CAP_UEYE = 2500, cv::CAP_OBSENSOR = 2600 } |
| | cv::VideoCapture API backends identifier. More... |
| ||
| enum | cv::VideoCaptureProperties { cv::CAP_PROP_POS_MSEC =0, cv::CAP_PROP_POS_FRAMES =1, cv::CAP_PROP_POS_AVI_RATIO =2, cv::CAP_PROP_FRAME_WIDTH =3, cv::CAP_PROP_FRAME_HEIGHT =4, cv::CAP_PROP_FPS =5, cv::CAP_PROP_FOURCC =6, cv::CAP_PROP_FRAME_COUNT =7, cv::CAP_PROP_FORMAT =8, cv::CAP_PROP_MODE =9, cv::CAP_PROP_BRIGHTNESS =10, cv::CAP_PROP_CONTRAST =11, cv::CAP_PROP_SATURATION =12, cv::CAP_PROP_HUE =13, cv::CAP_PROP_GAIN =14, cv::CAP_PROP_EXPOSURE =15, cv::CAP_PROP_CONVERT_RGB =16, cv::CAP_PROP_WHITE_BALANCE_BLUE_U =17, cv::CAP_PROP_RECTIFICATION =18, cv::CAP_PROP_MONOCHROME =19, cv::CAP_PROP_SHARPNESS =20, cv::CAP_PROP_AUTO_EXPOSURE =21, cv::CAP_PROP_GAMMA =22, cv::CAP_PROP_TEMPERATURE =23, cv::CAP_PROP_TRIGGER =24, cv::CAP_PROP_TRIGGER_DELAY =25, cv::CAP_PROP_WHITE_BALANCE_RED_V =26, cv::CAP_PROP_ZOOM =27, cv::CAP_PROP_FOCUS =28, cv::CAP_PROP_GUID =29, cv::CAP_PROP_ISO_SPEED =30, cv::CAP_PROP_BACKLIGHT =32, cv::CAP_PROP_PAN =33, cv::CAP_PROP_TILT =34, cv::CAP_PROP_ROLL =35, cv::CAP_PROP_IRIS =36, cv::CAP_PROP_SETTINGS =37, cv::CAP_PROP_BUFFERSIZE =38, cv::CAP_PROP_AUTOFOCUS =39, cv::CAP_PROP_SAR_NUM =40, cv::CAP_PROP_SAR_DEN =41, cv::CAP_PROP_BACKEND =42, cv::CAP_PROP_CHANNEL =43, cv::CAP_PROP_AUTO_WB =44, cv::CAP_PROP_WB_TEMPERATURE =45, cv::CAP_PROP_CODEC_PIXEL_FORMAT =46, cv::CAP_PROP_BITRATE =47, cv::CAP_PROP_ORIENTATION_META =48, cv::CAP_PROP_ORIENTATION_AUTO =49, cv::CAP_PROP_HW_ACCELERATION =50, cv::CAP_PROP_HW_DEVICE =51, cv::CAP_PROP_HW_ACCELERATION_USE_OPENCL =52, cv::CAP_PROP_OPEN_TIMEOUT_MSEC =53, cv::CAP_PROP_READ_TIMEOUT_MSEC =54, cv::CAP_PROP_STREAM_OPEN_TIME_USEC =55, cv::CAP_PROP_VIDEO_TOTAL_CHANNELS = 56, cv::CAP_PROP_VIDEO_STREAM = 57, cv::CAP_PROP_AUDIO_STREAM = 58, cv::CAP_PROP_AUDIO_POS = 59, cv::CAP_PROP_AUDIO_SHIFT_NSEC = 60, cv::CAP_PROP_AUDIO_DATA_DEPTH = 61, cv::CAP_PROP_AUDIO_SAMPLES_PER_SECOND = 62, cv::CAP_PROP_AUDIO_BASE_INDEX = 63, cv::CAP_PROP_AUDIO_TOTAL_CHANNELS = 64, cv::CAP_PROP_AUDIO_TOTAL_STREAMS = 65, cv::CAP_PROP_AUDIO_SYNCHRONIZE = 66, cv::CAP_PROP_LRF_HAS_KEY_FRAME = 67, cv::CAP_PROP_CODEC_EXTRADATA_INDEX = 68, cv::CAP_PROP_FRAME_TYPE = 69, cv::CAP_PROP_N_THREADS = 70 } |
| | cv::VideoCapture generic properties identifier. More... |
| ||
| enum | cv::VideoWriterProperties { cv::VIDEOWRITER_PROP_QUALITY = 1, cv::VIDEOWRITER_PROP_FRAMEBYTES = 2, cv::VIDEOWRITER_PROP_NSTRIPES = 3, cv::VIDEOWRITER_PROP_IS_COLOR = 4, cv::VIDEOWRITER_PROP_DEPTH = 5, cv::VIDEOWRITER_PROP_HW_ACCELERATION = 6, cv::VIDEOWRITER_PROP_HW_DEVICE = 7, cv::VIDEOWRITER_PROP_HW_ACCELERATION_USE_OPENCL = 8, cv::VIDEOWRITER_PROP_RAW_VIDEO = 9, cv::VIDEOWRITER_PROP_KEY_INTERVAL = 10, cv::VIDEOWRITER_PROP_KEY_FLAG = 11 } |
| | cv::VideoWriter generic properties identifier. More... |
| ||

Detailed Description

Enumeration Type Documentation

VideoCaptureAPIs

|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 枚举 cv::VideoCaptureAPIs |

#include <opencv2/videoio.hpp>

cv::VideoCapture 后端标识符。

枚举 数
CAP_ANY Python: cv.CAP_ANY Auto detect == 0.
CAP_VFW Python: cv.CAP_VFW Video For Windows (obsolete, removed)
CAP_V4L Python: cv.CAP_V4L 支持 V4L/V4L2 捕获。
CAP_V4L2 Python: cv.CAP_V4L2 与CAP_V4L相同。
CAP_FIREWIRE Python: cv.CAP_FIREWIRE IEEE 1394 驱动程序。
CAP_FIREWARE Python: cv.CAP_FIREWARE 与 CAP_FIREWIRE 值相同。
CAP_IEEE1394 Python: cv.CAP_IEEE1394 与 CAP_FIREWIRE 值相同。
CAP_DC1394 Python: cv.CAP_DC1394 与 CAP_FIREWIRE 值相同。
CAP_CMU1394 Python: cv.CAP_CMU1394 与 CAP_FIREWIRE 值相同。
CAP_QT Python: cv.CAP_QT QuickTime(已过时,已删除)
CAP_UNICAP Python: cv.CAP_UNICAP Unicap 驱动程序(已过时,已删除)
CAP_DSHOW Python: cv.CAP_DSHOW 直接显示(通过videoInput)
CAP_PVAPI Python: cv.CAP_PVAPI PvAPI, Prosilica GigE SDK.
CAP_OPENNI Python: cv.CAP_OPENNI OpenNI(用于 Kinect)
CAP_OPENNI_ASUS Python: cv.CAP_OPENNI_ASUS OpenNI (华硕 Xtion)
CAP_ANDROID Python: cv.CAP_ANDROID 适用于 Android 的 MediaNDK(API 级别 21+)和 NDK Camera(API 级别 24+)。
CAP_XIAPI Python: cv.CAP_XIAPI XIMEA 相机 API。
CAP_AVFOUNDATION Python: cv.CAP_AVFOUNDATION 适用于 iOS 的 AVFoundation 框架(OS X Lion 将具有相同的 API)
CAP_GIGANETIX Python: cv.CAP_GIGANETIX Smartek Giganetix GigEVisionSDK.
CAP_MSMF Python: cv.CAP_MSMF Microsoft Media Foundation(通过视频输入)。请参阅上面的平台特定说明。
CAP_WINRT Python: cv.CAP_WINRT 使用 Media Foundation 的 Microsoft Windows 运行时。
CAP_INTELPERC Python: cv.CAP_INTELPERC RealSense(前英特尔感知计算 SDK)
CAP_REALSENSE Python: cv.CAP_REALSENSE CAP_INTELPERC的同义词。
CAP_OPENNI2 Python: cv.CAP_OPENNI2 OpenNI2(用于 Kinect)
CAP_OPENNI2_ASUS Python: cv.CAP_OPENNI2_ASUS OpenNI2(适用于华硕 Xtion 和 Occipital Structure 传感器)
CAP_OPENNI2_ASTRA Python: cv.CAP_OPENNI2_ASTRA OpenNI2(用于 Orbbec Astra)
CAP_GPHOTO2 Python: cv.CAP_GPHOTO2 gPhoto2 连接
CAP_GSTREAMER Python: cv.CAP_GSTREAMER GStreamer.
CAP_FFMPEG Python: cv.CAP_FFMPEG Open and record video file or stream using the FFMPEG library.
CAP_IMAGES Python: cv.CAP_IMAGES OpenCV 图像序列(例如 img_%02d.jpg)
CAP_ARAVIS Python: cv.CAP_ARAVIS Aravis SDK.
CAP_OPENCV_MJPEG Python: cv.CAP_OPENCV_MJPEG 内置 OpenCV MotionJPEG 编解码器。
CAP_INTEL_MFX Python: cv.CAP_INTEL_MFX 英特尔 MediaSDK。
CAP_XINE Python: cv.CAP_XINE XINE引擎(Linux)
CAP_UEYE Python: cv.CAP_UEYE uEye相机API
CAP_OBSENSOR Python: cv.CAP_OBSENSOR 对于Orbbec 3D传感器设备/模块(Astra+、Femto、Astra2、Gemini2、Gemini2L、Gemini2XL、Femto Mega)注意:Astra2、Gemini2、Gemini2L相机目前仅支持不高于4.15的Windows和Linux内核版本,更高版本的Linux内核可能会有例外。

VideoCapture属性

|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 枚举 cv::VideoCaptureProperties |

#include <opencv2/videoio.hpp>

cv::VideoCapture 泛型属性标识符。

|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 枚举 cv::VideoCaptureProperties |

#include <opencv2/videoio.hpp>

cv::VideoCapture 泛型属性标识符。

读取/写入属性涉及许多层。沿着这条链可能会发生一些意想不到的结果。有效行为取决于设备硬件、驱动程序和 API 后端。

另请参阅

视频 I/O API 后端VideoCapture::get()VideoCapture::set() 的其他标志

枚举值
CAP_PROP_POS_MSEC Python: cv.CAP_PROP_POS_MSEC 视频文件的当前位置(以毫秒为单位)。
CAP_PROP_POS_FRAMES Python: cv.CAP_PROP_POS_FRAMES 接下来要解码/捕获的帧的从 0 开始的索引。当索引 i 在 RAW 模式 (CAP_PROP_FORMAT == -1) 中设置时,这将查找关键帧 k,其中 k <= i。
CAP_PROP_POS_AVI_RATIO Python: cv.CAP_PROP_POS_AVI_RATIO 视频文件的相对位置:0=影片开始,1=影片结束。
CAP_PROP_FRAME_WIDTH Python: cv.CAP_PROP_FRAME_WIDTH 视频流中的帧宽度。
CAP_PROP_FRAME_HEIGHT Python: cv.CAP_PROP_FRAME_HEIGHT 视频流中帧的高度。
CAP_PROP_FPS Python: cv.CAP_PROP_FPS 帧速率。
CAP_PROP_FOURCC Python: cv.CAP_PROP_FOURCC 编解码器的 4 个字符代码。请参阅 VideoWriter::fourcc
CAP_PROP_FRAME_COUNT Python: cv.CAP_PROP_FRAME_COUNT 视频文件中的帧数。
CAP_PROP_FORMAT Python: cv.CAP_PROP_FORMAT VideoCapture::retrieve()返回的 Mat 对象的格式(参见 Mat::type())。设置值 -1 以获取未解码的 RAW 视频流(如 Mat 8UC1)。
CAP_PROP_MODE Python: cv.CAP_PROP_MODE 指示当前捕获模式的后端特定值。
CAP_PROP_BRIGHTNESS Python: cv.CAP_PROP_BRIGHTNESS 图像的亮度(仅适用于支持的相机)。
CAP_PROP_CONTRAST Python: cv.CAP_PROP_CONTRAST 图像对比度(仅适用于相机)。
CAP_PROP_SATURATION Python: cv.CAP_PROP_SATURATION 图像饱和度(仅适用于相机)。
CAP_PROP_HUE Python: cv.CAP_PROP_HUE 图像的色调(仅适用于相机)。
CAP_PROP_GAIN Python: cv.CAP_PROP_GAIN 图像增益(仅适用于支持的相机)。
CAP_PROP_EXPOSURE Python: cv.CAP_PROP_EXPOSURE 曝光(仅适用于支持曝光的相机)。
CAP_PROP_CONVERT_RGB Python: cv.CAP_PROP_CONVERT_RGB 指示图像是否应转换为 RGB 的布尔标志。 GStreamer 注意:如果使用自定义管道,则忽略该标志。用户有责任解释管道输出。
CAP_PROP_WHITE_BALANCE_BLUE_U Python: cv.CAP_PROP_WHITE_BALANCE_BLUE_U 目前不受支持。
CAP_PROP_RECTIFICATION Python: cv.CAP_PROP_RECTIFICATION 立体摄像机的整改标志(注意:目前仅 DC1394 v 2.x 后端支持)。
CAP_PROP_MONOCHROME Python: cv.CAP_PROP_MONOCHROME
CAP_PROP_SHARPNESS Python: cv.CAP_PROP_SHARPNESS
CAP_PROP_AUTO_EXPOSURE Python: cv.CAP_PROP_AUTO_EXPOSURE DC1394:由相机完成曝光控制,用户可以使用此功能调整参考电平。
CAP_PROP_GAMMA Python: cv.CAP_PROP_GAMMA
CAP_PROP_TEMPERATURE Python: cv.CAP_PROP_TEMPERATURE
CAP_PROP_TRIGGER Python: cv.CAP_PROP_TRIGGER
CAP_PROP_TRIGGER_DELAY Python: cv.CAP_PROP_TRIGGER_DELAY
CAP_PROP_WHITE_BALANCE_RED_V Python: cv.CAP_PROP_WHITE_BALANCE_RED_V
CAP_PROP_ZOOM Python: cv.CAP_PROP_ZOOM
CAP_PROP_FOCUS Python: cv.CAP_PROP_FOCUS
CAP_PROP_GUID Python: cv.CAP_PROP_GUID
CAP_PROP_ISO_SPEED Python: cv.CAP_PROP_ISO_SPEED
CAP_PROP_BACKLIGHT Python: cv.CAP_PROP_BACKLIGHT
CAP_PROP_PAN Python: cv.CAP_PROP_PAN
CAP_PROP_TILT Python: cv.CAP_PROP_TILT
CAP_PROP_ROLL Python: cv.CAP_PROP_ROLL
CAP_PROP_IRIS Python: cv.CAP_PROP_IRIS
CAP_PROP_SETTINGS Python: cv.CAP_PROP_SETTINGS 弹出视频/摄像头过滤器对话框(注意:目前仅DSHOW后端支持。属性值将被忽略)
CAP_PROP_BUFFERSIZE Python: cv.CAP_PROP_BUFFERSIZE
CAP_PROP_AUTOFOCUS Python: cv.CAP_PROP_AUTOFOCUS
CAP_PROP_SAR_NUM Python: cv.CAP_PROP_SAR_NUM 采样纵横比:num/den (num)
CAP_PROP_SAR_DEN Python: cv.CAP_PROP_SAR_DEN 采样纵横比:num/den (den)
CAP_PROP_BACKEND Python: cv.CAP_PROP_BACKEND 当前后端(枚举 VideoCaptureAPI)。只读属性。
CAP_PROP_CHANNEL Python: cv.CAP_PROP_CHANNEL 视频输入或通道号(仅适用于支持的摄像机)
CAP_PROP_AUTO_WB Python: cv.CAP_PROP_AUTO_WB 启用/禁用自动白平衡
CAP_PROP_WB_TEMPERATURE Python: cv.CAP_PROP_WB_TEMPERATURE 白平衡色温
CAP_PROP_CODEC_PIXEL_FORMAT Python: cv.CAP_PROP_CODEC_PIXEL_FORMAT (只读)编解码器的像素格式。4 个字符的代码 - 请参阅 VideoWriter::fourccAV_PIX_FMT_* 或 -1(如果未知)的子集
CAP_PROP_BITRATE Python: cv.CAP_PROP_BITRATE (只读)视频比特率(kbits/s)
CAP_PROP_ORIENTATION_META Python: cv.CAP_PROP_ORIENTATION_META (只读)由流元定义的帧旋转(仅适用于 FFmpeg 和 AVFoundation 后端)
CAP_PROP_ORIENTATION_AUTO Python: cv.CAP_PROP_ORIENTATION_AUTO if true - 考虑视频文件的元数据(仅适用于 FFmpeg 和 AVFoundation 后端)旋转 CvCapture 的输出帧 (cv::VideoCapture ignores orientation metadata · Issue #15499 · opencv/opencv · GitHub)
CAP_PROP_HW_ACCELERATION Python: cv.CAP_PROP_HW_ACCELERATION (仅开放 )硬件加速类型(请参阅 VideoAccelerationType)。仅通过 cv::VideoCapture 构造函数 params 中的参数支持设置。open() 方法。默认值特定于后端。
CAP_PROP_HW_DEVICE Python: cv.CAP_PROP_HW_DEVICE (仅开放)硬件设备索引(如果有多个可用,请选择 GPU)。设备枚举特定于加速类型。
CAP_PROP_HW_ACCELERATION_USE_OPENCL Python: cv.CAP_PROP_HW_ACCELERATION_USE_OPENCL (仅开放 )如果不为零,则创建新的 OpenCL 上下文并将其绑定到当前线程。使用视频加速上下文创建的 OpenCL 上下文附加了它(如果尚未附加),以便在硬件加速解码器和 cv::UMat 之间优化 GPU 数据复制。
CAP_PROP_OPEN_TIMEOUT_MSEC Python: cv.CAP_PROP_OPEN_TIMEOUT_MSEC (仅开放)打开视频捕获的超时(以毫秒为单位)(仅适用于 FFmpeg 和 GStreamer 后端)
CAP_PROP_READ_TIMEOUT_MSEC Python: cv.CAP_PROP_READ_TIMEOUT_MSEC (仅开放)从视频捕获读取的超时(以毫秒为单位)(仅适用于 FFmpeg 和 GStreamer 后端)
CAP_PROP_STREAM_OPEN_TIME_USEC Python: cv.CAP_PROP_STREAM_OPEN_TIME_USEC (只读)自 1970 年 1 月 1 日打开流以来的时间(以微秒为单位)。仅适用于 FFmpeg 后端。对 RTSP 和其他实时流很有用
CAP_PROP_VIDEO_TOTAL_CHANNELS Python: cv.CAP_PROP_VIDEO_TOTAL_CHANNELS (只读)视频通道数
CAP_PROP_VIDEO_STREAM Python: cv.CAP_PROP_VIDEO_STREAM (仅开放)指定视频流,从 0 开始的索引。使用 -1 禁用来自文件或 IP 摄像机的视频流。默认值为 0。
CAP_PROP_AUDIO_STREAM Python: cv.CAP_PROP_AUDIO_STREAM (仅开放)在多语言媒体文件中指定流,-1 - 禁用音频处理或麦克风。默认值为 -1。
CAP_PROP_AUDIO_POS Python: cv.CAP_PROP_AUDIO_POS (只读)音频位置以样本为单位进行测量。先前抓取的片段的准确音频样本时间戳。请参阅CAP_PROP_AUDIO_SAMPLES_PER_SECOND和CAP_PROP_AUDIO_SHIFT_NSEC。
CAP_PROP_AUDIO_SHIFT_NSEC Python: cv.CAP_PROP_AUDIO_SHIFT_NSEC (只读)包含音频流开始时间与视频流之间的时间差(以纳秒为单位)。正值表示音频在第一个视频帧之后启动。负值表示音频在第一个视频帧之前启动。
CAP_PROP_AUDIO_DATA_DEPTH Python: cv.CAP_PROP_AUDIO_DATA_DEPTH (打开,读取)替代每个样本的比特数,但可以清晰地处理 32F / 32S
CAP_PROP_AUDIO_SAMPLES_PER_SECOND Python: cv.CAP_PROP_AUDIO_SAMPLES_PER_SECOND (打开、读取)由文件/编解码器输入确定。如果未指定,则选定的音频采样率为 44100
CAP_PROP_AUDIO_BASE_INDEX Python: cv.CAP_PROP_AUDIO_BASE_INDEX (只读).retrieve() 调用的第一个音频通道的索引。该音频通道编号在视频通道之后继续枚举。
CAP_PROP_AUDIO_TOTAL_CHANNELS Python: cv.CAP_PROP_AUDIO_TOTAL_CHANNELS (只读)所选音频流(单声道、立体声等)中的音频通道数
CAP_PROP_AUDIO_TOTAL_STREAMS Python: cv.CAP_PROP_AUDIO_TOTAL_STREAMS (只读)音频流数。
CAP_PROP_AUDIO_SYNCHRONIZE Python: cv.CAP_PROP_AUDIO_SYNCHRONIZE (打开,读取)启用音频同步。
CAP_PROP_LRF_HAS_KEY_FRAME Python: cv.CAP_PROP_LRF_HAS_KEY_FRAME 仅 FFmpeg 后端 - 指示在首次调用 VideoCapture::open(CAP_FFMPEG, {CAP_PROP_FORMAT, -1}) 或 VideoCapture::set(CAP_PROP_FORMAT,-1 初始化 VideoCapture 时从 VideoCapture::read() 输出的最后一个原始帧(LRF)是否包含关键帧的编码数据。
CAP_PROP_CODEC_EXTRADATA_INDEX Python: cv.CAP_PROP_CODEC_EXTRADATA_INDEX 正指数表示视频后端支持返回额外数据。这可以作为 cap.retrieve(data, <returned index>) 进行检索。例如,当从 h264 编码的 RTSP 流中读取时,FFmpeg 后端可以从对 cap.retrieve(data, <returned index>) 的调用中返回 SPS 和/或 PPS(如果可用)(如果作为回复 DESCRIBE 请求而发送)。
CAP_PROP_FRAME_TYPE Python: cv.CAP_PROP_FRAME_TYPE (只读)仅限 FFmpeg 后端 - 最近读取的帧的帧类型 ascii 代码(73 = 'I', 80 = 'P', 66 = 'B' 或 63 = '?,如果未知)。
CAP_PROP_N_THREADS Python: cv.CAP_PROP_N_THREADS (仅开放)设置要使用的最大线程数。使用 0 可使用与 CPU 内核一样多的线程(仅适用于 FFmpeg 后端)。

VideoWriter属性

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 枚举 cv::VideoWriterProperties |

#include <opencv2/videoio.hpp>

cv::VideoWriter 泛型属性标识符。

另请参阅

VideoWriter::get(), VideoWriter::set()

枚举数
VIDEOWRITER_PROP_QUALITY Python: cv.VIDEOWRITER_PROP_QUALITY 编码视频流的当前质量 (0..100%)。可以在某些编解码器中动态调整。
VIDEOWRITER_PROP_FRAMEBYTES Python: cv.VIDEOWRITER_PROP_FRAMEBYTES (只读):刚刚编码的视频帧的大小。请注意,编码顺序可能与表示顺序不同。
VIDEOWRITER_PROP_NSTRIPES Python: cv.VIDEOWRITER_PROP_NSTRIPES 用于并行编码的条带数。-1 用于自动检测。
VIDEOWRITER_PROP_IS_COLOR Python: cv.VIDEOWRITER_PROP_IS_COLOR 如果不为零,编码器将期望并编码颜色帧,否则它将使用灰度帧。
VIDEOWRITER_PROP_DEPTH Python: cv.VIDEOWRITER_PROP_DEPTH 默认值为 CV_8U
VIDEOWRITER_PROP_HW_ACCELERATION Python: cv.VIDEOWRITER_PROP_HW_ACCELERATION (仅开放 )硬件加速类型(请参阅 VideoAccelerationType)。仅通过 VideoWriter 构造函数 params中的参数支持设置。open() 方法。默认值特定于后端。
VIDEOWRITER_PROP_HW_DEVICE Python: cv.VIDEOWRITER_PROP_HW_DEVICE (仅开放)硬件设备索引(如果有多个可用,请选择 GPU)。设备枚举特定于加速类型。
VIDEOWRITER_PROP_HW_ACCELERATION_USE_OPENCL Python: cv.VIDEOWRITER_PROP_HW_ACCELERATION_USE_OPENCL (仅开放 )如果不为零,则创建新的 OpenCL 上下文并将其绑定到当前线程。使用视频加速上下文创建的 OpenCL 上下文附加了它(如果尚未附加),以便在 cv::UMat 和硬件加速编码器之间优化 GPU 数据复制。
VIDEOWRITER_PROP_RAW_VIDEO Python: cv.VIDEOWRITER_PROP_RAW_VIDEO (仅开放 )设置为非零可启用编码的原始视频流的封装。每个原始编码的视频帧都应作为CV_8UC1的单行或单列传递给 VideoWriter::write()。 注意 如果关键帧间隔不是 1,则必须由用户手动指定。这可以在初始化期间执行,将VIDEOWRITER_PROP_KEY_INTERVAL作为额外的编码器参数之一传递给 VideoWriter::VideoWriter(const String &, int, double, const Size &, const std::vector< int > &params),或者在写入每一帧之前使用 VideoWriter::set() 设置VIDEOWRITER_PROP_KEY_FLAG。仅限 FFMpeg 后端。
VIDEOWRITER_PROP_KEY_INTERVAL Python: cv.VIDEOWRITER_PROP_KEY_INTERVAL (仅开放 )使用原始视频封装 (VIDEOWRITER_PROP_RAW_VIDEO != 0) 设置关键帧间隔。未设置时默认为 1。仅限 FFMpeg 后端。
VIDEOWRITER_PROP_KEY_FLAG Python: cv.VIDEOWRITER_PROP_KEY_FLAG 设置为非零表示以下帧是关键帧,如果不是关键帧,则设置为零,在封装原始视频时 (VIDEOWRITER_PROP_RAW_VIDEO != 0)。仅限 FFMpeg 后端。

参考文献:

1、《Flags for video I/O》

相关推荐
昨日之日200627 分钟前
Moonshine - 新型开源ASR(语音识别)模型,体积小,速度快,比OpenAI Whisper快五倍 本地一键整合包下载
人工智能·whisper·语音识别
浮生如梦_29 分钟前
Halcon基于laws纹理特征的SVM分类
图像处理·人工智能·算法·支持向量机·计算机视觉·分类·视觉检测
深度学习lover31 分钟前
<项目代码>YOLOv8 苹果腐烂识别<目标检测>
人工智能·python·yolo·目标检测·计算机视觉·苹果腐烂识别
热爱跑步的恒川1 小时前
【论文复现】基于图卷积网络的轻量化推荐模型
网络·人工智能·开源·aigc·ai编程
捕鲸叉3 小时前
创建线程时传递参数给线程
开发语言·c++·算法
A charmer3 小时前
【C++】vector 类深度解析:探索动态数组的奥秘
开发语言·c++·算法
Peter_chq3 小时前
【操作系统】基于环形队列的生产消费模型
linux·c语言·开发语言·c++·后端
阡之尘埃3 小时前
Python数据分析案例61——信贷风控评分卡模型(A卡)(scorecardpy 全面解析)
人工智能·python·机器学习·数据分析·智能风控·信贷风控
青花瓷4 小时前
C++__XCode工程中Debug版本库向Release版本库的切换
c++·xcode
孙同学要努力5 小时前
全连接神经网络案例——手写数字识别
人工智能·深度学习·神经网络