使用FFmpeg剪辑视频以及压缩(倍速)视频,参考
廖雪峰老师的FFmpeg教程,其它博客简书., csdn., csdn…, csdnbbs.
剪辑
# start - hh:mm:ss
# duration - seconds
$ ffmpeg -ss [start] -i [inputPath] -t [duration] -c copy [outputPath]
# e.g
$ ffmpeg -ss 00:01:02 -i G:\\test.mp4 -t 10 -c copy G:\\test_trim.mp4
压缩视频与音频
# setpts=0.8 表示视频1.25倍 -- 1/1.25=0.8
# atempo=1.25表示音频1.25倍
$ ffmpeg -i ]inputPath] -filter_complex "[0:v]setpts=0.8*PTS[v];[0:a]atempo=1.25[a]" -map "[v]" -map "[a]" [outputPath]
。。。