laav

Live Asynchronous Audio Video Library

ABOUT

A header-only C++ library which wraps FFmpeg, V4L2, ALSA and Libevent for capturing audio and video from multiple live sources (cameras and microphones) and

The project is useful for building video surveillance systems as well, consisting in media servers which stream and record at the same time and which can be controlled through MQTT or HTTP commands (see THIS and THIS examples).

The project runs on Linux (ALSA and V4L2 devices), but a Windows port is planned (any contribution is welcome!).

FEATURES

while (!LAAVStop)
{
    // Pipe
    grabber >> converter >> encoder >> streamer;
    
    // Audio-video events catcher
    eventsCatcher->catchNextEvent();
}

COMPILING / RUNNING

Dependencies: FFmpeg >= 5.0 (tested with 5.0 version), Libevent and pkg-config (optional: see the compile command below). FFmpeg needs x264 for H264 support and libopus for OPUS support.

VLC (tested with v2.2.4: set a low value for –network-caching flag):

vlc --network-caching 200 http://stream_url

FFPLAY:

ffplay -fflags nobuffer http://stream_url

HOW TO USE IT

See the provided EXAMPLES

TODO