# Libavcodec

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Libavcodec
> Markdown URL: https://mediated.wiki/source/Libavcodec.md
> Source: https://en.wikipedia.org/wiki/Libavcodec
> Source revision: 1343385292
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Library of multimedia codecs}}
{{lowercase}}
{{Infobox software
| name = libavcodec
| logo = 
| screenshot = 
| caption = 
| collapsible = 
| author = 
| developer = [FFmpeg](/source/FFmpeg) team
| released = 
| latest release version = 62.11.100
| latest release date = {{Start date and age|2025|11|20}}<ref name=Releases>{{cite web |url=http://ffmpeg.org/download.html#releases |title=Releases |work=ffmpeg.org |publisher=FFmpeg |access-date=2025-12-03 |archive-date=2013-09-27 |archive-url=https://web.archive.org/web/20130927101526/http://ffmpeg.org/download.html#releases |url-status=live }}</ref>
| latest preview version = 
| latest preview date = 
| programming language = [C99](/source/C99)
| operating system = Available for [Windows](/source/Windows), [macOS](/source/macOS), [Linux](/source/Linux) but may be [compiled](/source/compiled) for any other OS<ref name=Homepage>{{cite web |url=http://ffmpeg.org/download.html |title=Download |work=ffmpeg.org |publisher=FFmpeg |access-date=2012-01-04 |archive-date=2013-09-27 |archive-url=https://web.archive.org/web/20130927101526/http://ffmpeg.org/download.html |url-status=live }}</ref>
| platform = Available for [x86](/source/x86) and [ARM](/source/ARM_architecture_family) but may be [compiled](/source/compiled) for other processor architectures
| size = 
| language = 
| status = 
| genre = Multimedia [Library](/source/Library_(computing))
| license = [GNU LGPL](/source/GNU_Lesser_General_Public_License) 2.1+ or [GNU GPL](/source/GNU_General_Public_License) 2+ or non-redistributable if compiled as such<ref name="ReferenceA">libavcodec can be configured to make it a proprietary and non-redistributable library since some optional external libraries are proprietary software and cannot be distributed under the terms of the GPL (e.g. [Decklink](/source/Blackmagic_Design)).</ref>
| website = {{url|https://ffmpeg.org}}
}}
{{Portal|Free and open-source software}}
'''libavcodec''' is a [free and open-source](/source/free_and_open-source)<ref>{{cite web |url=http://www.libav.org/legal.html | archive-url=https://web.archive.org/web/20210515062117/https://www.libav.org/legal/ | archive-date=2021-05-15 |title=Libav License and Legal Considerations |publisher=libav.org |access-date=2013-05-07}}</ref> library of [codecs](/source/codecs) for encoding and decoding video and audio data.<ref>{{citation |url=http://www.afterdawn.com/glossary/terms/libavcodec.cfm |title=libavcodec – AfterDawn: Glossary of technology terms & acronyms |publisher=AfterDawn |date=2010-07-02 |access-date=2012-01-17 |archive-date=2010-02-14 |archive-url=https://web.archive.org/web/20100214044958/http://www.afterdawn.com/glossary/terms/libavcodec.cfm |url-status=live }}</ref>

libavcodec is an integral part of many open-source multimedia applications and frameworks. The popular [MPV](/source/Mpv_(media_player)), [xine](/source/xine) and [VLC](/source/VLC_media_player) media players use it as their main, built-in decoding engine that enables playback of many audio and video formats on all supported platforms. It is also used by the [ffdshow](/source/ffdshow) tryouts decoder as its primary decoding library. libavcodec is also used in video editing and transcoding applications like [Avidemux](/source/Avidemux), [MEncoder](/source/MEncoder) or [Kdenlive](/source/Kdenlive) for both decoding and encoding.

libavcodec contains decoder and sometimes encoder implementations of several proprietary formats, including ones for which no public specification has been released. As such, a significant [reverse engineering](/source/reverse_engineering) effort is part of libavcodec development. Having such codecs available within the standard libavcodec framework gives a number of benefits over using the original codecs, most notably increased [portability](/source/Software_portability), and in some cases also better performance, since libavcodec contains a standard library of highly optimized implementations of common building blocks, such as [DCT](/source/discrete_cosine_transform) and [color space](/source/color_space) conversion. However, while libavcodec does strive to achieve decoding that is bit-exact to their official format implementations, occasional bugs and missing features in such re-implementations can sometimes introduce playback compatibility problems for certain files.

==Implemented video codecs==
libavcodec includes video decoders and/or encoders for the following formats, this list is not exhaustive:<ref name='docs'>{{citation |url=http://www.ffmpeg.org/general.html#SEC6 |title=General Documentation |publisher=Ffmpeg.org |access-date=2021-05-05 |archive-date=2019-07-17 |archive-url=https://web.archive.org/web/20190717040636/http://ffmpeg.org/general.html#SEC6 |url-status=live }}</ref>
{{columns-list|colwidth=30em|
* [Animated GIF](/source/Animated_GIF)
* [Asus](/source/Asus) video format v1 and v2
* [AVS](/source/Audio_Video_Standard) (decoding only, encoding through libxavs)
* [AV1](/source/AV1)
* [Bink Video](/source/Bink_Video)/Audio (decoding only, version 2 not supported)
* [CamStudio](/source/CamStudio) format (decoding only)
* [CineForm](/source/CineForm) (decoding only)
* [Cinepak](/source/Cinepak)
* [Creative](/source/Creative_Technology) YUV (CYUV, decoding only)
* [Dirac](/source/Dirac_(video_compression_format))
* [DNxHD](/source/DNxHD_codec)
*  Duck Corporation Truemotion 1, 2, and RT codecs (decoding only)
* [FFV1](/source/FFV1)
* [Flash Screen Video v1 and v2](/source/Flash_Video)
* [H.261](/source/H.261)
* [H.262/MPEG-2 Part 2](/source/H.262%2FMPEG-2_Part_2)
* [H.263](/source/H.263)
* [H.264/MPEG-4 AVC](/source/H.264%2FMPEG-4_AVC) (native decoder, encoding through [x264](/source/x264) and hardware encoding)
* [H.265 HEVC](/source/High_Efficiency_Video_Coding) (native decoder, encoding through [x265](/source/x265) and hardware encoding)
* [Huffyuv](/source/Huffyuv)
* [id Software](/source/id_Software) RoQ Video
* [Indeo](/source/Indeo) (decoding only)
* [Lagarith](/source/Lagarith) (decoding only)
* [MJPEG](/source/MJPEG)
* [MPEG-1](/source/MPEG-1)
* [MPEG-4 Part 2](/source/MPEG-4_Part_2) (the format used for example by the popular [DivX](/source/DivX) and [Xvid](/source/Xvid) codecs)
* [Apple ProRes](/source/ProRes_422)
* [QuickDraw](/source/QuickDraw) (decoding only)
* [QuickTime](/source/QuickTime): [Graphics](/source/QuickTime_Graphics) (decoding only), [Video](/source/Apple_Video) (decoding only) and [Animation](/source/QuickTime_Animation) (RLE)
* [RealVideo](/source/RealVideo) RV10 and RV20
* RealVideo RV30 and RV40 (decoding only)
* [SheerVideo](/source/SheerVideo) (decoding only)
* [Smacker video](/source/Smacker_video) (decoding only)
* [Snow](/source/Snow_(codec))
* [Sorenson Spark](/source/Sorenson_Spark) under the name FLV1
* [SVQ1](/source/SVQ1)
* [SVQ3](/source/SVQ3) (decoding only)
* [Theora](/source/Theora) (native decoder, encoding through [libtheora](/source/libtheora))
* [TrueMotion](/source/TrueMotion) v1 and v2 (decoding only)
* [VC-1](/source/VC-1) (decoding only)
* [Sierra](/source/Sierra_Entertainment) VMD Video (decoding only)
* [VMware](/source/VMware) VMnc (decoding only)
* [VP3](/source/VP3) (decoding only)
* [VP5](/source/VP5) (decoding only)
* [VP6](/source/VP6) (decoding only)
* [VP7](/source/VP7) (decoding only)
* [VP8](/source/VP8) (native decoder, encoding through [libvpx](/source/libvpx))
* [VP9](/source/VP9) (native decoder, encoding through libvpx)
* [VQA](/source/.VQA) (decoding only)
* [VVC](/source/Versatile_Video_Coding) (native decoder)<ref>{{Cite web |title=git.ffmpeg.org Git - ffmpeg.git/commit |url=https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/301ed950d1c3c500d0c2eee8472587dc5e691c04 |access-date=2024-01-03 |website=git.ffmpeg.org}}</ref>
* [WMV](/source/Windows_Media_Video) version 7 and 8
* WMV version 9 (decoding only)
* [Windows Media Video Image](/source/Windows_Media_Video_Image) (decoding only)
* [Windows Media Video Screen](/source/Windows_Media_Video_Screen) 1 and 2 (decoding only)
* [Wing Commander](/source/Wing_Commander_(video_game))/Xan Video (decoding only)
}}

==Implemented audio codecs==
libavcodec includes decoders and encoders for the following formats:<ref name='docs'/>
{{columns-list|colwidth=30em|
* [8SVX](/source/8SVX) (decoding only)
* [AAC](/source/Advanced_Audio_Coding)
* [AC-3](/source/Dolby_AC-3)
* [AMR](/source/Adaptive_Multi-Rate_audio_codec) (decoding only)
* [AMR-WB](/source/Adaptive_Multi-Rate_Wideband) (decoding only)
* [Apple Lossless](/source/Apple_Lossless)
* [ATRAC](/source/Adaptive_Transform_Acoustic_Coding)1, ATRAC3, ATRAC3plus and ATRAC9 (decoding only)
* [Codec 2](/source/Codec_2)
* [Cook Codec](/source/Cook_Codec) (decoding only)
* [DTS](/source/DTS_Coherent_Acoustics) (encoder is highly experimental)
* [EA ADPCM](/source/SimCity_3000) (decoding only)
* [E-AC-3](/source/E-AC-3)
* [EVRC](/source/Enhanced_Variable_Rate_Codec) (decoding only)
* [FLAC](/source/FLAC)
* [G.711](/source/G.711) ([μ-law](/source/%CE%BC-law_algorithm) and [A-law](/source/A-law_algorithm))
* [G.722](/source/G.722)
* [G.723.1](/source/G.723.1)
* [G.726](/source/G.726)
* [G.729](/source/G.729) (decoding only)
* [GSM 06.10](/source/Full_Rate) (native decoder, encoding through [libgsm](/source/libgsm))
* [Intel](/source/Intel) Music Coder and Indeo Audio Coder (decoding only)
* [Meridian Lossless Packing](/source/Meridian_Lossless_Packing) / [Dolby TrueHD](/source/Dolby_TrueHD)
* [Monkey's Audio](/source/Monkey's_Audio) (decoding only)
* [MP1](/source/MP1) (decoding only)
* [MP2](/source/MP2_(format))
* [MP3](/source/MP3) (native decoder, encoding through [LAME](/source/LAME))
* [Nellymoser Asao Codec in Flash](/source/Nellymoser_Asao_Codec_in_Flash)
* [Opus](/source/Opus_(audio_format)) (native encoder and decoder, encoding through [libopus](/source/libopus))
* [QCELP](/source/QCELP) (decoding only)
* [QDM2](/source/QDesign) (decoding only)
* [RealAudio 1.0](/source/VSELP)
* [RealAudio 2.0](/source/LD-CELP) (decoding only)
* [Shorten](/source/Shorten_(file_format)) (decoding only)
* [Truespeech](/source/Truespeech) (decoding only)
* TTA
* [TwinVQ](/source/TwinVQ) (decoding only)
* [Vorbis](/source/Vorbis)
* [WAV](/source/WAV)
* [WavPack](/source/WavPack)
* [Windows Media Audio](/source/Windows_Media_Audio) 1 and 2
* [Windows Media Audio 9 Lossless](/source/Windows_Media_Audio_9_Lossless) (decoding only)
* [Windows Media Audio 9 Professional](/source/WMA_Pro) (decoding only)
* [Windows Media Audio Voice](/source/Windows_Media_Audio) (decoding only)
}}

== Legal aspects ==
Libavcodec contains more than 100 codecs,<ref>{{cite web |url=http://ffmpeg.org/general.html#SEC8 |title=Codecs list |publisher=ffmpeg.org |access-date=2012-01-01 |archive-date=2014-06-29 |archive-url=https://web.archive.org/web/20140629194528/http://ffmpeg.org/general.html#SEC8 |url-status=live }}</ref> most of which do not just store uncompressed data. Most codecs that compress information could be claimed by patent holders.<ref>{{cite web |url=http://ffmpeg.org/legal.html |title=Legal information on FFmpeg's website |publisher=ffmpeg.org |access-date=2012-01-04 |archive-date=2010-09-18 |archive-url=https://web.archive.org/web/20100918222108/http://ffmpeg.org/legal.html |url-status=live }}</ref> Such claims may be enforceable in countries like the United States which have implemented [software patent](/source/software_patent)s, but are considered unenforceable or void in countries that have not implemented software patents.

Furthermore, many of these codecs are only released under terms that forbid reverse engineering, even for purposes of interoperability. These terms of use are forbidden in certain countries. For example, some [European Union](/source/European_Union) nations have not implemented software patents and have laws expressly allowing [reverse engineering](/source/reverse_engineering) for purposes of interoperability.<ref>[Council Directive 91/250/EEC of 14 May 1991 on the legal protection of computer programs](/source/Directive_on_the_legal_protection_of_computer_programs)</ref>

==Libraries that depend on libavcodec==
* libavformat (part of [FFmpeg](/source/FFmpeg))
* libgegl (optional part of [GEGL](/source/GEGL))
** libgimp (part of [GIMP](/source/GIMP))
* libmpcodecs (part of [MPlayer](/source/MPlayer))
** libmpdemux (part of MPlayer)

==Applications using libavcodec==
{{main category|Software that uses FFmpeg}}
===Video players===
* [FFplay](/source/FFmpeg)
* [MPlayer](/source/MPlayer)
* [mpv](/source/mpv_(media_player))
* [MPC-HC](/source/MPC-HC) and [MPC-BE](/source/MPC-BE)
* [VLC](/source/VLC_media_player)
* [xine](/source/xine)

===Audio players===
* [Audacious](/source/Audacious_(software)) (Uses in audacious-plugins's ffaudio)
* [Rockbox](/source/Rockbox) (Includes only FLAC code)
* XMMS2

===Multimedia players===
* [Gnash](/source/Gnash_(software))
* [Moonlight](/source/Moonlight_(runtime))
* [swfdec](/source/swfdec)

===Video editors===
{{See also|Comparison of video editing software}}
* [Avidemux](/source/Avidemux)
* [Cinelerra](/source/Cinelerra)
* [Kdenlive](/source/Kdenlive)
* [Kino](/source/Kino_(software))

===Audio editors===
* [Audacity](/source/Audacity_(audio_editor)) (since 1.3.6)
* [SoX](/source/SoX) (optional)

===Video converters===
* [FFmpeg](/source/FFmpeg)
* [HandBrake](/source/HandBrake)
* [MEncoder](/source/MEncoder)
* [SUPER](/source/SUPER_(computer_program))

===Video libraries===
* [GPAC](/source/GPAC_Project_on_Advanced_Content)<ref>{{Cite book|title=Proceedings of the 29th ACM International Conference on Multimedia|arxiv=2107.13385|last1=Wieckowski|first1=Adam|last2=Lehmann|first2=Christian|last3=Bross|first3=Benjamin|last4=Marpe|first4=Detlev|last5=Biatek|first5=Thibaud|last6=Raulet|first6=Mickael|author7=Jean Le Feuvre|chapter=A Complete End to End Open Source Toolchain for the Versatile Video Coding (VVC) Standard |year=2021|pages=3795–3798 |doi=10.1145/3474085.3478320 |isbn=9781450386517 |s2cid=236469263 }}</ref>
* [Media Lovin' Toolkit](/source/Media_Lovin'_Toolkit)

===Optical disc authoring===
* [K3b](/source/K3b)

===Graphics libraries===
* [GEGL](/source/GEGL)
* [ImageMagick](/source/ImageMagick)

===3D graphics editors===
* [Blender](/source/Blender_(software))<ref>{{citation |url=https://books.google.com/books?id=OaAl4PdZs5EC&q=Blender+ffmpeg&pg=PT332 |title=Blender for Dummies |page=320 |date=13 April 2009 |isbn=9780470471586 |access-date=2012-01-17 |last1=Gumster |first1=Jason van |publisher=Wiley |archive-date=2022-03-14 |archive-url=https://web.archive.org/web/20220314065036/https://books.google.com/books?id=OaAl4PdZs5EC&q=Blender+ffmpeg&pg=PT332 |url-status=live }}</ref>

===VoIP===
* [Ekiga](/source/Ekiga)
* [QuteCom](/source/QuteCom)
* [Linphone](/source/Linphone)

===Multimedia streaming server===
* [FFserver](/source/FFmpeg)
* [VLC media player](/source/VLC_media_player)

===Multimedia frameworks===
* [ffdshow](/source/ffdshow) (wraps libavcodec as a [DirectShow](/source/DirectShow) filter and adds postprocessing to improve image quality; once installed, it is automatically used by all Windows DirectShow video players, such as [Windows Media Player](/source/Windows_Media_Player), [Media Player Classic](/source/Media_Player_Classic), [Winamp](/source/Winamp) etc. It also wraps libavcodec as a [Video for Windows](/source/Video_for_Windows) filter; the framework used by most video editing software.)
* [LAV Filters](/source/LAV_Filters)
* [GStreamer](/source/GStreamer) via the GStreamer FFmpeg [plugin](/source/Plug-in_(computing))
* [Perian](/source/Perian)
* [Bellagio OpenMAX Integration Layer](/source/OpenMAX_IL) – open-source OpenMAX IL API implementation

===Computer vision libraries===
* [OpenCV](/source/OpenCV)<ref>{{citation |url=https://books.google.com/books?id=seAgiOfu2EIC&q=libavcodec&pg=PA9 |title=Learning OpenCV: computer vision with the OpenCV library |page=9 |date=2008-09-24 |isbn=9780596554040 |access-date=2012-01-17 |last1=Bradski |first1=Gary |last2=Kaehler |first2=Adrian |publisher="O'Reilly Media, Inc." |archive-date=2021-08-27 |archive-url=https://web.archive.org/web/20210827165349/https://books.google.com/books?id=seAgiOfu2EIC&q=libavcodec&pg=PA9 |url-status=live }}</ref>

===Browser===
* [Google Chrome](/source/Google_Chrome)<ref>{{citation |url=http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-May/020001.html |title=whatwg MPEG-1 subset proposal for HTML5 video codec |publisher=Lists.whatwg.org |access-date=2012-01-17 |url-status=dead |archive-url=https://web.archive.org/web/20120219233043/http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-May/020001.html |archive-date=2012-02-19 }}</ref>
* [Mozilla Firefox](/source/Mozilla_Firefox)<ref>{{Cite web |title=Firefox Source Code Libavcodec |url=https://hg.mozilla.org/mozilla-central/file/tip/media/ffvpx/libavcodec |archive-date= |access-date=2024-01-08 |website=Firefox source code repository}}</ref>

===Media center===
* [MythTV](/source/MythTV)
* [Plex](/source/Plex)
* [Kodi (formerly XBMC)](/source/Kodi_(software))

===Screen capture===
* xvidcap<ref name="ifip-20th-p167">{{citation |url=https://books.google.com/books?id=lfVAJe6El1IC&q=avidemux_libavcodec&pg=PT167 |title=Open Source Development, Communities and Quality: IFIP 20th World Computer |page=167 |date=17 July 2008 |isbn=9780387096834 |access-date=2012-01-17 |last1=Russo |first1=Barbara |last2=Damiani |first2=Ernesto |last3=Hissam |first3=Scott |last4=Lundell |first4=Björn |last5=Succi |first5=Giancarlo |publisher=Springer |archive-date=2021-08-29 |archive-url=https://web.archive.org/web/20210829085604/https://books.google.com/books?id=lfVAJe6El1IC&q=avidemux_libavcodec&pg=PT167 |url-status=live }}</ref>

===Device utilities===
* [BitPim](/source/BitPim) – utilities for CDMA phones

===CCTV===
* [ZoneMinder](/source/ZoneMinder) – video camera security suite
* Motion – video camera security/monitoring program

===Games===
* [Performous](/source/Performous) – music game including singing, band and dance.
* [StepMania](/source/StepMania)
* [Ultrastar](/source/UltraStar)
* [osu!](/source/osu!)

===Others===
* [CorePlayer](/source/CorePlayer)
* [FreeJ](/source/FreeJ)
* [Ingex](/source/Ingex) Studio – used by [BBC](/source/BBC)
* [PulseAudio](/source/PulseAudio) – includes only resamplers code<ref>{{citation |url=http://git.0pointer.de/?p=pulseaudio.git;a=tree;f=src/pulsecore/ffmpeg |archive-url=https://archive.today/20120713060425/http://git.0pointer.de/?p=pulseaudio.git;a=tree;f=src/pulsecore/ffmpeg |url-status=dead |archive-date=2012-07-13 |title=pulseaudio.git/tree – src/pulsecore/ffmpeg/ |publisher=Git.0pointer.de |access-date=2012-01-17 }}</ref>
* [Steam](/source/Steam_(service)) digital distribution service

==References==
{{reflist|30em}}

{{Compression Software Implementations}}
{{Compression formats}}

Category:Audio libraries
Category:C (programming language) libraries
Category:Free codecs
Category:Free computer libraries
Category:Video libraries
Category:Free software programmed in C
Category:Software using the GNU General Public License

---
Adapted from the Wikipedia article [Libavcodec](https://en.wikipedia.org/wiki/Libavcodec) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Libavcodec?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
