AV module

VideoCapture

Cross-platform video device capturer backed by FFmpeg avdevice.

VideoCapture

#include <icy/av/videocapture.h>

Inherits: MediaCapture

Cross-platform video device capturer backed by FFmpeg avdevice.

Public Methods

ReturnNameDescription
VideoCaptureConstruct without opening a device. Call openVideo() before start().
VideoCaptureConstruct and immediately open the given video device using a VideoCodec params struct.
VideoCaptureConstruct and immediately open the given video device with individual parameters.
voidopenVideo virtualOpen the given video device using a VideoCodec params struct.
voidopenVideo virtualOpen 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

  • device The platform video device identifier (e.g. "/dev/video0" or "0" on Windows).

  • params The 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

  • device The platform video device identifier.

  • width The desired frame width in pixels, or 0 for device default.

  • height The desired frame height in pixels, or 0 for device default.

  • framerate The desired frame rate, or 0 for device default.

  • pixelFmt The 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

  • device The platform video device identifier.

  • params The 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

  • device The platform video device identifier.

  • width The desired frame width in pixels, or 0 for device default.

  • height The desired frame height in pixels, or 0 for device default.

  • framerate The desired frame rate, or 0 for device default.

  • pixelFmt The desired pixel format string, or "" for "yuv420p".

Public Types

NameDescription
Ptr

Ptr

std::shared_ptr< VideoCapture > Ptr()