ffmpeg视频精准剪切 | 您所在的位置:网站首页 › ffmpeg裁剪视频最后一秒不全 › ffmpeg视频精准剪切 |
ffmepg剪切视频,很方便,但是也有很大缺陷: (1)剪切时间点不精确 (2)有时剪切的视频开头有黑屏造成这些问题的原因是ffmpeg无法seek到非关键帧上ffmepg升级最新版加上参数-accurate_seek -avoid_negative_ts 1-- 自己例子ffmpeg -ss 00:00:00 -to 00:00:01 -accurate_seek -i out.mp4 -vcodec copy -acodec copy -avoid_negative_ts 1 -y out-1.mp4ffmpeg -ss 00:00:30 -to 00:00:52 -accurate_seek -i out.mp4 -vcodec copy -acodec copy -avoid_negative_ts 1 -y out-2.mp4echo -e "file 'out-1.mp4' \nfile 'out-2.mp4'" >> list.txtffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy -strict -2 -y concat.mp4 ffmpeg -ss 00:00:00 -to 00:00:01 -accurate_seek -i out.mp4 -vcodec copy -acodec copy -y out-1.mp4ffmpeg -ss 00:00:30 -to 00:00:52 -accurate_seek -i out.mp4 -vcodec copy -acodec copy -y out-2.mp4echo -e "file 'out-1.mp4' \nfile 'out-2.mp4'" >> list.txtffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy -strict -2 -y concat.mp4 |
CopyRight 2018-2019 实验室设备网 版权所有 |