问题描述
从,我看到
那么ffmpeg是avcodec的包装器?而且我经常听到人们用x264编码视频,使用ffmpeg。所以ffmpeg也是x264的包装?
他们是如何相关的?
首先,要清除一些条款:
- FFmpeg是一个涉及很多人的软件项目,一个维基,一个错误跟踪器,一些资金等。
-
ffmpeg
是他们提供的工具之一(其他都是例如,ffplay
和qt-faststart
。 - 是FFmpeg项目的分支,它提供
avconv
二进制文件。他们都是独立发展的,但是FFmpeg通常将Libav的承诺并不是相反的。 (有些人可能会说Libav遭受的影响)。一些分配决定运送Libav而不是FFmpeg程序,特别是Ubuntu,这在Libav命令仍被命名为ffmpeg
的过渡期间造成了一些混乱。现在Ubuntu再次使用真实的ffmpeg
ffmpeg
工具就像您所说的一样,用于处理多媒体内容的多个库的命令行包装器。这些包括:
- libavcodec,用于的音频,视频和字幕比特率
- libavformat, containers
- libavfilter,用于在音频上应用,视频和字幕
- libswscale,或
- libavresample,最初被推送到Libav,然后集成到FFmpeg中。有关历史记录的更多信息,请参阅。
尽管FFmpeg开发人员经常提供自己的编码器和解码器,您可以启用在libavcodec中包含封装的第三方库,以便将胶合在一起FFmpeg, ,这是最受欢迎的H.264编码器。这通常是在重新发明车轮根本没有意义的情况下完成的,如果决定编写一个新的H.264编码器,目标是要比x264更好,那就是这种情况。在其他情况下,由于许可证原因,某些库可能不会附带 ffmpeg
build,例如libfaac,在这种情况下, ffmpeg $通常的外部编码器包括:
- libvpx(适用于VP8和VP9视频)
- libfaac,libfdk-aac,AAC音频的libvo-aacenc
- libmp3lame
- libvorbis
- libxvid
li> libx264
对于所有这些,您将在libavcodec下找到包装器,例如对于libx264,提供必要的代码,将视频从FFmpeg内部格式推送到x264编码器,然后将其传递到libavformat以将其写入文件。实际编码是通过libx264完成的。
如前所述,其他编码器如是FFmpeg本地的,根本不依赖于外部库。
最后, 使用FFmpeg工具和库,无论是通过提供一个 ffmpeg
可执行文件,或通过选择libavcodec和libavformat库的部分。这是许可证允许的,并使FFmpeg成为当今最受欢迎的多媒体工具集。
From wiki, I read that
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 ?
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 areffplay
andqt-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 namedffmpeg
. 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:
- 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.
这篇关于什么是ffmpeg,avcodec,x264?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!