Table of Contents

Method FromFile

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

FromFile(string, VideoCaptureAPIs)

Opens a video file or a capturing device or an IP video stream for video capturing with API Preference

public static VideoCapture FromFile(string fileName, VideoCaptureAPIs apiPreference = VideoCaptureAPIs.ANY)

Parameters

fileName string

it can be: - name of video file (e.g. video.avi) - or image sequence (e.g. img_%02d.jpg, which will read samples like img_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.

apiPreference VideoCaptureAPIs

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.

Returns

VideoCapture