FFmpeg
![]() |
|
![]() FFmpeg running on Microsoft Windows
|
|
Original author(s) | Fabrice Bellard |
---|---|
Developer(s) | FFmpeg team |
Initial release | December 20, 2000[1] |
Stable release | 2.8.4 (December 20, 2015[2]) [±] |
Preview release | Git [±] |
Development status | Active |
Written in | C and Assembly[3] |
Operating system | Windows, OS X, and Linux; may be compiled for other OSes.[4] |
Platform | x86, ARM, PowerPC, MIPS, DEC Alpha, Blackfin, AVR32, SH-4, and SPARC; may be compiled for other desktop computers |
Type | Multimedia framework |
License | LGPL 2.1+, GPL 2+ Unredistributable if compiled as such[5] |
Website | ffmpeg |
FFmpeg is a free software project that produces libraries and programs for handling multimedia data. FFmpeg includes libavcodec, an audio/video codec library used by several other projects, libavformat, an audio/video container mux and demux library, and the ffmpeg command line program for transcoding multimedia files. FFmpeg is published under the GNU Lesser General Public License 2.1+ or GNU General Public License 2+ (depending on which options are enabled).[6]
FFmpeg is developed under Linux, but it can be compiled under most operating systems, including Mac OS X, Microsoft Windows, as well as AmigaOS and its heir MorphOS. Most computing platforms and microprocessor instruction set architectures are also supported, like x86 (IA-32 and x86-64), PPC (PowerPC), ARM, DEC Alpha, SPARC, and MIPS.[7]
The name of the project is inspired by the MPEG video standards group, together with "FF" for "fast forward".[8] The logo uses a zigzag pattern that shows how MPEG video codecs handle entropy encoding.[9]
Contents
History
The project was started by Fabrice Bellard[6] (using the pseudonym "Gérard Lantau") in 2000, and was led by Michael Niedermayer from 2004 until 2015.[10] Many FFmpeg developers are also part of the MPlayer project.
FFmpeg version 0.5 appeared after a long time without formal releases. Meanwhile, the project approximately publishes a new release every three months to be used by "distributors and system integrators", but FFmpeg developers recommend that users compile the software from source using the latest build from their source code Git version control system.[11]
Two video coding formats with corresponding codecs and one container format were invented in the FFmpeg project during its development. The two video codecs are the lossless FFV1, and the lossless and lossy Snow, the development of which 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.[12]
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.[13][14] Starting with version 0.6, FFmpeg also supported WebM and VP8.[15]
Since May 2011, an independent developer offers frequently updated ports of the FFmpeg tools for Windows platforms, to which the FFmpeg official website links.[16]
In October 2013, a native VP9[17] and the OpenHEVC decoder, an open source High Efficiency Video Coding (HEVC) decoder, were added to FFmpeg.[18]
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.[19] FFmpeg 2.5, released in December 2014, supports an MPEG-DASH muxer.[20]
On July 31, 2015, lead maintainer Michael Niedermeyer announced that he would be resigning, in order to help resolve the fork situation with Libav.[10]
Libav Fork
On March 13, 2011, a group of FFmpeg developers decided to fork the project under the name "Libav".[21][22][23] The event was related to a recent issue in project management, in which developers disagreed with the leadership of FFmpeg.[24][25][26] The maintainer of FFmpeg packages for the Debian[27] and Ubuntu[28] Linux distributions, being one of the group of developers who forked FFmpeg, switched the distributions to Libav. In November 2013, Debian Developer Rogério Brito started to reincorporate FFmpeg into Debian and Ubuntu, with user support.[29][30] On July 8, 2015, Debian ultimately switched back to FFmpeg, replacing Libav, citing security issues with the latter.[31]
Components
The project comprises several components:
- ffmpeg is a command-line tool that converts audio or video formats. It can also grab and encode in real-time from various sources such as a TV card etc.
- ffserver is an HTTP and RTSP multimedia streaming server for live broadcasts. It can also time shift live broadcast.
- ffplay is a simple media player based on SDL and on the FFmpeg libraries.
- ffprobe is a command-line tool to show media information (text, CSV, XML, JSON), see also Mediainfo.
- 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 the 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 (Adler-32, CRC, MD5, RIPEMD, SHA-1. SHA-2, MurmurHash3, HMAC MD-5, HMAC SHA-1 and HMAC SHA-2), ciphers (DES, RC4, AES, AES-CTR, TEA, XTEA, Blowfish, CAST-128, Twofish and Camellia), LZO decompressor and Base64 encoder/decoder.
- libpostproc is a library containing 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.
Supported Codecs, container formats, protocols and pixel formats
The PGMYUV image format is a homebrewn variant of the binary (P5) PGM Netpbm format. FFmpeg also supports 16-bit depths of the PGM and PPM formats, and the binary (P7) PAM format with or without alpha channel, depth 8 bit or 16 bit for pix_fmts
monob, gray, gray16be, rgb24, rgb48be, ya8, rgba, rgb64be.
Codecs
Lua error in Module:Details at line 30: attempt to call field '_formatLink' (a nil value). In addition to FFV1 and Snow codecs, which were created and developed from within FFmpeg, the project also supports codecs from the following:
Group | Format type | Format name |
---|---|---|
ISO/IEC/ITU-T | Video | MPEG-1 Part 2, H.261 (Px64),[32] H.262/MPEG-2 Part 2, H.263,[32] MPEG-4 Part 2, H.264/MPEG-4 AVC, HEVC/H.265[18] (MPEG-H Part 2), Motion JPEG, DV video and CD+G |
Audio | MP1, MP2, MP3, AAC, HE-AAC, MPEG-4 ALS, G.711 µ-law, G.711 A-law, G.721 (aka G.726 32k), G.722, G.722.2 (aka AMR-WB), G.723 (aka G.726 24k and 40k), G.723.1, G.726, G.729, G.729D and DV audio | |
Subtitle | MPEG-4 Timed Text (aka 3GPP Timed Text) | |
Image | JPEG, JPEG-LS, JPEG 2000, PNG, CCITT G3 and CCITT G4 | |
EBU | Subtitle | Spruce subtitle (EBU STL) |
EIA | Subtitle | EIA-608 |
CEA | Subtitle | CEA-708 |
SMPTE | Video | VC-1 (aka WMV3), VC-2 (aka Dirac Pro), VC-3 (aka AVID DNxHD) |
Audio | SMPTE 302M | |
Image | DPX | |
ATSC/ETSI/DVB | Audio | Full Rate (GSM 06.10), AC-3 (Dolby Digital) and Enhanced AC-3 (Dolby Digital Plus) |
Subtitle | DVB Subtitling (ETSI 300 743) | |
DVD Forum/Dolby | Audio | MLP / Dolby TrueHD |
Subtitle | DVD-Video subtitles | |
Blu-ray Disc Association | Subtitle | PGS (Presentation Graphics Stream) |
3GPP | Audio | AMR-NB, AMR-WB (aka G.722.2) |
3GPP2 | Audio | QCELP-8 (aka SmartRate or IS-96C), QCELP-13 (aka PureVoice or IS-733) and Enhanced Variable Rate Codec (EVRC. aka IS-127) |
World Wide Web Consortium | Video | Animated GIF |
Subtitle | WebVTT | |
Image | GIF | |
IETF | Audio | iLBC (via libilbc), Opus and Comfort noise |
International Voice Association | Audio | DSS-SP |
SAC | Video | AVS video |
Microsoft | Video | Microsoft RLE, Microsoft Video 1, Cinepak, Indeo (v2, v3 and v5),[32] Microsoft MPEG-4 v1, v2 and v3, Windows Media Video (WMV1, WMV2, WMV3/VC-1) and WMV Screen |
Audio | Windows Media Audio (WMA1, WMA2, WMA Pro and WMA Lossless), XMA (XMA1 and XMA2), MS-GSM and MS-ADPCM | |
Subtitle | SAMI | |
Image | Windows Bitmap, WMV Image (WMV9 Image and WMV9 Image v2) and DirectDraw Surface | |
Interactive Multimedia Association | Audio | IMA ADPCM |
Digital Video Interactive | Video | RTV 2.1 (Intel Indeo 2) |
Audio | DVI4 audio codec | |
RealNetworks | Video | RealVideo 1, 2, 3 and 4 |
Audio | RealAudio v1 – v10 | |
Subtitle | RealText | |
QuickTime | Video | Cinepak (Apple Compact Video), ProRes, Sorenson 3 Codec, QuickTime Animation (Apple Animation), QuickTime Graphics (Apple Graphics), Apple Video |
Audio | QDesign Music Codec 2 and ALAC | |
Adobe Flash Player (SWF) | Video | Screen video, Screen video 2, Sorenson Spark and VP6 |
Audio | Adobe SWF ADPCM and Nellymoser Asao | |
Aldus / Adobe | Image | TIFF |
Xiph.Org | Video | Theora |
Audio | Speex (via libspeex), Vorbis, Opus and FLAC | |
Subtitle | Ogg Writ | |
Sony | Audio | Adaptive Transform Acoustic Coding (ATRAC1, ATRAC3 and ATRAC3Plus)[32][33] and PSX ADPCM |
NTT | Audio | TwinVQ |
On2 / GIPS / Google | Video | Duck TrueMotion 1, Duck TrueMotion 2, VP3, VP5,[32] VP6,[32] VP7, VP8, VP9[17] and animated WebP |
Audio | DK ADPCM Audio 3/4, On2 AVC and iLBC (via libilbc) | |
Image | WebP | |
RAD Game Tools | Video | Smacker video and Bink video |
DSP Group | Audio | Truespeech |
RenderWare | Video | TXD[34] |
Netpbm | Image | PBM, PGM and PPM |
MIT/X Consortium | Image | XBM and xwd |
Silicon Graphics | Video | Silicon Graphics RLE 8-bit video, Silicon Graphics MVC1/2 |
Image | Silicon Graphics Image | |
Sun Microsystems | Image | Sun Raster |
IBM | Video | IBM UltiMotion |
Avid Technology / Truevision | Video | Avid 1:1x, Avid Meridien and Avid DNxHD |
Image | Targa | |
Autodesk / Alias | Video | Autodesk Animator Studio Codec and FLIC |
Image | Alias PIX | |
Grass Valley / Canopus | Video | HQ, HQA, HQX and Lossless |
Industrial Light & Magic / Lucasfilm | Image | OpenEXR |
Mozilla Corporation | Video | APNG |
The default MPEG-4 codec used by FFmpeg for encoding has the FourCC of FMP4.
Container formats
- ASF
- AVI and also input from AviSynth
- BFI[35]
- CAF
- FLV
- GXF, General eXchange Format, SMPTE 360M
- IFF[36]
- ISO base media file format (including QuickTime, 3GP and MP4)
- Matroska (including WebM)
- Maxis XA[37]
- MPEG program stream
- MPEG transport stream (including AVCHD)
- MXF, Material eXchange Format, SMPTE 377M
- MSN Webcam stream[38]
- NUT[12]
- Ogg
- OMA[39]
- RL2[40]
- TXD[34]
- WTV
Protocols
- Open standards
- IETF FTP, TCP, UDP, UDP-Lite, Gopher, HTTP, RTP, RTSP, SDP
- SFTP (via libssh)
- HLS[41]
- Server Message Block (via libsmbclient)
- MMS over TCP and MMS over HTTP
- Icecast protocol
- Proprietary
- Adobe RTMP, RTMPT, RTMPE, RTMPTE and RTMPS
- RealMedia RTSP/RDT
Pixel formats
FFmpeg supports many pixel formats.[42] Some of these formats are only supported as input formats, the command ffmpeg -pix_fmts
lists brief explanations. Example, as of 2015[update] the grayscale with alpha format ya16be
(corresponding to NetPBM PAM GRAYSCALE_ALPHA
in 32 bits) was not yet supported as output format.
Type | Color | Packed | Planar | Palette | ||||
---|---|---|---|---|---|---|---|---|
Without alpha | With alpha | With padding | Without alpha | With alpha | Chroma-interleaved | With alpha | ||
Monochrome | Binary (1-bit monochrome) | monoblack, monowhite | - | - | - | - | - | - |
Grayscale | 8 / 16bpp | 16 / 32bpp | - | - | - | - | - | |
RGB | RGB 1:2:1 (4-bit color) | 4bpp | - | - | - | - | - | - |
RGB 3:3:2 (8-bit color) | 8bpp | - | - | - | - | - | - | |
RGB 5:5:5 (High color) | 16bpp | - | - | - | - | - | - | |
RGB 5:6:5 (High color) | 16bpp | - | - | - | - | - | - | |
RGB/BGR 4:4:4 | 24 / 48bpp | 32 / 64bpp | 32bpp[pixel-notes 1] | - | - | - | 8bit->32bpp | |
GBR 4:4:4[pixel-notes 2] | - | - | - | 8 / 9 / 10 / 12 / 14 / 16bpc | 8 / 16bpc | - | - | |
YUV | YUV 4:1:1 | 8bpc | - | - | 8bpc | - | - | - |
YUV 4:2:0 | - | - | - | 8 / 9 / 10 / 12 / 14 / 16bpc | 8 / 9 / 10 / 16bpc | 8bpc (NV12, NV21) | - | |
YUV 4:2:2 | 8bpc | - | - | 8 / 9 / 10 / 16bpc | 8 / 9 / 10 / 16bpc | 8 (NV16) / 10bpc (NV20) | - | |
YUV 4:4:0 | - | - | - | 8 / 10 / 12bpc | - | - | - | |
YUV 4:4:4 | - | 16bpc | - | 8 / 9 / 10 / 16bpc | 8 / 9 / 10 / 16bpc | (8bpc (NV24)) | - | |
XYZ | XYZ 4:4:4[pixel-notes 3] | 12bpc | - | - | - | - | - | - |
Bayer | BGGR/RGGB/GBRG/GRBG | 8 / 16bpc | - | - | - | - | - | - |
Note that FFmpeg still does not support CYMK, RGB Float, RGBE, Log RGB and such like.
Legal aspects
FFmpeg contains more than 100 codecs,[43] 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.[44] Such claims may be enforceable in countries like the United States which have implemented software patents, but are considered unenforceable or void in countries that have not implemented software patents like in the European Union.
FFmtech Foundation
In June 2011 an election was organized to establish the board of FFmtech foundation,[45] a non-profit organization dedicated for managing donation funds. It was designed to offer reimbursement for expenses and work done to FFmpeg and Libav. However, according to FFmpeg developer Ronald Bultje the results have been doubtful.[46]
Projects using FFmpeg
FFmpeg is used by software such as VLC media player, xine, HandBrake, Plex, Blender, YouTube,[47] and MPC-HC;[48] it handles video and audio playback in Google Chrome,[48] and Linux version of Firefox.[49] Graphical user interface front-ends for FFmpeg have been developed, including Avanti,[50] and XMedia Recode. JavaCV, a Java wrapper for OpenCV, includes a supplementary Java wrapper for FFmpeg.[51]
FFmpeg is used by ffdshow, LAV Filters, GStreamer FFmpeg plug-in, Perian and OpenMAX IL to expand the encoding and decoding capabilities of their respective multimedia platform.
Example Uses
- Download a stream from DLive and combine the stream packets into a single MP4 video.[1] Set
URLS
to an array of the download URLs that DLive provides; you must be logged in as the creator to see them. The array makes it easy to combine streams that have been interrupted; the oldest link should be first.
i=1 for j in `seq 0 $(expr ${#URLS[@]} - 1)` do PLAYLIST=`echo ${URLS[j]} | sed 's:^.*/\([a-z0-9\-]*\.m3u8\)$:\1:'` wget ${URLS[j]} cat $PLAYLIST | sed /^#.*/d | wget -i - for f in `cat $PLAYLIST | sed /^#.*/d | sed 's:^.*/\([a-z0-9\-]*\.ts\)$:\1:'` do mv $f $i.ts i=`expr $i + 1` done rm $PLAYLIST done ffmpeg -i "`python -c "print('concat:' + '|'.join(['%s.ts' % x for x in range(1,$(echo $i))]))"`" -c copy -bsf:a aac_adtstoasc video.mp4 rm *.ts
- Extract a clip from a longer video. Where
URL
is set to the URL of the video andSTART
andDURATION
are set as follows.[2]
ffmpeg -ss $START -i $URL -to $DURATION -c copy clip.mp4
START |
DURATION |
Description |
---|---|---|
00:23:57 | 00:06:05 | José/JosB from the Feed the Bearspecial |
01:11:57 | 00:03:00 | Bike Song from How Dare Mespecial |
25:42 | 08:38 | Jane Bond, Gentile Song, and Bici song from the You're Doing Great Kidspecial |
0:15 | 1:10 | Disembodied Satan voice. Add -an flag to remove audio.[3] |
30:48 | 4:31 | Kaufman COVID-19 conclusion. URL=https://www.andrewkaufmanmd.com/vids/The%20Rooster%20in%20the%20River%20of%20Rats.mp4 |
See also
- MEncoder, a similar project
- RetroCode, a similar project
- Open source codecs and containers
References
<templatestyles src="Reflist/styles.css" />
Cite error: Invalid <references>
tag; parameter "group" is allowed only.
<references />
, or <references group="..." />
External links
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ FFmpeg can be configured to make it proprietary and unredistributable software because libfaac and libaacplus, two optional external libraries, are proprietary software and cannot be distributed under the terms of the GPL.
- ↑ 6.0 6.1 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ 10.0 10.1 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ 12.0 12.1 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ 17.0 17.1 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ 18.0 18.1 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ FFmpeg and a thousand fixes; January 10, 2014; Google.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ 32.0 32.1 32.2 32.3 32.4 32.5 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ 34.0 34.1 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ 48.0 48.1 Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- ↑ Lua error in package.lua at line 80: module 'strict' not found.
- Pages with reference errors
- Articles containing potentially dated statements from 2015
- Official website not in Wikidata
- C libraries
- Cross-platform free software
- Free codecs
- Free computer libraries
- Free music software
- Free software programmed in C
- Free video conversion software
- Multimedia frameworks
- Software written primarily in assembly language
- Command-line software