Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is ffmpeg, avcodec, x264? [closed]

From wiki, I read that

FFmpeg is a free software project that produces libraries and programs for handling multimedia data. The most notable parts of FFmpeg are 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.

So ffmpeg is a wrapper of avcodec? And I often hear that people encode video with x264 using ffmpeg. So ffmpeg is also a wrapper of x264?

How are they related ?

like image 224
onmyway133 Avatar asked May 27 '13 11:05

onmyway133


People also ask

What is ffmpeg option?

ffmpeg is a very fast video and audio converter that can also grab from a live audio/video source. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter.

What is ffmpeg codec?

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 of video and audio files.

Does ffmpeg support opus?

The Opus audio codec looks like the best codec so far for compressing audio. It has recently become supported in the latest ffmpeg and VLC players.


1 Answers

First of all, to clear up some terms:

  • FFmpeg is a software project with lots of people involved, a Wiki, a bug tracker, some funding, etc.
  • ffmpeg is one of the tools they offer (others are ffplay and qt-faststart, for example).
  • Libav was fork of the FFmpeg project, which supplied the avconv binary. Some distributions decided to ship Libav instead of FFmpeg programs for some time, notably Ubuntu, which caused a bit of confusion in the transition period where the Libav command was still named ffmpeg. Current Ubuntu uses the "real" ffmpeg again.

The ffmpeg tool is, like you said, a command line wrapper for a number of libraries designed for handling multimedia content. These include:

  • libavcodec, for encoding and decoding of audio, video and subtitle bitstreams
  • libavformat, for muxing and demuxing containers
  • libavfilter, for applying a variety of filters on audio, video and subtitles
  • libswscale, which scales images and video or resamples audio
  • libavresample, which was originally pushed to Libav and later integrated into FFmpeg. See this thread for more about the history.

While the FFmpeg developers often provide their own encoders and decoders, you can enable third party libraries that have wrappers in libavcodec, in order to "glue" together FFmpeg and, say, x264, which is the most popular H.264 encoder. This is often done when there's simply no point in "reinventing the wheel", which would be the case if one decided to write a new H.264 encoder with the goal to be better than x264. In other cases, some libraries may not be shipped with an ffmpeg build due to licensing reasons, such as libfaac—in that case, ffmpeg offers a native AAC encoder.

Common external encoders include:

  • libx264
  • libvpx (for VP8 and VP9 video)
  • libfaac, libfdk-aac, libvo-aacenc for AAC audio
  • libmp3lame
  • libvorbis
  • libxvid

For all of those you will find the wrappers under libavcodec, e.g. for libx264, the file libx264.c provides the necessary code to push the video from the FFmpeg-internal format to the x264 encoder, and then pass that on to libavformat to write it into a file. The actual encoding is done through libx264.

As mentioned before, other encoders such as the one for MPEG-4 are native to FFmpeg and do not rely on external libraries at all.

Finally, there are several programs that make use of FFmpeg tools and libraries, be it by providing an ffmpeg executable, or by picking parts of the libavcodec and libavformat libraries. This is allowed per the license and makes FFmpeg the most popular collection of multimedia tools today.

like image 196
slhck Avatar answered Oct 31 '22 11:10

slhck