VideoCapture
VideoCapture
#include <icy/av/videocapture.h>Inherits:
MediaCapture
Cross-platform video device capturer backed by FFmpeg avdevice.
Public Methods
| Return | Name | Description |
|---|---|---|
VideoCapture | Construct without opening a device. Call openVideo() before start(). | |
VideoCapture | Construct and immediately open the given video device using a VideoCodec params struct. | |
VideoCapture | Construct and immediately open the given video device with individual parameters. | |
void | openVideo virtual | Open the given video device using a VideoCodec params struct. |
void | openVideo virtual | Open the given video device with individual parameters. Configures the FFmpeg input format and passes device options via AVDictionary. If the device cannot satisfy the requested parameters, pixel format conversion and scaling will be applied by the decoder. |
VideoCapture
VideoCapture()Construct without opening a device. Call openVideo() before start().
VideoCapture
VideoCapture(const std::string & device, const av::VideoCodec & params)Construct and immediately open the given video device using a VideoCodec params struct.
Parameters
deviceThe platform video device identifier (e.g. "/dev/video0" or "0" on Windows).paramsThe desired capture parameters (width, height, fps, pixel format).
VideoCapture
VideoCapture(const std::string & device, int width, int height, double framerate, const std::string & pixelFmt)Construct and immediately open the given video device with individual parameters.
Parameters
deviceThe platform video device identifier.widthThe desired frame width in pixels, or 0 for device default.heightThe desired frame height in pixels, or 0 for device default.framerateThe desired frame rate, or 0 for device default.pixelFmtThe desired pixel format string, or "" for "yuv420p".
openVideo
virtual
virtual void openVideo(const std::string & device, const av::VideoCodec & params)Open the given video device using a VideoCodec params struct.
Parameters
deviceThe platform video device identifier.paramsThe desired capture parameters.
openVideo
virtual
virtual void openVideo(const std::string & device, int width, int height, double framerate, const std::string & pixelFmt)Open the given video device with individual parameters. Configures the FFmpeg input format and passes device options via AVDictionary. If the device cannot satisfy the requested parameters, pixel format conversion and scaling will be applied by the decoder.
Parameters
deviceThe platform video device identifier.widthThe desired frame width in pixels, or 0 for device default.heightThe desired frame height in pixels, or 0 for device default.framerateThe desired frame rate, or 0 for device default.pixelFmtThe desired pixel format string, or "" for "yuv420p".
Public Types
| Name | Description |
|---|---|
Ptr |
Ptr
std::shared_ptr< VideoCapture > Ptr()