- 【宣告】課程學習地址:https://ke.qq.com/course/468797
目錄
主要引數
音頻引數
視頻引數
ffmpeg命令提取音視頻資料
保留封裝格式
提取視頻
提取音頻
主要引數
- -i 設定輸入流
- -f 設定輸出格式(format)
- -ss 開始時間
- -t 時間長度
ffmpeg -i test.mp4 -codec copy -ss 10 -t 10 -f flv out.mp4
- 輸出實際是 flv 格式,
- 如果以后綴為準,則需要將 -f flv 去掉,
【查詢MP3格式的完整名稱】
ffmpeg -encoders | findstr mp3
音頻引數
- -aframes 設定要輸出的音頻幀數
- -b:a 音頻碼率
- -ar 設定采樣率
- -ac 設定聲音的Channel數
- -acodec 設定聲音編解碼器,如果用copy表示原始編解碼資料必須被拷貝,
- -an 不處理音頻
- -af 音頻過濾器
fmpeg -i test.mp4 -b:a 192k -ar 48000 -ac 2 -acodec libmp3lame -aframes 200 out.mp3
視頻引數
- -vframes 設定要輸出的視頻幀數
- -b 設定視頻碼率
- -b:v 視頻碼率
- -r 設定幀速率
- -s 設定畫面的寬與高
- -vn 不處理視頻
- -aspect aspect 設定橫縱比 4:3,16:9 或 1.3333 1.7777
- -vcodec 設定視頻編解碼器,如果用copy表示原始編解碼資料必須被拷貝,
- -vf 視頻過濾器
fmpeg -i test.mp4 -vframes 300 -b:v 300k -r 30 -s 640x480 -aspect 16:9 -vcodec libx265
ffmpeg命令提取音視頻資料
保留封裝格式
ffmpeg -i test.mp4 -acodec copy -vn audio.mp4 ffmpeg -i test.mp4 -vcodec copy -an video.mp4
提取視頻
- 保留編碼格式:
ffmpeg -i test.mp4 -vcodec copy -an test_copy.h264
- 強制格式:
ffmpeg -i test.mp4 -vcodec libx264 -an test.h264
提取音頻
- 保留編碼格式:
fmpeg -i test.mp4 -acodec copy -vn test.aac
- 強制格式:
fmpeg -i test.mp4 -acodec libmp3lame -vn test.mp3
- 更多參考: http://www.ffmpeg.org/ffplay.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/245760.html
標籤:其他
下一篇:Billu_bOx靶機實戰測驗
