美文网首页
FFmpeg精确时间截取视频文件

FFmpeg精确时间截取视频文件

作者: sen_coder | 来源:发表于2021-03-03 18:19 被阅读0次
参数

ffmpeg -ss start -t duration -accurate_seek -i in.mp4 -codec copy out.mp4

示例:
·进入文件所在目录或者文件用绝对路径
ffmpeg -ss 00:00:00 -t 00:02:21 -accurate_seek -i 2021-03-02-23-35-26.mp4 -codec copy jt.mp4
·

每秒一张图

./ffmpeg -ss 00:00 -i xxx.mp4 -f image2 -r 1 -t 02:45 %3d.jpg

每5秒一张图

./ffmpeg -ss 00:00 -i xxx.mp4 -f image2 -r 0.2 -t 02:45 %3d.jpg

获取视频时长

[root@localhost bin]# ./ffmpeg -i xxx.mp4 2>&1 |grep duration -i
Duration: 00:02:45.56, start: 0.000000, bitrate: 706 kb/s

相关文章

网友评论

      本文标题:FFmpeg精确时间截取视频文件

      本文链接:https://www.haomeiwen.com/subject/jchcqltx.html