FFmpeg 自用手冊
壓縮視頻
ffmpeg -i "infile" -b:v 800k -s 270x480 "outfile"
-i: "infile" input file path
-b:v 幀數/s
-s: 視頻大小 width x height
"outfile": output file path
視頻剪切
ffmpeg -ss 00:40:21.0 -t 19 -accurate_seek -i D:\myfileIn.mp4 -codec copy -avoid_negative_ts 1 D:\downloads\myfile_out.mp4
-i: source
-ss: start time
-t: duration
-c: video,audio codec
時間格式:second: HH:MM:SS.MS
-acurate_seek 要在 -i 前
把 -ss 選項放在 -i 之前,會使用關鍵幀技術; 把 -ss 選項放在 -i 之後,則不使用關鍵幀技術
如果要使用關鍵幀技術又要保留時間戳,可以加上 -copyts 選項