FFmpeg

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

FFmpeg is a cross platform, free, open source media encoder/decoder toolkit. It contains the programs and libraries necessary to convert audio and video into a wide range of formats. FFmpeg was written by Fabrice Bellard (creator of QEMU and BPG).

Installation

USE flags

Some packages know the ffmpeg USE flag for enabling ffmpeg/libav-based audio/video codec support.

USE flags for media-video/ffmpeg Complete solution to record, convert and stream audio and video. Includes libavcodec

altivec Add support for optimizations for G4 and G5/ppc970 processors
amr Enables Adaptive Multi-Rate Audio support
amrenc Enables Adaptive Multi-Rate Audio encoding support with media-libs/vo-amrwbenc.
appkit Enables Apple AppKit framework
bluray Enable playback of Blu-ray filesystems
bs2b Enables media-libs/libbs2b based Bauer stereo-to-binaural filter.
bzip2 Use the bzlib compression library
cdio Enables audio CD grabbing with dev-libs/libcdio.
chromaprint Enables audio fingerprinting support with media-libs/chromaprint.
chromium Builds libffmpeg.so to enable media playback in Chromium-based browsers like Opera and Vivaldi.
codec2 Enables codec2 low bit rate speech codec support via media-libs/codec2.
cpudetection Enables runtime CPU detection (useful for bindist, compatibility on other CPUs)
dav1d Enables AV1 decoding viamedia-libs/dav1d.
encode Add support for encoding of audio or video files
fdk Use external fdk-aac library for AAC encoding
flite Adds a text-to-speech filter based on app-accessibility/flite.
frei0r Enable frei0r wrapping in libavfilter
fribidi Enables fribidi support in the drawtext filter.
gcrypt Enables gcrypt support: Needed for rtmp(t)e support if openssl, librtmp or gmp is not used.
gme Enables support for media-libs/game-music-emu for playing various video game music formats.
gmp Add support for dev-libs/gmp (GNU MP library)
gpl Build GPL code. Should be enabled unless you require LGPL binaries.
hardcoded-tables Use pre-calculated tables rather than calculating them on the fly.
iec61883 Support for FireWire DV/HDV input device using media-libs/libiec61883.
ieee1394 Enable FireWire/iLink IEEE1394 support (dv, camera, ...)
jpeg2k Support for JPEG 2000, a wavelet-based image compression format
kvazaar Enables media-libs/kvazaar based HEVC encoder.
ladspa Enable the ability to support ladspa plugins
libaom Enables media-libs/libaom based AV1 codec support.
libass SRT/SSA/ASS (SubRip / SubStation Alpha) subtitle support
libcaca Add support for colored ASCII-art graphics
libdrm Enables x11-libs/libdrm support for better screen grabbing and hardware accelerated codecs.
libilbc Enables iLBC de/encoding via media-libs/libilbc.
librtmp Enables Real Time Messaging Protocol using librtmp (media-video/rtmpdump) in addition to FFmpeg's native implementation.
libsoxr Enables audio resampling through media-libs/soxr.
libv4l Uses media-libs/libv4l for video4linux instead of direct calls. Adds support for more devices via the userspace library.
libxml2 Uses dev-libs/libxml2 to enable dash demuxing support.
lv2 Enables lv2 audio filter wrapper.
mipsdspr1 Enables MIPS DSP ASE R1 optimizations.
mipsdspr2 Enables MIPS DSP ASE R2 optimizations.
mipsfpu Enables floating point MIPS optimizations.
mmal Enables Multi-Media Abstraction Layer (MMAL) decoding support: Available e.g. on the Raspberry Pi.
modplug Add libmodplug support for playing SoundTracker-style music files
network Enables network streaming support
openal Add support for the Open Audio Library
opencl Enable OpenCL support
openh264 Enables H.264 encoding suppoprt via media-libs/openh264.
openssl Enables dev-libs/openssl support. Adds support for encrypted network protocols (TLS/HTTPS).
opus Enable Opus audio codec support
pic Force shared libraries to be built as PIC (this is slower)
postproc Build and install libpostproc.
rubberband Adds time-stretching and pitch-shifting audio filter based on media-libs/rubberband.
snappy Enable app-arch/snappy support. Required for e.g. Vidvox Hap encoder.
srt Enable support for Secure Reliable Transport (SRT) via net-libs/srt
ssh Enable SSH/sftp support via net-libs/libssh.
static-libs Build static versions of dynamic libraries as well
svg Add support for SVG (Scalable Vector Graphics)
theora Add support for the Theora Video Compression Codec
twolame Enables MP2 encoding via media-sound/twolame as an alternative to the internal encoder.
v4l Enable support for video4linux (using linux-headers or userspace libv4l libraries)
vaapi Enable Video Acceleration API for hardware decoding
vidstab Enables video stabilization filter using vid.stab library (media-libs/vidstab).
vorbis Add support for the OggVorbis audio codec
vpx Enables vp8 codec support using libvpx: Decoding vp8 does not require this to be enabled but libvpx can also be used for decoding; encoding vp8 requires this useflag to be enabled though.
wavpack Add support for wavpack audio compression tools
x264 Enable h264 encoding using x264
x265 Enables HEVC encoding with media-libs/x265.
xcb Support the X C-language Binding, a replacement for Xlib
xvid Add support for xvid.org's open-source mpeg-4 codec
zeromq Enables net-libs/zeromq support with the zmq/azmq filters.
zimg Enables media-libs/zimg based scale filter.
zvbi Enables media-libs/zvbi based teletext decoder.

The above list is non-comprehensive. Use equery (part of app-portage/gentoolkit) to see all available flags:

user $equery uses media-video/ffmpeg

Emerge

If not already pulled in as a dependency of other packages, and after setting appropriate USE flags, emerge FFmpeg:

root #emerge --ask media-video/ffmpeg

Configuration

This section needs some help.

Usage

Media player (ffplay)

If built with USE=sdl, a command line media player called ffplay is available.

user $curl http://www.dradio.de/streaming/dlf_hq_ogg.m3u | xargs ffplay

For more information consult the following commands:

user $man 1 ffplay
user $ffplay -h

See also

  • Libav — a complete, cross-platform solution to record, convert and stream audio and video.

External resources