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 选项