2014-11-10 更新
2014-11-16 更新:字幕提取相关
2014-11-22 更新: 更多有用链接
==================
What is ffmpeg, avcodec, x264?
- 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).
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.
Common external encoders include:
- libx264
- libvpx (for VP8 and VP9 video)
- libfaac, libfdk-aac, libvo-aacenc for AAC audio
- libmp3lame
- libvorbis
- libxvid
What's the difference between FFmpeg's “-vcodec copy” and “-sameq”?
sameq does not mean "same quality"
=========== 2014-11-10 ============
General FFmpeg encoding guide
MPEG-4 Encoding Guide
FF FFMPEG and H.264 Encoding Guide
FFmpeg command to convert to DivX
Up-to-date syntax:
ffmpeg -i input.file -c:v mpeg4 -q:v 5 -tag:v DIVX -s 640x480 -c:a libmp3lame -q:a 5 -ac 2 -ar 44100 output.avi
Old syntax:
ffmpeg -i input.file -vcodec mpeg4 -qscale 5 -vtag DIVX -s 640x480 -acodec libmp3lame -aq 5 -ac 2 -ar 44100 output.avi
Two-pass encoding
Note that Windows users need to use NUL
rather than /dev/null
. Use this if you want to target a specific size, otherwise just use the VBR quality-targeting -qscale
option. These examples will fit a 90-minute movie onto a 700 MB CD-ROM.
Up-to-date syntax:
ffmpeg -y -i input.file -c:v mpeg4 -b:v 868k -tag:v DIVX -s 640x480 -an -pass 1 -f rawvideo /dev/null
ffmpeg -i input.file -c:v mpeg4 -b:v 868k -tag:v DIVX -s 640x480 -c:a libmp3lame -b:a 192k -ac 2 -ar 44100 -pass 2 output.avi
Old syntax:
ffmpeg -y -i input.file -vcodec mpeg4 -b 868k -vtag DIVX -s 640x480 -an -pass 1 -f rawvideo /dev/null
ffmpeg -i input.file -vcodec mpeg4 -b 868k -vtag DIVX -s 640x480 -acodec libmp3lame -ab 192k -ac 2 -ar 44100 -pass 2 output.avi
Note that you don't strictly need -ac 2
, since MP3 only supports two channels, so any surround-sound audio will automatically get mixed down.
H.264 Profile、Level、Encoder三张简图
=========== 2014-11-16 ============
Extracting an embedded subtitle from a video file using FFMPEG
Is it possible to extract SubRip (SRT) subtitles from an MP4 video with ffmpeg?
=========== 2014-11-22 ============
Guidelines for high quality lossy audio encoding
ConversionMatrix
![](http://upload.wikimedia.org/wikipedia/commons/thumb/e/e5/Vector_Video_Standards2.svg/1920px-Vector_Video_Standards2.svg.png)