Linux 下ffmpeg視頻轉碼實戰二——參數寶典

最好的文檔就是官方的,但是,英文有障礙的就免談。html

官方幫助文檔:http://www.ffmpeg.org/ffmpeg.html linux

送上一個寶典,是一個羣裏的。總結的pdf ide

FFMPEG完美入門資料.pdfspa


連接:http://pan.baidu.com/s/1eS36cBC 密碼:sifs3d

打不開再聯繫我。code

一些不錯的博客:orm

精力有限,參考:
視頻

http://www.cnblogs.com/dwdxdy/p/3240167.html htm

經常使用參數說明:blog

主要參數:
-i 設定輸入流
-f 設定輸出格式
-ss 開始時間
視頻參數:
-b 設定視頻流量,默認爲200Kbit/s
-r 設定幀速率,默認爲25
-s 設定畫面的寬與高
-aspect 設定畫面的比例
-vn 不處理視頻
-vcodec 設定視頻編解碼器,未設定時則使用與輸入流相同的編解碼器
音頻參數:
-ar 設定採樣率
-ac 設定聲音的Channel數
-acodec 設定聲音編解碼器,未設定時則使用與輸入流相同的編解碼器
-an 不處理音頻

1.分離視頻音頻流

ffmpeg -i input_file -vcodec copy -an output_file_video  //分離視頻流ffmpeg -i input_file -acodec copy -vn output_file_audio  //分離音頻流

2.視頻解複用

ffmpeg –i test.mp4 –vcodec copy –an –f m4v test.264ffmpeg –i test.avi –vcodec copy –an –f m4v test.264

3.視頻轉碼

ffmpeg –i test.mp4 –vcodec h264 –s 352*278 –an –f m4v test.264              //轉碼爲碼流原始文件ffmpeg –i test.mp4 –vcodec h264 –bf 0 –g 25 –s 352*278 –an –f m4v test.264  //轉碼爲碼流原始文件ffmpeg –i test.avi -vcodec mpeg4 –vtag xvid –qsame test_xvid.avi            //轉碼爲封裝文件//-bf B幀數目控制,-g 關鍵幀間隔控制,-s 分辨率控制

4.視頻封裝

ffmpeg –i video_file –i audio_file –vcodec copy –acodec copy output_file

5.視頻剪切

ffmpeg –i test.avi –r 1 –f image2 image-%3d.jpeg        //提取圖片ffmpeg -ss 0:1:30 -t 0:0:20 -i input.avi -vcodec copy -acodec copy output.avi    //剪切視頻//-r 提取圖像的頻率,-ss 開始時間,-t 持續時間

6.視頻錄製

ffmpeg –i rtsp://192.168.3.205:5555/test –vcodec copy out.avi


更詳細的介紹:

http://linux.51yip.com/search/ffmpeg

還有案例,能夠去看看。

相關文章
相關標籤/搜索