```
ffmpeg -ss 00:00:06 -t 00:00:12 -i input.mp4 -vcodec copy -acodec copy output.mp4
```
意思是從截取從6秒開始,時長為12秒的視頻,格式不變,
輸入為input.mp4
輸出為output.mp4
\-vcodec copy -acodec copy : 編碼格式不變
*****
還有就是關于-s選項的解釋:
‘-ss position (input/output)’
When used as an input option (before -i), seeks in this input file to position. When used as an output option (before an output filename), decodes but discards input until the timestamps reach position. This is slower, but more accurate.
position may be either in seconds or in hh:mm:ss\[.xxx\] form.
意思就是如果要把-ss作為輸入選項的話要放在-i之前,當做輸出選項的話放在輸出文件之前。我們這是要截取一段視頻,應該當做輸入選項,所以-ss要在-i之前才有效,不然會花費很長一段時間來尋找-ss。
作者:Gongjia
鏈接:https://www.jianshu.com/p/2975f4efd808
來源:簡書
簡書著作權歸作者所有,任何形式的轉載都請聯系作者獲得授權并注明出處。
- ffmpeg視頻截圖
- FFmpeg壓縮MP4視頻
- ffmpeg獲取視頻的信息
- ffmpeg將圖片序列合成視頻
- ffmpeg將視頻分解成圖片序列
- ffmpeg截取一張352x240尺寸大小的,格式為jpg的圖片:
- 把視頻的前30幀轉換成一個Animated Gif
- 在視頻的第8.01秒處截取 352*240 的縮略圖
- ffmpeg 將視頻和圖片互轉化
- ffmpeg圖片加水印
- ffmpeg視頻加入ASS字幕
- ffmpeg視頻加入srt字幕
- ffmpeg MP4剪切
- ffmpeg MP4合并
- 常用命令
- ffmpeg MP4 合成或替換 新的背景音樂
- ffmpge srt與ass字幕轉換
- ffmpeg MP4與TS轉換
- ffmpeg 多個音頻合并 截取 拆分