剪切
ffmpeg -i input.mp4 -acodec copy -vcodec copy -ss 00:00:06 -to 00:01:43 output.mp4 -y
拼接
拼接的情况稍微复杂些,我们需要将需要拼接的视频文件按以下格式保存在一个列表list.txt 中:
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'
相应的命令为:
ffmpeg -f concat -i list.txt -c copy output.mp4
由于不需要重编码,这两条命令几乎是即时完成的。