| VideoCaptureOpen Method (String, VideoCaptureAPIs) |
Opens a video file or a capturing device or an IP video stream for video capturing.
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax public bool Open(
string fileName,
VideoCaptureAPIs apiPreference = VideoCaptureAPIs.ANY
)
Public Function Open (
fileName As String,
Optional apiPreference As VideoCaptureAPIs = VideoCaptureAPIs.ANY
) As Boolean
public:
bool Open(
String^ fileName,
VideoCaptureAPIs apiPreference = VideoCaptureAPIs::ANY
)
member Open :
fileName : string *
?apiPreference : VideoCaptureAPIs
(* Defaults:
let _apiPreference = defaultArg apiPreference VideoCaptureAPIs.ANY
*)
-> bool
Parameters
- fileName
- Type: SystemString
it can be:
- name of video file (eg. `video.avi`)
- or image sequence (eg. `img_%02d.jpg`, which will read samples like `img_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. - apiPreference (Optional)
- Type: OpenCvSharpVideoCaptureAPIs
apiPreference 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.
Return Value
Type:
Boolean`true` if the file has been successfully opened
See Also