From 4287961aedac67b14042bb050a4f753880566119 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 7 Mar 2021 04:19:26 +0000 Subject: [PATCH] videoio(doc): add 'videoio_hwaccel' group, fix typos --- doc/tutorials/app/video_write.markdown | 2 +- modules/videoio/doc/videoio_overview.markdown | 6 ++-- modules/videoio/include/opencv2/videoio.hpp | 20 ++++++++--- .../opencv2/videoio/doc/hwaccel.doc.hpp | 34 +++++++++++++++++++ .../cpp/videocapture_gstreamer_pipeline.cpp | 2 +- 5 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 modules/videoio/include/opencv2/videoio/doc/hwaccel.doc.hpp diff --git a/doc/tutorials/app/video_write.markdown b/doc/tutorials/app/video_write.markdown index bcd288b960..d655e24b89 100644 --- a/doc/tutorials/app/video_write.markdown +++ b/doc/tutorials/app/video_write.markdown @@ -66,7 +66,7 @@ extension, its first version. A direct limitation of this is that you cannot sav larger than 2 GB. Furthermore you can only create and expand a single video track inside the container. No audio or other track editing support here. Nevertheless, any video codec present on your system might work. If you encounter some of these limitations you will need to look into more -specialized video writing libraries such as *FFMpeg* or codecs as *HuffYUV*, *CorePNG* and *LCL*. As +specialized video writing libraries such as *FFmpeg* or codecs as *HuffYUV*, *CorePNG* and *LCL*. As an alternative, create the video track with OpenCV and expand it with sound tracks or convert it to other formats by using video manipulation programs such as *VirtualDub* or *AviSynth*. diff --git a/modules/videoio/doc/videoio_overview.markdown b/modules/videoio/doc/videoio_overview.markdown index ebcfc57330..310c229811 100644 --- a/modules/videoio/doc/videoio_overview.markdown +++ b/modules/videoio/doc/videoio_overview.markdown @@ -3,7 +3,7 @@ Video I/O with OpenCV Overview {#videoio_overview} ### See also: - @ref videoio "Video I/O Code Reference" - - Tutorials: @ref tutorial_table_of_content_videoio + - Tutorials: @ref tutorial_table_of_content_app General Information =================== @@ -15,7 +15,7 @@ I/O APIs used as backend. ![Video I/O with OpenCV](pics/videoio_overview.svg) -Some backends such as (DSHOW) Direct Show, Microsoft Media Foundation (MSMF), +Some backends such as Direct Show (DSHOW), Microsoft Media Foundation (MSMF), Video 4 Linux (V4L), etc... are interfaces to the video I/O library provided by the operating system. Some others backends like OpenNI2 for Kinect, Intel Perceptual Computing SDK, GStreamer, @@ -90,7 +90,7 @@ The FFmpeg library OpenCV can use the FFmpeg library (http://ffmpeg.org/) as backend to record, convert and stream audio and video. FFmpeg is a complete, cross-reference solution. If you enable FFmpeg while configuring OpenCV than CMake will download and install the binaries in `OPENCV_SOURCE_CODE/3rdparty/ffmpeg/`. To use -FFmpeg at runtime, you must deploy the FFMepg binaries with your application. +FFmpeg at runtime, you must deploy the FFmpeg binaries with your application. @note FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later. See `OPENCV_SOURCE_CODE/3rdparty/ffmpeg/readme.txt` and http://ffmpeg.org/legal.html for details and diff --git a/modules/videoio/include/opencv2/videoio.hpp b/modules/videoio/include/opencv2/videoio.hpp index ad0017f51f..b7de247a1c 100644 --- a/modules/videoio/include/opencv2/videoio.hpp +++ b/modules/videoio/include/opencv2/videoio.hpp @@ -52,10 +52,11 @@ ### See also: - @ref videoio_overview - - Tutorials: @ref tutorial_table_of_content_videoio + - Tutorials: @ref tutorial_table_of_content_app @{ @defgroup videoio_flags_base Flags for video I/O @defgroup videoio_flags_others Additional flags for video I/O API backends + @defgroup videoio_hwaccel Hardware-accelerated video decoding and encoding @defgroup videoio_c C API for video I/O @defgroup videoio_ios iOS glue for video I/O @defgroup videoio_winrt WinRT glue for video I/O @@ -211,6 +212,10 @@ enum VideoWriterProperties { //! @addtogroup videoio_flags_others //! @{ +/** @name Hardware acceleration support + @{ +*/ + /** @brief Video Acceleration type * * Used as value in #CAP_PROP_HW_ACCELERATION and #VIDEOWRITER_PROP_HW_ACCELERATION @@ -231,6 +236,8 @@ enum VideoAccelerationType VIDEO_ACCELERATION_MFX = 4, //!< libmfx (Intel MediaSDK/oneVPL) }; +//! @} Hardware acceleration support + /** @name IEEE 1394 drivers @{ */ @@ -521,8 +528,9 @@ enum { CAP_PROP_XI_DOWNSAMPLING = 400, //!< Chan //! @} XIMEA -/** @name XIMEA Camera API -* @{ + +/** @name ARAVIS Camera API + @{ */ //! Properties of cameras available through ARAVIS backend @@ -532,7 +540,6 @@ enum { CAP_PROP_ARAVIS_AUTOTRIGGER = 600 //!< Autom //! @} ARAVIS /** @name AVFoundation framework for iOS - OS X Lion will have the same API @{ */ @@ -544,6 +551,9 @@ enum { CAP_PROP_IOS_DEVICE_FOCUS = 9001, CAP_PROP_IOS_DEVICE_TORCH = 9005 }; +//! @} AVFoundation framework for iOS + + /** @name Smartek Giganetix GigEVisionSDK @{ */ @@ -1089,8 +1099,10 @@ protected: Size frameSize, bool isColor = true); }; +//! @cond IGNORED template<> struct DefaultDeleter{ CV_EXPORTS void operator ()(CvCapture* obj) const; }; template<> struct DefaultDeleter{ CV_EXPORTS void operator ()(CvVideoWriter* obj) const; }; +//! @endcond IGNORED //! @} videoio diff --git a/modules/videoio/include/opencv2/videoio/doc/hwaccel.doc.hpp b/modules/videoio/include/opencv2/videoio/doc/hwaccel.doc.hpp new file mode 100644 index 0000000000..3b03aece35 --- /dev/null +++ b/modules/videoio/include/opencv2/videoio/doc/hwaccel.doc.hpp @@ -0,0 +1,34 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// +// This file should not be used with compiler (documentation only) +// + +namespace cv { +/** @addtogroup videoio_hwaccel +This section contains information about API to control Hardware-accelerated video decoding and encoding. + +@note Check [Wiki page](https://github.com/opencv/opencv/wiki/Video-IO-hardware-acceleration) +for description of supported hardware / software configurations and available benchmarks + +cv::VideoCapture properties: +- #CAP_PROP_HW_ACCELERATION (as #VideoAccelerationType) +- #CAP_PROP_HW_DEVICE + +cv::VideoWriter properties: +- #VIDEOWRITER_PROP_HW_ACCELERATION (as #VideoAccelerationType) +- #VIDEOWRITER_PROP_HW_DEVICE + +Properties are supported by these backends: + +- #CAP_FFMPEG +- #CAP_GSTREAMER +- #CAP_MSMF (Windows) + +@{ + */ + +/** @} */ +} // namespace diff --git a/samples/cpp/videocapture_gstreamer_pipeline.cpp b/samples/cpp/videocapture_gstreamer_pipeline.cpp index 9507eb3c90..ed9d6fd334 100644 --- a/samples/cpp/videocapture_gstreamer_pipeline.cpp +++ b/samples/cpp/videocapture_gstreamer_pipeline.cpp @@ -223,7 +223,7 @@ inline Ptr createWriter(const string &backend, const string &file_n } else if (backend == "ffmpeg") { - cout << "Created FFMpeg writer ( " << file_name << ", FPS=" << fps << ", Size=" << sz << " )" << endl; + cout << "Created FFmpeg writer ( " << file_name << ", FPS=" << fps << ", Size=" << sz << " )" << endl; return makePtr(file_name, CAP_FFMPEG, getValue(fourccByCodec(), codec, "Invalid codec"), fps, sz, true); } return Ptr();