基本选项:  -formats  输出所有可用格式 
-f fmt  指定格式(音频或视频格式) 
-i filename  指定输入文件名,在linux下当然也能指定:0.0(屏幕录制)或摄像头 
-y  覆盖已有文件 
-t duration  记录时长为t 
-fs limit_size  设置文件大小上限 
-ss time_off  从指定的时间(s)开始, [-]hh:mm:ss[.xxx]的格式也支持 
-itsoffset time_off  设置时间偏移(s),该选项影响所有后面的输入文件。该偏移被加到输入文件的时戳,定义一个正偏移意味着相应的流被延迟了 offset秒。 [-]hh:mm:ss[.xxx]的格式也支持 
-title string  标题 
-timestamp time  时间戳 
-author string  作者 
-copyright string  版权信息 
-comment string  评论 
-album string  album名 
-v verbose  与log相关的 
-target type  设置目标文件类型("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...) 
-dframes number  设置要记录的帧数 

视频选项:  -b  指定比特率(bits/s),似乎ffmpeg是自动VBR的,指定了就大概是平均比特率 
-bitexact  使用标准比特率 
-vb  指定视频比特率(bits/s) 
-vframes number  设置转换多少桢(frame)的视频 
-r rate  帧速率(fps) (可以改,确认非标准桢率会导致音画不同步,所以只能设定为15或者29.97) 
-s size  指定分辨率 (320x240) 
-aspect aspect  设置视频长宽比(4:3, 16:9 or 1.3333, 1.7777) 
-croptop size  设置顶部切除尺寸(in pixels) 
-cropbottom size  设置底部切除尺寸(in pixels) 
-cropleft size  设置左切除尺寸 (in pixels) 
-cropright size  设置右切除尺寸 (in pixels) 
-padtop size  设置顶部补齐尺寸(in pixels) 
-padbottom size  底补齐(in pixels) 
-padleft size  左补齐(in pixels) 
-padright size  右补齐(in pixels) 
-padcolor color  补齐带颜色(000000-FFFFFF) 
-vn  取消视频 
-vcodec codec  强制使用codec编解码方式('copy' to copy stream) 
-sameq  使用同样视频质量作为源(VBR) 
-pass n  选择处理遍数(1或者2)。两遍编码非常有用。第一遍生成统计信息,第二遍生成精确的请求的码率 
-passlogfile file  选择两遍的纪录文件名为file 
-newvideo  在现在的视频流后面加入新的视频流 
 
高级视频选项  :-pix_fmt format  set pixel format, 'list' as argument shows all the pixel formats supported 
-intra  仅适用帧内编码 
-qscale q  以<数值>质量为基础的VBR,取值0.01-255,约小质量越好 
-loop_input  设置输入流的循环数(目前只对图像有效) 
-loop_output  设置输出视频的循环数,比如输出gif时设为0表示无限循环 
-g int  设置图像组大小 
-cutoff int  设置截止频率 
-qmin int  设定最小质量,与-qmax(设定最大质量)共用,比如-qmin 10 -qmax 31 
-qmax int  设定最大质量 
-qdiff int  量化标度间最大偏差 (VBR) 
-bf int  使用frames B 帧,支持mpeg1,mpeg2,mpeg4 
音频选项:  -ab  设置比特率(单位:bit/s,也许老版是kb/s)前面-ac设为立体声时要以一半比特率来设置,比如192kbps的就设成96,转换 默认比特率都较小,要听到较高品质声音的话建议设到160kbps(80)以上。 
-aframes number  设置转换多少桢(frame)的音频 
-aq quality  设置音频质量 (指定编码) 
-ar rate  设置音频采样率 (单位:Hz),PSP只认24000 
-ac channels  设置声道数,1就是单声道,2就是立体声,转换单声道的TVrip可以用1(节省一半容量),高品质的DVDrip就可以用2 
-an  取消音频 
-acodec codec  指定音频编码('copy' to copy stream) 
-vol volume  设置录制音量大小(默认为256) <百分比> ,某些DVDrip的AC3轨音量极小,转换时可以用这个提高音量,比如200就是原来的2倍 
-newaudio  在现在的音频流后面加入新的音频流 
字幕选项:  -sn  取消字幕 
-scodec codec  设置字幕编码('copy' to copy stream) 
-newsubtitle  在当前字幕后新增 
-slang code  设置字幕所用的ISO 639编码(3个字母) 
Audio/Video 抓取选项: 
-vc channel  设置视频捕获通道(只对DV1394) 
-tvstd standard  设置电视标准 NTSC PAL(SECAM) 

        要得到一个高画质音质低容量的MP4的话,首先画面最好不要用固定比特率,而用VBR参数让程序自己去判断,而音质参数可以在原来的基础上提升一点,听起来要舒服很多,也不会太大(看情况调整 ) 

        转换为flv:
    ffmpeg -i test.mp3 -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 test.flv
    ffmpeg -i test.wmv -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 test.flv

        转换文件格式的同时抓缩微图:
    ffmpeg -i "test.avi" -y -f image2 -ss 8 -t 0.001 -s 350x240 'test.jpg'

        对已有flv抓图:
    ffmpeg -i "test.flv" -y -f image2 -ss 8 -t 0.001 -s 350x240 'test.jpg'

        转换为3gp:
    ffmpeg -y -i test.mpeg -bitexact -vcodec h263 -b 128 -r 15 -s 176x144 -acodec aac -ac 2 -ar 22500 -ab 24 -f 3gp test.3gp
    ffmpeg -y -i test.mpeg -ac 1 -acodec amr_nb -ar 8000 -s 176x144 -b 128 -r 15 test.3gp

 
        例:ffmpeg -y -i "test.avi" -title "Test" -vcodec xvid -s 368x208 -r 29.97 - b 1500 -acodec aac -ac 2 -ar 24000 -ab 128 -vol 200 -f psp -muxvb 768 "test.***"

    # 参数解释:
    -y(覆盖输出文件,即如果1.***文件已经存在的话,不经提示就覆盖掉了)
    -i "1.avi"(输入文件是和ffmpeg在同一目录下的1.avi文件,可以自己加路径,改名字)
    -title "Test"(在PSP中显示的影片的标题)
    -vcodec xvid(使用XVID编码压缩视频,不能改的)
    -s 368x208(输出的分辨率为368x208,注意片源一定要是16:9的不然会变形)     -r 29.97(帧数,一般就用这个吧)
    -b 1500(视频数据流量,用-b xxxx的指令则使用固定码率,数字随便改,1500以上没效果;还可以用动态码率如:-qscale 4和-qscale 6,4的质量比6高)
    -acodec aac(音频编码用AAC)
    -ac 2(声道数1或2)
    -ar 24000(声音的采样频率,好像PSP只能支持24000Hz)
    -ab 128(音频数据流量,一般选择32、64、96、128)
    -vol 200(200%的音量,自己改)
    -f psp(输出psp专用格式)
    -muxvb 768(好像是给PSP机器识别的码率,一般选择384、512和768,我改成1500,PSP就说文件损坏了)
    "test.***"(输出文件名,也可以加路径改文件名)

    用-ss指定开始时间,用hh:mm:ss[.ms]格式,或者换算成用秒计。
    用-t指定长度,和-ss的格式一样,用hh:mm:ss[.ms]格式,或者换算成用秒计。
    如果-ss放在-i之前,就会成为输入选项,会先跳转过去。如果-i放在输出文件前面,则会成为输出选项,ffmpeg会先解码到给定时间,再开始编码行为,这样做会比较慢,但更精确。
   如果想用这个方法无损分割(用-codec copy),是不一定能切准的。

各种滤镜:

Filters:
  A = Audio input/output
  V = Video input/output
  N = Dynamic number and/or type of input/output
  | = Source or sink filter
aconvert         A->A       Convert the input audio to sample_fmt:channel_layout
.
afade            A->A       Fade in/out input audio.
aformat          A->A       Convert the input audio to one of the specified form
ats.
ainterleave      N->A       Temporally interleave audio inputs.
allpass          A->A       Apply a two-pole all-pass filter.
amerge           N->A       Merge two or more audio streams into a single multi-
channel stream.
amix             N->A       Audio mixing.
anull            A->A       Pass the source unchanged to the output.
apad             A->A       Pad audio with silence.
aperms           A->A       Set permissions for the output audio frame.
aphaser          A->A       Add a phasing effect to the audio.
aresample        A->A       Resample audio data.
aselect          A->N       Select audio frames to pass in output.
asendcmd         A->A       Send commands to filters.
asetnsamples     A->A       Set the number of samples for each output audio fram
es.
asetpts          A->A       Set PTS for the output audio frame.
asetrate         A->A       Change the sample rate without altering the data.
asettb           A->A       Set timebase for the audio output link.
ashowinfo        A->A       Show textual information for each audio frame.
asplit           A->N       Pass on the audio input to N audio outputs.
astats           A->A       Show time domain statistics about audio frames.
astreamsync      AA->AA     Copy two streams of audio data in a configurable ord
er.
atempo           A->A       Adjust audio tempo.
bandpass         A->A       Apply a two-pole Butterworth band-pass filter.
bandreject       A->A       Apply a two-pole Butterworth band-reject filter.
bass             A->A       Boost or cut lower frequencies.
biquad           A->A       Apply a biquad IIR filter with the given coefficient
s.
channelmap       A->A       Remap audio channels.
channelsplit     A->N       Split audio into per-channel streams.
earwax           A->A       Widen the stereo image.
ebur128          A->N       EBU R128 scanner.
equalizer        A->A       Apply two-pole peaking equalization (EQ) filter.
highpass         A->A       Apply a high-pass filter with 3dB point frequency.
join             N->A       Join multiple audio streams into multi-channel outpu
t.
lowpass          A->A       Apply a low-pass filter with 3dB point frequency.
pan              A->A       Remix channels with coefficients (panning).
silencedetect    A->A       Detect silence.
treble           A->A       Boost or cut upper frequencies.
volume           A->A       Change input volume.
volumedetect     A->A       Detect audio volume.
aevalsrc         |->A       Generate an audio signal generated by an expression.

anullsrc         |->A       Null audio source, return empty audio frames.
sine             |->A       Generate sine wave audio signal.
anullsink        A->|       Do absolutely nothing with the input audio.
alphaextract     V->V       Extract an alpha channel as a grayscale image compon
ent.
alphamerge       VV->V      Copy the luma value of the second input into the alp
ha channel of the first input.
ass              V->V       Render ASS subtitles onto input video using the liba
ss library.
bbox             V->V       Compute bounding box for each frame.
blackdetect      V->V       Detect video intervals that are (almost) black.
blackframe       V->V       Detect frames that are (almost) black.
blend            VV->V      Blend two video frames into each other.
boxblur          V->V       Blur the input.
colorbalance     V->V       Adjust the color balance.
colorchannelmixer V->V       Adjust colors by mixing color channels.
colormatrix      V->V       Convert color matrix.
copy             V->V       Copy the input video unchanged to the output.
crop             V->V       Crop the input video to width:height:x:y.
cropdetect       V->V       Auto-detect crop size.
curves           V->V       Adjust components curves.
decimate         N->V       Decimate frames (post field matching filter).
delogo           V->V       Remove logo from input video.
deshake          V->V       Stabilize shaky video.
drawbox          V->V       Draw a colored box on the input video.
drawtext         V->V       Draw text on top of video frames using libfreetype l
ibrary.
edgedetect       V->V       Detect and draw edge.
fade             V->V       Fade in/out input video.
field            V->V       Extract a field from the input video.
fieldmatch       N->V       Field matching for inverse telecine.
fieldorder       V->V       Set the field order.
format           V->V       Convert the input video to one of the specified pixel formats.
fps              V->V       Force constant framerate.
framestep        V->V       Select one frame every N frames.
frei0r           V->V       Apply a frei0r effect.
geq              V->V       Apply generic equation to each pixel.
gradfun          V->V       Debands video quickly using gradients.
hflip            V->V       Horizontally flip the input video.
histeq           V->V       Apply global color histogram equalization.
histogram        V->V       Compute and draw a histogram.
hqdn3d           V->V       Apply a High Quality 3D Denoiser.
hue              V->V       Adjust the hue and saturation of the input video.
idet             V->V       Interlace detect Filter.
il               V->V       Deinterleave or interleave fields.
interlace        V->V       Convert progressive video into interlaced.
interleave       N->V       Temporally interleave video inputs.
kerndeint        V->V       Apply kernel deinterlacing to the input.
lut              V->V       Compute and apply a lookup table to the RGB/YUV inpu
t video.
lutrgb           V->V       Compute and apply a lookup table to the RGB input vi
deo.
lutyuv           V->V       Compute and apply a lookup table to the YUV input vi
deo.
mp               V->V       Apply a libmpcodecs filter to the input video.
mpdecimate       V->V       Remove near-duplicate frames.
negate           V->V       Negate input video.
noformat         V->V       Force libavfilter not to use any of the specified pi
xel formats for the input to the next filter.
noise            V->V       Add noise.
null             V->V       Pass the source unchanged to the output.
overlay          VV->V      Overlay a video source on top of the input.
pad              V->V       Pad input image to width:height[:x:y[:color]] (defau
lt x and y: 0, default color: black).
perms            V->V       Set permissions for the output video frame.
pixdesctest      V->V       Test pixel format definitions.
pp               V->V       Filter video using libpostproc.
removelogo       V->V       Remove a TV logo based on a mask image.
scale            V->V       Scale the input video to width:height size and/or co
nvert the image format.
select           V->N       Select video frames to pass in output.
sendcmd          V->V       Send commands to filters.
separatefields   V->V       Split input video frames into fields.
setdar           V->V       Set the frame display aspect ratio.
setfield         V->V       Force field for the output video frame.
setpts           V->V       Set PTS for the output video frame.
setsar           V->V       Set the pixel sample aspect ratio.
settb            V->V       Set timebase for the video output link.
showinfo         V->V       Show textual information for each video frame.
smartblur        V->V       Blur the input video without impacting the outlines.

split            V->N       Pass on the input video to N outputs.
stereo3d         V->V       Convert video stereoscopic 3D view.
subtitles        V->V       Render text subtitles onto input video using the lib
ass library.
super2xsai       V->V       Scale the input by 2x using the Super2xSaI pixel art
 algorithm.
swapuv           V->V       Swap U and V components.
telecine         V->V       Apply a telecine pattern.
thumbnail        V->V       Select the most representative frame in a given sequ
ence of consecutive frames.
tile             V->V       Tile several successive frames together.
tinterlace       V->V       Perform temporal field interlacing.
transpose        V->V       Transpose input video.
unsharp          V->V       Sharpen or blur the input video.
vflip            V->V       Flip the input video vertically.
yadif            V->V       Deinterlace the input image.
cellauto         |->V       Create pattern generated by an elementary cellular a
utomaton.
color            |->V       Provide an uniformly colored input.
frei0r_src       |->V       Generate a frei0r source.
life             |->V       Create life.
mandelbrot       |->V       Render a Mandelbrot fractal.
mptestsrc        |->V       Generate various test pattern.
nullsrc          |->V       Null video source, return unprocessed video frames.
rgbtestsrc       |->V       Generate RGB test pattern.
smptebars        |->V       Generate SMPTE color bars.
smptehdbars      |->V       Generate SMPTE HD color bars.
testsrc          |->V       Generate test pattern.
nullsink         V->|       Do absolutely nothing with the input video.
concat           N->N       Concatenate audio and video streams.
showspectrum     A->V       Convert input audio to a spectrum video output.
showwaves        A->V       Convert input audio to a video output.
amovie           |->N       Read audio from a movie source.
movie            |->N       Read from a movie source.
ffbuffersink     V->|       Buffer video frames, and make them available to the
end of the filter graph.
ffabuffersink    A->|       Buffer audio frames, and make them available to the
end of the filter graph.
abuffer          |->A       Buffer audio frames, and make them accessible to the
 filterchain.
buffer           |->V       Buffer video frames, and make them accessible to the
 filterchain.
abuffersink      A->|       Buffer audio frames, and make them available to the
end of the filter graph.
buffersink       V->|       Buffer video frames, and make them available to the
end of the filter graph.
afifo            A->A       Buffer input frames and send them when they are requ
ested.
fifo             V->V       Buffer input images and send them when they are requ
ested.