Docs: updated videoio module overview

pull/14514/head
Maksim Shabunin 6 years ago
parent b2abd8ca41
commit bcf7286ad9
  1. 19
      modules/videoio/doc/videoio_overview.markdown
  2. 4
      modules/videoio/include/opencv2/videoio/registry.hpp

@ -57,17 +57,20 @@ cap.open(filename, cv::CAP_DSHOW);
@sa cv::VideoCapture::open() , cv::VideoCapture::VideoCapture() @sa cv::VideoCapture::open() , cv::VideoCapture::VideoCapture()
#### Enable backends #### How to enable backends
Backends are available only if they have been built with your OpenCV binaries. There are two kinds of videoio backends: built-in backends and plugins which will be loaded at runtime (since OpenCV 4.1.0). Use functions cv::videoio_registry::getBackends, cv::videoio_registry::hasBackend and cv::videoio_registry::getBackendName to check actual presence of backend during runtime.
Check in `opencv2/cvconfig.h` to know which APIs are currently available To enable built-in videoio backends:
(e.g. `HAVE_MSMF, HAVE_V4L2`, etc...). 1. Enable corresponding CMake option, e.g. `-DWITH_GSTREAMER=ON`
2. Rebuild OpenCV
To enable/disable APIs, you have to: To enable dynamically-loaded videoio backend (currently supported: GStreamer and FFmpeg on Linux, MediaSDK on Linux and Windows):
1. re-configure OpenCV using appropriates CMake switches 1. Enable backend and add it to the list of plugins: `-DWITH_GSTREAMER=ON -DVIDEOIO_PLUGIN_LIST=gstreamer` CMake options
(e.g. `-DWITH_MSMF=ON -DWITH_DSHOW=ON ... `) or checking related switch in cmake-gui 2. Rebuild OpenCV
2. rebuild OpenCV itself 3. Check that `libopencv_videoio_gstreamer.so` library exists in the `lib` directory
@note Don't forget to clean CMake cache when switching between these two modes
#### Use 3rd party drivers or cameras #### Use 3rd party drivers or cameras

@ -21,12 +21,12 @@ Runtime configuration options:
*/ */
/** @brief Returns backend API name or "unknown" /** @brief Returns backend API name or "UnknownVideoAPI(xxx)"
@param api backend ID (#VideoCaptureAPIs) @param api backend ID (#VideoCaptureAPIs)
*/ */
CV_EXPORTS_W cv::String getBackendName(VideoCaptureAPIs api); CV_EXPORTS_W cv::String getBackendName(VideoCaptureAPIs api);
/** @brief Returns list of all builtin backends */ /** @brief Returns list of all available backends */
CV_EXPORTS_W std::vector<VideoCaptureAPIs> getBackends(); CV_EXPORTS_W std::vector<VideoCaptureAPIs> getBackends();
/** @brief Returns list of available backends which works via `cv::VideoCapture(int index)` */ /** @brief Returns list of available backends which works via `cv::VideoCapture(int index)` */

Loading…
Cancel
Save