Constructor VideoCapture
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
VideoCapture()
Initializes empty capture. To use this, you should call Open.
public VideoCapture()
VideoCapture(int, VideoCaptureAPIs)
Opens a camera for video capturing
public VideoCapture(int index, VideoCaptureAPIs apiPreference = VideoCaptureAPIs.ANY)
Parameters
indexintid of the video capturing device to open. To open default camera using default backend just pass 0. (to backward compatibility usage of camera_id + domain_offset (CAP_*) is valid when apiPreference is CAP_ANY)
apiPreferenceVideoCaptureAPIspreferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_DSHOW or cv::CAP_MSMF or cv::CAP_V4L.
VideoCapture(int, VideoCaptureAPIs, int[])
Opens a camera for video capturing with API Preference and parameters
public VideoCapture(int index, VideoCaptureAPIs apiPreference, int[] prms)
Parameters
indexintid of the video capturing device to open. To open default camera using default backend just pass 0. (to backward compatibility usage of camera_id + domain_offset (CAP_*) is valid when apiPreference is CAP_ANY)
apiPreferenceVideoCaptureAPIspreferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_DSHOW or cv::CAP_MSMF or cv::CAP_V4L.
prmsint[]The
paramsparameter allows to specify extra parameters encoded as pairs(paramId_1, paramValue_1, paramId_2, paramValue_2, ...). See cv::VideoCaptureProperties
VideoCapture(int, VideoCaptureAPIs, VideoCapturePara)
Opens a camera for video capturing with API Preference and parameters
public VideoCapture(int index, VideoCaptureAPIs apiPreference, VideoCapturePara prms)
Parameters
indexintid of the video capturing device to open. To open default camera using default backend just pass 0. (to backward compatibility usage of camera_id + domain_offset (CAP_*) is valid when apiPreference is CAP_ANY)
apiPreferenceVideoCaptureAPIspreferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_DSHOW or cv::CAP_MSMF or cv::CAP_V4L.
prmsVideoCaptureParaParameters of VideoCapture for hardware acceleration
VideoCapture(IStreamReader, VideoCaptureAPIs, int[])
Opens a video using a custom data stream.
public VideoCapture(IStreamReader source, VideoCaptureAPIs apiPreference, int[] prms)
Parameters
sourceIStreamReaderCustom stream reader providing the encoded video data.
apiPreferenceVideoCaptureAPIspreferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG.
prmsint[]The
paramsparameter allows to specify extra parameters encoded as pairs(paramId_1, paramValue_1, paramId_2, paramValue_2, ...). See cv::VideoCaptureProperties
VideoCapture(IStreamReader, VideoCaptureAPIs, VideoCapturePara)
Opens a video using a custom data stream.
public VideoCapture(IStreamReader source, VideoCaptureAPIs apiPreference, VideoCapturePara prms)
Parameters
sourceIStreamReaderCustom stream reader providing the encoded video data.
apiPreferenceVideoCaptureAPIspreferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG.
prmsVideoCaptureParaParameters of VideoCapture for hardware acceleration
VideoCapture(Stream, VideoCaptureAPIs, int[])
Opens a video using an in-memory or otherwise custom Stream (e.g. a MemoryStream or network stream). The caller remains responsible for disposing the stream; VideoCapture does not take ownership of it.
public VideoCapture(Stream source, VideoCaptureAPIs apiPreference, int[] prms)
Parameters
sourceStreamStream providing the encoded video data.
apiPreferenceVideoCaptureAPIspreferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG.
prmsint[]The
paramsparameter allows to specify extra parameters encoded as pairs(paramId_1, paramValue_1, paramId_2, paramValue_2, ...). See cv::VideoCaptureProperties
VideoCapture(Stream, VideoCaptureAPIs, VideoCapturePara)
Opens a video using an in-memory or otherwise custom Stream (e.g. a MemoryStream or network stream). The caller remains responsible for disposing the stream; VideoCapture does not take ownership of it.
public VideoCapture(Stream source, VideoCaptureAPIs apiPreference, VideoCapturePara prms)
Parameters
sourceStreamStream providing the encoded video data.
apiPreferenceVideoCaptureAPIspreferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG.
prmsVideoCaptureParaParameters of VideoCapture for hardware acceleration
VideoCapture(string, VideoCaptureAPIs)
Opens a video file or a capturing device or an IP video stream for video capturing with API Preference
public VideoCapture(string fileName, VideoCaptureAPIs apiPreference = VideoCaptureAPIs.ANY)
Parameters
fileNamestringit can be: - name of video file (e.g.
video.avi) - or image sequence (e.g.img_%02d.jpg, which will read samples likeimg_00.jpg, img_01.jpg, img_02.jpg, ...) - or URL of video stream (e.g.protocol://host:port/script_name?script_params|auth). Note that each video stream or IP camera feed has its own URL scheme. Please refer to the documentation of source stream to know the right URL. On Windows, a path containing characters that can't be represented in the process's ANSI code page may fail to open here even though the file exists; use the Stream-based constructor instead (e.g. wrap the path in a FileStream) to open it via Unicode file APIs.apiPreferenceVideoCaptureAPIsapiPreference preferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW.
VideoCapture(string, VideoCaptureAPIs, int[])
Opens a video file or a capturing device or an IP video stream for video capturing with API Preference
public VideoCapture(string fileName, VideoCaptureAPIs apiPreference, int[] prms)
Parameters
fileNamestringit can be: - name of video file (eg.
video.avi) - or image sequence (eg.img_%02d.jpg, which will read samples likeimg_00.jpg, img_01.jpg, img_02.jpg, ...) - or URL of video stream (eg.protocol://host:port/script_name?script_params|auth). Note that each video stream or IP camera feed has its own URL scheme. Please refer to the documentation of source stream to know the right URL. On Windows, a path containing characters that can't be represented in the process's ANSI code page may fail to open here even though the file exists; use the Stream-based constructor instead (e.g. wrap the path in a FileStream) to open it via Unicode file APIs.apiPreferenceVideoCaptureAPIsapiPreference preferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW.
prmsint[]The
paramsparameter allows to specify extra parameters encoded as pairs(paramId_1, paramValue_1, paramId_2, paramValue_2, ...). See cv::VideoCaptureProperties
VideoCapture(string, VideoCaptureAPIs, VideoCapturePara)
Opens a video file or a capturing device or an IP video stream for video capturing with API Preference
public VideoCapture(string fileName, VideoCaptureAPIs apiPreference, VideoCapturePara prms)
Parameters
fileNamestringit can be: - name of video file (e.g.
video.avi) - or image sequence (e.g.img_%02d.jpg, which will read samples likeimg_00.jpg, img_01.jpg, img_02.jpg, ...) - or URL of video stream (e.g.protocol://host:port/script_name?script_params|auth). Note that each video stream or IP camera feed has its own URL scheme. Please refer to the documentation of source stream to know the right URL.apiPreferenceVideoCaptureAPIsapiPreference preferred Capture API backends to use. Can be used to enforce a specific reader implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW.
prmsVideoCaptureParaParameters of VideoCature for hardware acceleration
VideoCapture(nint)
Initializes from native pointer
protected VideoCapture(nint ptr)
Parameters
ptrnintCvCapture*