VideoCapture
VideoCapture
#include <icy/av/videocapture.h>class VideoCaptureDefined in src/av/include/icy/av/videocapture.h:26
Inherits:
MediaCapture
Cross-platform video device capturer backed by FFmpeg avdevice.
List of all members
| Name | Kind | Owner |
|---|---|---|
VideoCapture | function | Declared here |
VideoCapture | function | Declared here |
VideoCapture | function | Declared here |
~VideoCapture | function | Declared here |
openVideo | function | Declared here |
openVideo | function | Declared here |
Ptr | typedef | Declared here |
Closing | variable | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
~MediaCapture | function | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
operator= | function | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
operator= | function | Inherited from MediaCapture |
openFile | function | Inherited from MediaCapture |
close | function | Inherited from MediaCapture |
start | function | Inherited from MediaCapture |
stop | function | Inherited from MediaCapture |
run | function | Inherited from MediaCapture |
getEncoderFormat | function | Inherited from MediaCapture |
getEncoderAudioCodec | function | Inherited from MediaCapture |
getEncoderVideoCodec | function | Inherited from MediaCapture |
setLoopInput | function | Inherited from MediaCapture |
setLimitFramerate | function | Inherited from MediaCapture |
setRealtimePTS | function | Inherited from MediaCapture |
setOpenOptions | function | Inherited from MediaCapture |
setPassthroughVideo | function | Inherited from MediaCapture |
formatCtx | function | Inherited from MediaCapture |
video | function | Inherited from MediaCapture |
audio | function | Inherited from MediaCapture |
stopping | function | Inherited from MediaCapture |
error | function | Inherited from MediaCapture |
_mutex | variable | Inherited from MediaCapture |
_thread | variable | Inherited from MediaCapture |
_formatCtx | variable | Inherited from MediaCapture |
_video | variable | Inherited from MediaCapture |
_audio | variable | Inherited from MediaCapture |
_error | variable | Inherited from MediaCapture |
_stopping | variable | Inherited from MediaCapture |
_looping | variable | Inherited from MediaCapture |
_realtime | variable | Inherited from MediaCapture |
_ratelimit | variable | Inherited from MediaCapture |
_passthroughVideo | variable | Inherited from MediaCapture |
_openOptions | variable | Inherited from MediaCapture |
_videoStream | variable | Inherited from MediaCapture |
openStream | function | Inherited from MediaCapture |
emit | function | Inherited from MediaCapture |
Ptr | typedef | Inherited from MediaCapture |
emitter | variable | Inherited from ICapture |
ICapture | function | Inherited from ICapture |
~ICapture | function | Inherited from ICapture |
start | function | Inherited from ICapture |
stop | function | Inherited from ICapture |
openFile | function | Inherited from ICapture |
close | function | Inherited from ICapture |
getEncoderFormat | function | Inherited from ICapture |
getEncoderAudioCodec | function | Inherited from ICapture |
getEncoderVideoCodec | function | Inherited from ICapture |
openAudio | function | Inherited from ICapture |
openVideo | function | Inherited from ICapture |
onStreamStateChange | function | Inherited from ICapture |
openStream | function | Inherited from ICapture |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
start | function | Inherited from Startable |
stop | function | Inherited from Startable |
Runnable | function | Inherited from Runnable |
~Runnable | function | Inherited from Runnable |
run | function | Inherited from Runnable |
cancel | function | Inherited from Runnable |
cancelled | function | Inherited from Runnable |
exit | variable | Inherited from Runnable |
Inherited from MediaCapture
| Kind | Name | Description |
|---|---|---|
variable | Closing | Signals that the capture thread is closing. This signal is emitted from the capture thread context. |
function | MediaCapture | |
function | ~MediaCapture noexcept override | |
function | MediaCapture | Deleted constructor. |
function | operator= | Deleted assignment operator. |
function | MediaCapture | Deleted constructor. |
function | operator= | Deleted assignment operator. |
function | openFile virtual override | Open a media file for decoding. Automatically detects video and audio streams. |
function | close virtual override | Stop the capture thread and close the media stream and all decoders. |
function | start virtual override | Start the background capture and decode thread. Throws std::runtime_error if no media streams have been opened. |
function | stop virtual override | Signal the capture thread to stop and join it before returning. |
function | run virtual override | Entry point for the background capture thread. Reads and decodes packets from the format context until EOF or stop() is called. |
function | getEncoderFormat virtual override | Fill format with the combined encoder-ready video and audio codec parameters. |
function | getEncoderAudioCodec virtual override | Fill params with the decoder's output audio codec parameters. Throws std::runtime_error if audio parameters have not been initialised. |
function | getEncoderVideoCodec virtual override | Fill params with the decoder's output video codec parameters. Throws std::runtime_error if video parameters have not been initialised. |
function | setLoopInput | Continuously loop the input file when set. |
function | setLimitFramerate | Limit playback to video FPS. |
function | setRealtimePTS | Set to use realtime PTS calculation. This is preferred when using live captures as FFmpeg-provided values are not always reliable. |
function | setOpenOptions | Set demuxer options applied at the next openFile() call. Keys map to libavformat AVOption entries (e.g. "rtsp_transport", "fflags", "analyzeduration", "probesize"). Useful for live network sources that need low-latency hints. Pass an empty map to clear. |
function | setPassthroughVideo | Skip the video decoder. Encoded video AVPackets from the input stream are emitted directly as [av::VideoPacket](icy-av-VideoPacket.html#videopacket) without decoding. The emitted packets carry the source's encoded payload and a time in microseconds rescaled from the stream's timebase. The iframe flag is set from AV_PKT_FLAG_KEY. |
function | formatCtx const | |
function | video const | |
function | audio const | |
function | stopping const | |
function | error const | |
variable | _mutex | |
variable | _thread | |
variable | _formatCtx | |
variable | _video | |
variable | _audio | |
variable | _error | |
variable | _stopping | |
variable | _looping | |
variable | _realtime | |
variable | _ratelimit | |
variable | _passthroughVideo | |
variable | _openOptions | |
variable | _videoStream | |
function | openStream virtual override | Open the underlying media stream. |
function | emit virtual override | Emit an existing packet directly onto the outgoing signal. |
typedef | Ptr |
Inherited from ICapture
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
function | ICapture inline | |
function | ~ICapture virtual | Defaulted destructor. |
function | start virtual override | Start capturing and emitting packets. |
function | stop virtual override | Stop capturing and release device resources. |
function | openFile virtual inline | Open a media file as the capture source. |
function | close virtual inline | Release the capture source and any associated resources. |
function | getEncoderFormat virtual | Populate iformat with the encoder-ready format derived from this capture source. |
function | getEncoderAudioCodec virtual inline | Populate params with the encoder-ready audio codec parameters. |
function | getEncoderVideoCodec virtual inline | Populate params with the encoder-ready video codec parameters. |
function | openAudio virtual inline | Open an audio capture device with the given parameters. |
function | openVideo virtual inline | Open a video capture device with the given parameters. |
function | onStreamStateChange virtual inline override | React to PacketStream state transitions by starting or stopping capture. |
function | openStream virtual inline |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
variable | _emitter | |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Inherited from Startable
| Kind | Name | Description |
|---|---|---|
function | start virtual | Starts the object (e.g. begins processing or listening). |
function | stop virtual | Stops the object (e.g. halts processing or closes resources). |
Inherited from Runnable
| Kind | Name | Description |
|---|---|---|
function | Runnable inline | |
function | ~Runnable virtual | Defaulted destructor. |
function | run virtual | The run method will be called by the asynchronous context. |
function | cancel virtual inline | Cancel the current task. The run() method should return ASAP. |
function | cancelled virtual const inline | Returns true when the task has been cancelled. |
variable | exit |
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 override | 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()Defined in src/av/include/icy/av/videocapture.h:32
Construct without opening a device. Call openVideo() before start().
VideoCapture
VideoCapture(const std::string & device, const av::VideoCodec & params)Defined in src/av/include/icy/av/videocapture.h:37
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 = 0, int height = 0, double framerate = 0, const std::string & pixelFmt = "")Defined in src/av/include/icy/av/videocapture.h:45
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 override
virtual void openVideo(const std::string & device, const av::VideoCodec & params) overrideDefined in src/av/include/icy/av/videocapture.h:52
Open the given video device using a VideoCodec params struct.
Parameters
deviceThe platform video device identifier.paramsThe desired capture parameters.
Reimplements
openVideo
virtual
virtual void openVideo(const std::string & device, int width = 0, int height = 0, double framerate = 0, const std::string & pixelFmt = "")Defined in src/av/include/icy/av/videocapture.h:63
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
using Ptr = std::shared_ptr< VideoCapture >