FFmpeg


FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the command-line ffmpeg tool itself, designed for processing video and audio files. It is widely used for format transcoding, basic editing, video scaling, video post-production effects, and standards compliance.
FFmpeg also includes other tools: ffplay, a simple media player, and ffprobe, a command-line tool to display media information. Among included libraries are libavcodec, an audio/video codec library used by many commercial and free software products, libavformat, an audio/video container mux and demux library, and libavfilter, a library for enhancing and editing filters through a GStreamer-like filtergraph.
FFmpeg is part of the workflow of many 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 Bilibili. Encoders and decoders for many audio and video file formats are included, making it highly useful for the transcoding of common and uncommon media files.
FFmpeg is published under the LGPL-2.1-or-later or GPL-2.0-or-later, depending on which options are enabled.

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.
The "FF" in FFmpeg stands for "fast forward." The logo represents a zigzag scan pattern that shows how MPEG video codecs handle entropy encoding.
On March 13, 2011, a group of FFmpeg developers decided to fork the project under the name Libav. The group decided to fork the project due to a disagreement with the leadership of FFmpeg.
Libav was declared abandoned in 2020.
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, using the Git version control system.

Codec history

Two video coding formats with corresponding codecs and one container format|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, FFmpeg developers Fiona Glaser, Ronald Bultje, and David Conrad, 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 decoder and OpenHEVC, 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, including WebM.

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.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.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.libavdevice is a library containing audio/video io through internal and external devices.

Supported hardware

CPUs

FFmpeg encompasses software implementations of video and audio compressing and decompressing algorithms. These can be compiled and run on many different instruction sets, including x86, PPC, ARM, DEC Alpha, SPARC, and MIPS.

Special purpose hardware

There are a variety of application-specific integrated circuits (ASICs) for audio/video compression and decompression. These ASICs can partially or completely offload the computation from the host CPU. Instead of a complete implementation of an algorithm, only the API is required to use such an ASIC.
FirmASICpurposesupported by FFmpegDetails
AMDUVDdecodingvia VDPAU API and VAAPI
AMDVCEencodingvia VAAPI, considered experimental
AmlogicAmlogic Video Enginedecoding
BlackMagicDeckLinkencoding/decodingreal-time ingest and playout
BroadcomCrystal HDdecoding
QualcommHexagonencoding/decodinghwaccel
IntelIntel Clear Videodecoding
IntelIntel Quick Sync Videoencoding/decoding
NvidiaPureVideo / NVDECdecodingvia the VDPAU API as of FFmpeg v1.2
via CUVID API as of FFmpeg v3.1
NvidiaNVENCencodingas of FFmpeg v2.6

The following APIs are also supported: DirectX Video Acceleration, Direct3D 11, Media Foundation, Vulkan, VideoToolbox, RockChip MPP, OpenCL, OpenMAX, MMAL, MediaCodec, V4L2. Depending on the environment, these APIs may lead to specific ASICs, to GPGPU routines, or to SIMD CPU code.

Supported codecs and formats

Image formats

FFmpeg supports many common and some uncommon image formats.
The PGMYUV image format is a homebrew 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:
GroupFormat typeFormat name
ISO/IEC/ITU-TVideoMPEG-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, MPEG-4 VCB, Motion JPEG, IEC DV video and CD+G
ISO/IEC/ITU-TAudioMP1, 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-TSubtitleMPEG-4 Timed Text
ISO/IEC/ITU-TImageJPEG, Lossless JPEG, JPEG-LS, JPEG 2000, JPEG XL, PNG, CCITT G3 and CCITT G4
Alliance for Open MediaVideoAV1
Alliance for Open MediaImageAVIF
EIASubtitleEIA-608
CEASubtitleCEA-708
SMPTEVideoSMPTE 314M, SMPTE 370M, VC-1, VC-2, VC-3
SMPTEAudioSMPTE 302M
SMPTEImageDPX
ATSC/ETSI/DVBAudioFull Rate, AC-3, Enhanced AC-3 and DTS Coherent Acoustics
ATSC/ETSI/DVBSubtitleDVB Subtitling
DVD Forum/DolbyAudioMLP / Dolby TrueHD
DVD Forum/DolbySubtitleDVD-Video subtitles
Xperi/DTS, Inc/QDesignAudioDTS 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 AssociationSubtitlePGS
3GPPAudioAMR-NB, AMR-WB
3GPP2AudioQCELP-8, QCELP-13 and Enhanced Variable Rate Codec
World Wide Web ConsortiumVideoAnimated GIF
World Wide Web ConsortiumSubtitleWebVTT
World Wide Web ConsortiumImageGIF, and SVG
IETFVideoFFV1
IETFAudioiLBC, Opus and Comfort noise
International Voice AssociationAudioDSS-SP
SACVideoAVS video, AVS2 video, and AVS3 video
MicrosoftVideoMicrosoft RLE, Microsoft Video 1, Cinepak, Microsoft MPEG-4 v1, v2 and v3, Windows Media Video, WMV Screen and Mimic codec
MicrosoftAudioWindows Media Audio, XMA, MSN Siren, MS-GSM and MS-ADPCM
MicrosoftSubtitleSAMI
MicrosoftImageWindows Bitmap, WMV Image, DirectDraw Surface, and MSP
Interactive Multimedia AssociationAudioIMA ADPCM
Intel / Digital Video InteractiveVideoRTV 2.1, Indeo 3, 4 and 5, and Intel H.263
Intel / Digital Video InteractiveAudioDVI4, Intel Music Coder, and Indeo Audio Coder
RealNetworksVideoRealVideo Fractal Codec, 1, 2, 3 and 4
RealNetworksAudioRealAudio v1 – v10, and RealAudio Lossless
RealNetworksSubtitleRealText
Apple / Spruce TechnologiesVideoCinepak, ProRes, Sorenson 3 Codec, QuickTime Animation, QuickTime Graphics, Apple Video, Apple Intermediate Codec and Pixlet
Apple / Spruce TechnologiesAudioALAC
Apple / Spruce TechnologiesImageQuickDraw PICT
Apple / Spruce TechnologiesSubtitleSpruce subtitle
Adobe Flash Player VideoScreen video, Screen video 2, Sorenson Spark and VP6
Adobe Flash Player AudioAdobe SWF ADPCM and Nellymoser Asao
Adobe / AldusImageTIFF, PSD, and DNG
Xiph.OrgVideoTheora
Xiph.OrgAudioSpeex, Vorbis, Opus and FLAC
Xiph.OrgSubtitleOgg Writ
SonyAudioAdaptive Transform Acoustic Coding and PSX ADPCM
NTTAudioTwinVQ
Google / On2 / GIPSVideoDuck TrueMotion 1, Duck TrueMotion 2, Duck TrueMotion 2.0 Real Time, VP3, VP4, VP5, VP6, VP7, VP8, VP9 and animated WebP
Google / On2 / GIPSAudioDK ADPCM Audio 3/4, On2 AVC and iLBC
Google / On2 / GIPSImageWebP
Epic Games / RAD Game ToolsVideoSmacker video and Bink video
Epic Games / RAD Game ToolsAudioBink audio
CRI MiddlewareAudioADX ADPCM, and HCA
Nintendo / NERDVideoMobiclip video
Nintendo / NERDAudioGCADPCM, FastAudio, and ADPCM IMA MOFLEX
Synaptics / DSP GroupAudioTruespeech
Electronic Arts / Criterion Games / Black Box Games / Westwood StudiosVideoRenderWare TXD, Madcow, CMV, TGV, TGQ, TQI, Midivid VQ, MidiVid 3.0, Midivid Archival, and Vector Quantized Animation
Electronic Arts / Criterion Games / Black Box Games / Westwood StudiosAudioElectronic Arts ADPCM variants
NetpbmImagePBM, PGM, PPM, PNM, PAM, PFM and PHM
MIT/X Consortium/The Open GroupImageXBM, XPM and xwd
HPE / SGI / Silicon GraphicsVideoSilicon Graphics RLE 8-bit video, Silicon Graphics MVC1/2
HPE / SGI / Silicon GraphicsImageSilicon Graphics Image
Oracle/Sun MicrosystemsImageSun Raster
IBMVideoIBM UltiMotion
Avid Technology / TruevisionVideoAvid 1:1x, Avid Meridien, Avid DNxHD, Avid DNx444, and DNxHR
Avid Technology / TruevisionImageTarga
Autodesk / AliasVideoAutodesk Animator Studio Codec and FLIC
Autodesk / AliasImageAlias PIX
Activision Blizzard / Activision / InfocomAudioADPCM Zork
Konami / Hudson SoftVideoHVQM4 Video
Konami / Hudson SoftAudioKonami MTAF, and ADPCM IMA HVQM4
Grass Valley / CanopusVideoHQ, HQA, HQX and Lossless
Vizrt / NewTekVideoSpeedHQ
Vizrt / NewTekImageVizrt Binary Image
Academy Software Foundation / ILMImageOpenEXR
Mozilla CorporationVideoAPNG
MatroxVideoMatrox Uncompressed SD / HD
AMD/ATIVideoATI VCR1/VCR2
AsusVideoASUS V1/V2 codec
CommodoreVideoCDXL codec
KodakImagePhoto CD
Blackmagic Design / CintelImageCintel RAW
Houghton Mifflin Harcourt / The Learning Company / ZSoft CorporationImagePCX
Australian National UniversityImageX-Face
Bluetooth Special Interest GroupAudioSBC, and mSBC
Qualcomm / CSRAudioQCELP, aptX, and aptX HD
Open Mobile Alliance / WAP ForumImageWireless Bitmap

Muxers

Output formats in FFmpeg are called "muxers". FFmpeg supports, among others, the following:

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

[De facto standard]s

Supported filters

FFmpeg supports, among others, the following filters.

Audio

Video

Supported test patterns

Supported LUT formats

Supported media and interfaces

FFmpeg supports the following devices via external libraries.

Media

Physical interfaces

Audio IO

Video IO

Screen capture and output

Others

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, but 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 Blender, Cinelerra-GG Infinity, HandBrake, Kodi, MPC-HC, Plex, Shotcut, VirtualDub2, VLC media player, xine and YouTube. It handles video and audio playback in Google Chrome and the Linux version of Firefox. GUI front-ends for FFmpeg have been developed, including Multimedia Xpert, XMedia Recode and ShutterEncoder.
FFmpeg is used by ffdshow, FFmpegInterop, the GStreamer FFmpeg plug-in, LAV Filters and OpenMAX IL to expand the encoding and decoding capabilities of their respective multimedia platforms.
As part of NASA's Mars 2020 mission, FFmpeg is used by the Perseverance rover on Mars for image and video compression before footage is sent to Earth.

Embedded applications

FFmpeg is also being used in embedded applications, where it can be used with custom hardware to simplify version and dependency management and also to provide operating system abstraction across multiple different OS and processor manufacturers.