From Gentoo Wiki
Jump to: navigation, search
This article is a stub. You can help by expanding it.

Libav is a complete, cross-platform solution to record, convert and stream audio and video. It includes an implementation of libavcodec — the leading audio/video codec library.

Software not building with Libav

Some software might not be compatible with the 0.8 or even the 0.7 Libav API.

The most outstanding issues include:

  • libavutil specific function being used without including the required header:
include <libavutil/mathematics.h> to include av_rescale_q()
include <libavutil/avstring.h> to include the av_str functions
  • FFmpeg only calls used:
avformat_alloc_output_context2() might be the most used, it is a shortcut for calling avformat_alloc_context() followed by using av_guess_format() and an av_strlcpy of the filename.


USE flags

Some packages know the libav USE flag for Preferring media-video/libav over media-video/ffmpeg whenever both are supported.

USE flags for media-video/libav Complete solution to record, convert and stream audio and video

aac Use external vo-aacenc library for AAC encoding local
alsa Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture) global
amr Enable Adaptive Multi-Rate Audio support local
armv5te Enable optimizations for armv5te processors local
armv6 Enable optimizations for armv6 processors local
armv6t2 Enable optimizations for armv6t2 processors local
armvfp Enable VFP optimizations for ARM processors local
bs2b Enable media-libs/libbs2b based Bauer stereo-to-binaural audio filter local
cdio Enable audio CD grabbing with dev-libs/libcdio. local
cpudetection Enables runtime CPU detection (useful for bindist, compatibility on other CPUs). local
encode Add support for encoding of audio or video files global
faac Use external faac library for AAC encoding local
fdk Use external fdk-aac library for AAC encoding and decoding local
fontconfig Support for configuring and customizing font access via media-libs/fontconfig global
frei0r Enable frei0r wrapping in libavfilter local
gpl Build all GPL licensed code. Without this flag set the package is build under LGPL license. local
gsm Add support for the gsm lossy speech compression codec global
hardcoded-tables Use pre-calculated tables rather than calculating them on the fly. local
ieee1394 Enable FireWire/iLink IEEE1394 support (dv, camera, ...) global
jpeg2k Support for JPEG 2000, a wavelet-based image compression format global
mp3 Add support for reading mp3 files global
neon Enable optimization support for ARM NEON processors global
network Enable network streaming support. local
openssl Prefer dev-libs/openssl over net-libs/gnutls to provide SSL/TLS support (notice: the resulting binaries are unredistributable). local
opus Use the external opus library for encoding and decoding. local
oss Add support for OSS (Open Sound System) global
pic Force shared libraries to be built as PIC (this is slower). local
pulseaudio Enable pulseaudio input support. local
rtmp Enable Real Time Messaging Protocol using librtmp instead the native implementation. local
schroedinger Enable Dirac video support (an advanced royalty-free video compression format) via libschroedinger (high-speed implementation in C of the Dirac codec). local
speex Add support for the speex audio codec (used for speech) global
ssl Enable SSL/TLS support using dev-libs/openssl or net-libs/gnutls. local
static-libs Build static versions of dynamic libraries as well global
theora Add support for the Theora Video Compression Codec global
tools Build and install small tools like aviocat, cws2fws, graph2dot, ismindex, qt-faststart. local
twolame Enable MP2 encoding via media-sound/twolame as an alternative to the internal encoder local
vaapi Enable Video Acceleration API for hardware decoding global
vdpau Enable the Video Decode and Presentation API for Unix acceleration interface global
vorbis Add support for the OggVorbis audio codec global
vpx Enable vp8 encoding support using media-libs/libvpx. local
wavpack Add support for wavpack audio compression tools global
webp Enable WebP encoding with media-libs/libwebp. local
x264 Enable h264 encoding using x264 global
x265 Enable HEVC encoding with media-libs/x265. local
xvid Add support for's open-source mpeg-4 codec global


After setting appropriate USE flags, run the emerge command:

root #emerge --ask media-video/libav


Libav provides a new command-line tool to manipulate streams called avconv. Its aim is similar to the ffmpeg command from FFmpeg, but the syntax had been changed to be more regular and it aims to solve some long standing issues regarding time stamp guessing/generation that had been a bane for everybody trying to transcode live streams in the past.

See also

External resources