What is ffmpeg, avcodec, x264? [closed]

前提是你 提交于 2019-11-28 22:01:26

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 is a fork of the FFmpeg project, which supplies the avconv binary. They both develop independently, but FFmpeg usually merges commits from Libav—not the other way 'round. (Some might say Libav suffers from NIH). Some distributions decided to ship Libav instead of FFmpeg programs, notably Ubuntu, which caused a bit of confusion in the transition period where the Libav command was still named ffmpeg. Now 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:

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!