FFmpeg
FFmpeg is a free and open-source software project consisting of a large suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the FFmpeg program itself, designed for command-line-based processing of video and audio files, and widely used for format transcoding, basic editing, video scaling, video post-production effects, and standards compliance.
FFmpeg includes libavcodec, an audio/video codec library used by many commercial and free software products, libavformat, an audio/video container mux and demux library, and the core ffmpeg command-line program for transcoding multimedia files.
FFmpeg is part of the workflow of hundreds of other software projects, and its libraries are a core part of software media players such as VLC, and has been included in core processing for YouTube and iTunes. Codecs for the encoding and/or decoding of most audio and video file formats is included, making it highly useful for the transcoding of common and uncommon media files into a single common format.
The name of the project is inspired by the MPEG video standards group, together with "FF" for "fast forward". The logo uses a zigzag pattern that shows how MPEG video codecs handle entropy encoding.
FFmpeg is published under the GNU Lesser General Public License 2.1+ or GNU General Public License 2+.
History
The project was started by Fabrice Bellard in 2000, and was led by Michael Niedermayer from 2004 until 2015. Some FFmpeg developers were also part of the MPlayer project.On January 10, 2014, two Google employees announced that over 1000 bugs had been fixed in FFmpeg during the previous two years by means of fuzz testing.
In January 2018, the ffserver command-line program – a long-time component of FFmpeg – was removed. The developers had previously deprecated the program citing high maintenance efforts due to its use of internal application programming interfaces.
The project publishes a new release every three months on average. While release versions are available from the website for download, FFmpeg developers recommend that users compile the software from source using the latest build from their source code Git version control system.
Codec history
Two video coding formats with corresponding codecs and one container format have been created within the FFmpeg project so far. The two video codecs are the lossless FFV1, and the lossless and lossy Snow codec. Development of Snow has stalled, while its bit-stream format has not been finalized yet, making it experimental since 2011. The multimedia container format called NUT is no longer being actively developed, but still maintained.In summer 2010, Fiona Glaser, Ronald Bultje, and David Conrad of the FFmpeg Team announced the ffvp8 decoder. Through testing, they determined that ffvp8 was faster than Google's own libvpx decoder. Starting with version 0.6, FFmpeg also supported WebM and VP8.
In October 2013, a native VP9 and the OpenHEVC decoder, an open source High Efficiency Video Coding decoder, were added to FFmpeg. In 2016 the native AAC encoder was considered stable, removing support for the two external AAC encoders from VisualOn and FAAC. FFmpeg 3.0 retained build support for the Fraunhofer FDK AAC encoder. Since version 3.4 "Cantor" FFmpeg supported the FITS image format. Since November 2018 in version 4.1 "al-Khwarizmi" AV1 can be muxed in MP4 and Matroska incl. WebM.
Forks
On March 13, 2011, a group of FFmpeg developers decided to fork the project under the name "Libav". The event was related to an issue in project management, in which developers disagreed with the leadership of FFmpeg.Components
Command line tools
- ffmpeg is a command-line tool that converts audio or video formats. It can also capture and encode in real-time from various hardware and software sources such as a TV capture card.
- ffplay is a simple media player utilizing SDL and the FFmpeg libraries.
- ffprobe is a command-line tool to display media information, see also Mediainfo.
Libraries
- libswresample is a library containing audio resampling routines.
- libavresample is a library containing audio resampling routines from the Libav project, similar to libswresample from ffmpeg.
- libavcodec is a library containing all of the native FFmpeg audio/video encoders and decoders. Most codecs were developed from scratch to ensure best performance and high code reusability.
- libavformat is a library containing demuxers and muxers for audio/video container formats.
- libavutil is a helper library containing routines common to different parts of FFmpeg. This library includes hash functions, ciphers, LZO decompressor and Base64 encoder/decoder.
- libpostproc is a library containing older h263 based video postprocessing routines.
- libswscale is a library containing video image scaling and colorspace/pixelformat conversion routines.
- libavfilter is the substitute for vhook which allows the video/audio to be modified or examined between the decoder and the encoder. Filters have been ported from many projects including MPlayer and avisynth.
Supported hardware
CPUs
FFmpeg encompasses software implementations of video and audio compressing and decompressing algorithms. These can be compiled and run on diverse instruction sets.Many widespread instruction sets are supported by FFmpeg, including x86, PPC, ARM, DEC Alpha, SPARC, and MIPS.
Special purpose hardware
Various application-specific integrated circuits related to video and audio compression and decompression exist. Such ASICs can perform the computation for audio/video decompression or compression partly or fully to offload these from the host CPU. To make use of such an ASIC, instead of a complete implementation of some algorithm, only the API is required. There are numerous ASICs and APIs available, of which several are supported by FFmpeg.Firm | ASIC | purpose | supported by FFmpeg | Details |
AMD | UVD | decoding | via VDPAU API and VAAPI | |
AMD | VCE | encoding | via VAAPI, considered experimental | |
Amlogic | Amlogic Video Engine | decoding | ? | |
BlackMagic | DeckLink | encoding/decoding | real-time ingest and playout | |
Broadcom | Crystal HD | decoding | ||
Intel | Intel Clear Video | decoding | ||
Intel | Intel Quick Sync Video | encoding/decoding | ||
Nvidia | PureVideo / NVDEC | decoding | via the VDPAU API as of FFmpeg v1.2 via CUVID API as of FFmpeg v3.1 | |
Nvidia | NVENC | encoding | as of FFmpeg v2.6 |
Use with the FFmpeg Utility
Internal hardware acceleration decoding is enabled through the-hwaccel
option. It starts decoding normally, but if a decodable stream is detected in hardware, then the decoder designates all significant processing to that hardware, thus accelerating the decoding process. Whereas if no decodable streams are detected, hardware acceleration will be skipped and it will still be decoded in software. -hwaccel_device
option is applied when the hardware requires a particular device to function especially there are several graphic cards are available.Supported codecs and formats
Image formats
FFmpeg supports many common and some uncommon image formats.The PGMYUV image format is a homebrewn variant of the binary PGM Netpbm format. FFmpeg also supports 16-bit depths of the PGM and PPM formats, and the binary PAM format with or without alpha channel, depth 8 bit or 16 bit for
pix_fmts
monob, gray, gray16be, rgb24, rgb48be, ya8, rgba, rgb64be.Supported formats
In addition to FFV1 and Snow formats, which were created and developed from within FFmpeg, the project also supports the following formats:Group | Format type | Format name |
ISO/IEC/ITU-T | Video | MPEG-1 Part 2, H.261, H.262/MPEG-2 Part 2, H.263, MPEG-4 Part 2, H.264/MPEG-4 AVC, HEVC/H.265, Motion JPEG, IEC DV video and CD+G |
ISO/IEC/ITU-T | Audio | MP1, MP2, MP3, AAC, HE-AAC, MPEG-4 ALS, G.711 μ-law, G.711 A-law, G.721, G.722, G.722.2, G.723, G.723.1, G.726, G.729, G.729D, IEC DV audio and Direct Stream Transfer |
ISO/IEC/ITU-T | Subtitle | MPEG-4 Timed Text |
ISO/IEC/ITU-T | Image | JPEG, Lossless JPEG, JPEG-LS, JPEG 2000, PNG, CCITT G3 and CCITT G4 |
Alliance for Open Media | Video | AV1 |
EIA | Subtitle | EIA-608 |
CEA | Subtitle | CEA-708 |
SMPTE | Video | SMPTE 314M, SMPTE 370M, VC-1, VC-2, VC-3 |
SMPTE | Audio | SMPTE 302M |
SMPTE | Audio | Full Rate, AC-3, Enhanced AC-3 and DTS Coherent Acoustics |
SMPTE | Image | DPX |
ATSC/ETSI/DVB | Subtitle | DVB Subtitling |
DVD Forum/Dolby | Audio | MLP / Dolby TrueHD |
DVD Forum/Dolby | Subtitle | DVD-Video subtitles |
DTS, Inc/QDesign | Audio | DTS Coherent Acoustics, DTS Extended Surround, DTS 96/24, DTS-HD High Resolution Audio, DTS Express, DTS-HD Master Audio, QDesign Music Codec 1 and 2 |
Blu-ray Disc Association | Subtitle | PGS |
3GPP | Audio | AMR-NB, AMR-WB |
3GPP2 | Audio | QCELP-8, QCELP-13 and Enhanced Variable Rate Codec |
World Wide Web Consortium | Video | Animated GIF |
World Wide Web Consortium | Subtitle | WebVTT |
World Wide Web Consortium | Image | GIF |
IETF | Audio | iLBC, Opus and Comfort noise |
International Voice Association | Audio | DSS-SP |
SAC | Video | AVS video |
Microsoft | Video | Microsoft RLE, Microsoft Video 1, Cinepak, Indeo, Microsoft MPEG-4 v1, v2 and v3, Windows Media Video, WMV Screen and Mimic codec |
Microsoft | Audio | Windows Media Audio, XMA, MS-GSM and MS-ADPCM |
Microsoft | Subtitle | SAMI |
Microsoft | Image | Windows Bitmap, WMV Image and DirectDraw Surface |
Interactive Multimedia Association | Audio | IMA ADPCM |
Digital Video Interactive | Video | RTV 2.1 |
Digital Video Interactive | Audio | DVI4 audio codec |
RealNetworks | Video | RealVideo Fractal Codec, 1, 2, 3 and 4 |
RealNetworks | Audio | RealAudio v1 – v10 |
RealNetworks | Subtitle | RealText |
Apple | Video | Cinepak, ProRes, Sorenson 3 Codec, QuickTime Animation, QuickTime Graphics, Apple Video, Apple Intermediate Codec and Pixlet |
Apple | Audio | ALAC |
Adobe Flash Player | Video | Screen video, Screen video 2, Sorenson Spark and VP6 |
Adobe Flash Player | Audio | Adobe SWF ADPCM and Nellymoser Asao |
Aldus / Adobe | Image | TIFF and PSD |
Xiph.Org | Video | Theora |
Xiph.Org | Audio | Speex, Vorbis, Opus and FLAC |
Xiph.Org | Subtitle | Ogg Writ |
Sony | Audio | Adaptive Transform Acoustic Coding and PSX ADPCM |
NTT | Audio | TwinVQ |
On2 / GIPS / Google | Video | Duck TrueMotion 1, Duck TrueMotion 2, Duck TrueMotion 2.0 Real Time, VP3, VP4, VP5, VP6, VP7, VP8, VP9 and animated WebP |
On2 / GIPS / Google | Audio | DK ADPCM Audio 3/4, On2 AVC and iLBC |
On2 / GIPS / Google | Image | WebP |
RAD Game Tools | Video | Smacker video and Bink video |
DSP Group | Audio | Truespeech |
RenderWare | Video | TXD |
Netpbm | Image | PBM, PGM, PPM, PNM, PAM and PFM |
MIT/X Consortium/The Open Group | Image | XBM, XPM and xwd |
Silicon Graphics | Video | Silicon Graphics RLE 8-bit video, Silicon Graphics MVC1/2 |
Silicon Graphics | Image | Silicon Graphics Image |
Oracle/Sun Microsystems | Image | Sun Raster |
IBM | Video | IBM UltiMotion |
Avid Technology / Truevision | Video | Avid 1:1x, Avid Meridien, Avid DNxHD and DNxHR |
Avid Technology / Truevision | Image | Targa |
Autodesk / Alias | Video | Autodesk Animator Studio Codec and FLIC |
Autodesk / Alias | Image | Alias PIX |
Grass Valley / Canopus | Video | HQ, HQA, HQX and Lossless |
NewTek | Video | SpeedHQ |
Industrial Light & Magic / Lucasfilm | Image | OpenEXR |
Mozilla Corporation | Video | APNG |
Matrox | Video | Matrox Uncompressed SD / HD |
AMD/ATI | Video | ATI VCR1/VCR2 |
Asus | Video | ASUS V1/V2 codec |
Spruce Technologies | Subtitle | Spruce subtitle |
Muxers
Output formats in FFmpeg are called "muxers". FFmpeg supports, among others, the following:- AIFF
- ASF
- AVI and also input from AviSynth
- BFI
- CAF
- FLV
- GIF
- GXF, General eXchange Format, SMPTE 360M
- HLS, HTTP Live Streaming
- IFF
- ISO base media file format
- Matroska
- Maxis XA
- MPEG-DASH
- MPEG program stream
- MPEG transport stream
- MXF, Material eXchange Format, SMPTE 377M
- MSN Webcam stream
- NUT
- Ogg
- OMA
- RL2
- Segment, for creating segmented video streams
- Smooth Streaming
- TXD
- WTV
Pixel formats
ffmpeg -pix_fmts
provides a list of supported pixel formats.FFmpeg does not support IMC1-IMC4, AI44, CYMK, RGBE, Log RGB and other formats. It also does not yet support ARGB 1:5:5:5, 2:10:10:10, or other BMP bitfield formats that are not commonly used.
Supported protocols
Open standards
- IETF RFCs:
- *FTP
- *Gopher
- *HTTP
- *HTTPS
- *RTP
- *RTSP
- *SCTP
- *SDP
- *SRTP
- *TCP
- *TLS
- *UDP
- *UDP-Lite
- IETF I-Ds:
- *HLS
- *SFTP
- Microsoft OSP:
- *CIFS/SMB
- *MMS over TCP
- *MMS over HTTP
[De facto standard]s
- RTSP over TLS
- Icecast protocol
- Adobe RTMP, RTMPT, RTMPE, RTMPTE and RTMPS
- RealMedia RTSP/RDT
Supported filters
Audio
- Resampling
- Pass/Stop filters
- * Low-pass filter
- * High-pass filter
- * All-pass filter
- * Butterworth Band-pass filter
- * Butterworth Band-stop filter
- Arbitrary Finite Impulse Response Filter
- Arbitrary Infinite Impulse Response Filter
- Equalizer
- * Peak Equalizer
- * Butterworth/Chebyshev Type I/Type II Multiband Equalizer
- * Low Shelving filter
- * High Shelving filter
- * Xbox 360 rqulizer
- * FIR equalizer
- * Biquad filter
- Remove/Add DC offset
- Expression evaluation
- * Time domain expression evaluation
- * Frequency domain expression evaluation
- Dynamics
- * Limiter
- * Compressor
- * Dynamic range expander
- * Side-chain Compressor
- * Compander
- * Noise gate
- * Side-chain Noise gate
- Distortion
- * Bitcrusher
- Emphasis
- Amplify/Normalizer
- * Volume
- * Dynamic Audio Normalizer
- * EBU R 128 loudness normalizer
- Modulation
- * Sinusoidal Amplitude Modulation
- * Sinusoidal Phase Modulation
- * Phaser
- * Chorus
- * Flanger
- * Pulsator
- Echo/Reverb
- * Echo
- Routing/Panning
- * Stereo widening
- * Increase channel differences
- * to L/R
- * Channel mapping
- * Channel splitting
- * Channel panning
- * Channel merging
- * Channel joining
- * for Headphones
- ** Stereo to Binaural
- ** Bauer Stereo to Binaural
- ** Crossfeed
- ** Multi-channel to Binaural
- * Delay
- ** Delay
- ** Delay by distance
- Fade
- * Fader
- * Crossfader
- Audio time-scale/pitch modification
- * Time stretching
- * Time-stretching and Pitch-shifting
- Editing
- * Trim
- * Silence-padding
- * Silence remover
- Show frame/channel information
- * Show frame information
- * Show channel information
- * Show silence ranges
- * Show audio volumes
- * ReplayGain scanner
- Modify frame/channel information
- * Set output format
- * Set number of sample
- * Set sampling rate
- Mixer
- Synchronization
- HDCD data decoder
- Plugins
- * LADSPA
- * LV2
- Do nothing
Video
- Transformations
- * Cropping
- * Fading
- * Scaling
- * Padding
- * Rotation
- * Transposition
- * Others:
- ** Lens correction
- ** OpenCV filtering
- ** Perspective correction
- Temporal editing
- * Framerate
- * Looping
- * Trimming
- Deinterlacing
- Filtering
- * Blurring
- * Convolution filters
- ** Convolution
- ** Edge detection
- ** Sobel Filter
- ** Prewitt Filter
- ** Unsharp masking
- Denoising
- Logo removal
- Subtitles
- Alpha channel editing
- Keying
- Frame detection
- * Black frame detection
- * Thumbnail selection
- Frame Blending
- Video stabilization
- Color and Level adjustments
- * Balance and levels
- * Channel mixing
- * Color space
- * Parametric adjustments
- Histograms and visualization
- * CIE Scope
- * Vectorscope
- * Waveform monitor
- * Color histogram
- Drawing
- OCR
- Quality measures
- * SSIM
- * PSNR
- Lookup Tables
- * lut, lutrgb, lutyuv, lut2, lut3d, haldclut
Applications
Legal aspects
FFmpeg contains more than 100 codecs, most of which use compression techniques of one kind or another. Many such compression techniques may be subject to legal claims relating to software patents. Such claims may be enforceable in countries like the United States which have implemented software patents, but are considered unenforceable or void in member countries of the European Union, for example. Patents for many older codecs, including AC3 and all MPEG-1 and MPEG-2 codecs, have expired.FFmpeg is licensed under the LGPL license, however, if a particular build of FFmpeg is linked against any GPL libraries, then the entire binary is licensed under the GPL.
Projects using FFmpeg
FFmpeg is used by software such as VLC media player, xine, Shotcut, Cinelerra-GG video editor, Plex, Kodi, Blender, HandBrake, YouTube, and MPC-HC; it handles video and audio playback in Google Chrome, and Linux version of Firefox. Graphical user interface front-ends for FFmpeg have been developed, including XMedia Recode.FFmpeg is used by ffdshow, LAV Filters, GStreamer FFmpeg plug-in, Perian, OpenMAX IL, and FFmpegInterop to expand the encoding and decoding capabilities of their respective multimedia platform.