http://hi.baidu.com/lhabc/blog/item/6745898f6316c6f1503d9229.html faac是用来压AAC音轨的,而faad2就是AAC音轨的解码器,liba52是进行AC3支持的
安装前准备编译的环境
yum install -y automake autoconf libtool gcc gcc-c++ 1.下载需要的解码器
wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz
wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz
wget http://nchc.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz
wget ftp://ftp.videolan.org:21//pub/videolan/x264/snapshots/x264-snapshot-20090107-2245.tar.bz2
wget http://downloads.xvid.org/downloads/xvidcore-1.1.3.tar.gz
wget http://down1.iyunv.com/distfiles/libdts-0.0.2.tar.gz 2.解压安装
解压
for i in *.tar.gz; do tar -xzvf "$i"; done
for i in *.tar.bz2; do tar -xjvf "$i"; done
安装的参数 a52dec: ./configure –enable-shared=PKGS && make && make install faac & faad2: ./bootstrap && ./configure && make && make install xvidcore: cd build/generic; ./configure && make && make install libx264: ./configure –enable-mp4-output –enable-shared –enable-pthread && make && make install lame & yasm: ./configure && make && make install
为了查找方便,把ffmpeg中的参数都列出来
参数英文说明-Lshow license-hshow help-versionshow version-formats显示可以使用的格式,编码,协议-f强行设置输出格式[fmt]-i输入文件名[filename]-y不询问直接覆盖输出文件-mapset input stream mapping,file:stream[:syncfile:syncstream]-map_meta_dataset meta data information of outfile from infile,outfile:infile-tset the recording time[duration]-fsset the limit file size[limit_size]-ssset the start time offset[time_off]-itsoffsetset the input ts offset[time_off]-title视频文件标题[string]-timestampset the timestamp[time]-authorset the author[string]-copyrightset the copyright[string]-commentset the comment[string]-albumset the album[string]-benchmarkadd timings for benchmarking-dumpdump each input packet-hexwhen dumping packets, also dump the payload-reread input at native frame rate-loop_inputloop (current only works with images)-loop_outputnumber of times to loop output in formats that support looping (0 loops forever)-vcontrol amount of logging[verbose]-targetspecify target file type (”vcd”, “svcd”, “dvd”, “dv”, “dv50″, “pal-vcd”, “ntsc-svcd”, …)[type]-threadsthread count[count]-vsyncvideo sync method-asyncaudio sync method-vglobalvideo global header storage type-copytscopy timestamps-shortestfinish encoding within shortest input-dts_delta_thresholdtimestamp discontinuity delta threshold以下是视频相关的命令-vframes按所提供的帧数对文件解码(例ffmpeg -i test5.flv -r 15 -s 384*288 -y -vframes 1 photos.flv)[num]-aframesset the number of audio frames to record[num]-dframesset the number of data frames to record[num]-r设置帧速率,每秒多少帧 (Hz value, fraction or abbreviation)[rate]-s设置视频的宽度和高度,格式为320×240,320*240,320:240都可以-aspectset aspect ratio (4:3, 16:9 or 1.3333, 1.7777)[aspect]-pix_fmtset pixel format[format]-croptopset top crop band size (in pixels)[size]-cropbottom“set bottom crop band size (in pixels)[size]-cropleftset left crop band size (in pixels)[size]-croprightset right crop band size (in pixels)[size]-padtopset top pad band size (in pixels)[size]-padbottomset bottom pad band size (in pixels)[size]-padleftset left pad band size (in pixels)[size]-padrightset right pad band size (in pixels)[size]-padcolorset color of pad bands (Hex 000000 thru FFFFFF)[color]-intrause only intra frames-vndisable video-vdtdiscard threshold[n]-qscaleuse fixed video quantizer scale (VBR)[q]-qdiffmax difference between the quantizer scale (VBR)[q]-rc_eqset rate control equation[equation]-rc_overriderate control override for specific intervals[override]-vcodecforce video codec (’copy’ to copy stream)[codec]-meset motion estimation method[method]-me_thresholdmotion estimaton threshold-psset packet size in bits[size]-stricthow strictly to follow the standards[strictness]-samequse same video quality as source (implies VBR)-passselect the pass number (1 or 2)[n]-passlogfileselect two pass log file name[filename]-deinterlacedeinterlace pictures-psnrcalculate PSNR of compressed frames-vstatsdump video coding statistics to file-vhookinsert video processing module[module]-intra_matrixspecify intra matrix coeffs[matrix]-inter_matrixspecify inter matrix coeffs[matrix]-toptop=1/bottom=0/auto=-1 field first-dcintra_dc_precision[precision]-vtagforce video tag/fourcc[fourcc/tag]-newvideoadd a new video stream to the current output stream-qphistshow QP histogram以下是音频相关的命令-ab声音码流(in kbit/s)[bitrate]-aq声音品质(codec-specific)[quality]-ar声音的采样频率 (in Hz)[rate]-ac设置输出的声道数[channels]-an不输出声音-acodec设置输入声音的编码格式 (’copy’ to copy stream)[codec]-atagforce audio tag/fourcc[fourcc/tag]-volchange audio volume (256=normal)[volume]-newaudioadd a new audio stream to the current output stream-alangset the ISO 639 language code (3 letters) of the current audio stream[code]以下是字幕相关的命令-scodecforce subtitle codec (’copy’ to copy stream)[codec]-newsubtitleadd a new subtitle stream to the current output stream-slangset the ISO 639 language code (3 letters) of the current subtitle stream[code]以下是不常用的命令-vdset video grab device[device]-vcset video grab channel (DV1394 only)[channel]-tvstdset television standard (NTSC, PAL (SECAM))[standard]-adset audio device[device]-grabrequest grabbing using[format]-gdset grab device[device]-muxdelayset the maximum demux-decode delay[sec]-muxpreloadset the initial demux-decode delay[sec]-absf-vbsf-defaultgeneric catch all option(ffmpeg参数说明)
http://hi.baidu.com/lhabc/blog/item/6745898f6316c6f1503d9229.html