Table of Contents

User guide

Basic concepts

Duga reads video frames from pipe as raw RGB24 bitmaps (i.e., each pixel is represented by 3 uint8_t) and audio as int16_t (a.k.a. PCM S16_LE) samples. It combines them and outputs RGB24 and PCM stream.

The intended usage is to have several ffmpeg (and maybe arecord for audio) processes that eat from various sources (V4L2, files, network streams, wireless microphones…) and one ffmpeg process that reads the output, encodes it to something sane and feeds it to your favorite streaming server (VLC, ffserver…).

Configuration is solely by commands. Commands can be read from a rc file (which is the only command line argument) during startup or from stdin afterwards.

Installation

For duga, only C++11 compiler is required. However, you will probably need ffmpeg and vlc binaries to do something useful.

Just run “make”.

Supported commands

Some example usage is in the default rc file. It opens your camera, a video file and an image and starts streaming in FLV format.

set <variable> <value>

Sets variable in global configuration.

Variables are:

run

Starts the processing (duga will start outputting black video and silent audio).

import <video name> <audio name> <video resolution x> <video resolution y> <video pipe> <audio pipe> <framedrop/noframedrop> <command>

Add a stream.

If you have only audio or only video, put “none” as the name.

static <name> <resolution x> <resolution y> <filename>

Import an image, e.g. a logo. The file in RGBA format (alpha ~ 0xFF - full opacity, 0x00 - full transparency) can be obtained for example with

convert image.png image.rgba

transform <parameter> <value>

Manipulate existing stream. Parameters are:

enable <name>

Enable a source.

disable <name>

Disable a source (it will just stop showing it, but all the processing still runs).

destroy <name>

Destroy a source (it will close the pipe - which will probably mean that your program will receive SIGPIPE and gracefully end).

show

Show which sources are currently configured.

audiopeak

Show peak audio level since the time this command was last run. The number is in range [0, 2^15] as we are using signed 16-bit PCM.