Libav

From Gentoo Wiki
Jump to: navigation, search
This article is a stub. You can help Gentoo Wiki 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.

Installation

USE flags

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

X Add support for X11 global
aac Use external vo-aacenc library for AAC encoding local
alsa Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture) global
altivec Add support for optimizations for G4 and G5/ppc970 processors 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
bzip2 Use the bzlib compression library global
cdio Enable audio CD grabbing with dev-libs/libcdio. local
cpudetection Enables runtime CPU detection (useful for bindist, compatibility on other CPUs). local
custom-cflags Build with user-specified CFLAGS (unsupported) global
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces global
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally global
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
jack Add support for the JACK Audio Connection Kit global
jpeg2k Support for JPEG 2000, a wavelet-based image compression format global
libressl Use dev-libs/libressl as SSL provider (might need ssl USE flag), packages should not depend on this USE flag 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
sdl Add support for Simple Direct Layer (media library) global
speex Add support for the speex audio codec (used for speech) global
ssl Enable SSL/TLS support using dev-libs/openssl or dev-libs/gnutls. local
static-libs Build static versions of dynamic libraries as well global
test Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't set it in make.conf/package.use anymore global
theora Add support for the Theora Video Compression Codec global
threads Add threads support for various packages. Usually pthreads global
tools Build and install small tools like aviocat, cws2fws, graph2dot, ismindex, qt-faststart. local
truetype Add support for FreeType and/or FreeType2 fonts global
twolame Enable MP2 encoding via media-sound/twolame as an alternative to the internal encoder local
v4l Enable support for video4linux (using linux-headers or userspace libv4l libraries) global
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 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 xvid.org's open-source mpeg-4 codec global
zlib Add support for zlib (de)compression global

Emerge

After setting appropriate USE flags, run the emerge command:

root #emerge --ask media-video/libav

Usage

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