FFmpeg 将大量图片合成为视频 video

1.基本格式

终端输入: ffmpeg -f image2 -i /home/ttwang/images/image%d.jpg tt.mp4

其中/home/ttwang/images/images%d.jpg 为图片路径
图片的命名格式为image%d.jpg形式,即:image0 image1 image2 .......
tt.mp4为输出视频文件名

2.指定编码格式的使用

终端输入: ffmpeg -f image2 -i /home/ttwang/images/image%d.jpg  -vcodec libx264  tt.mp4

3.指定输出帧率

终端输入:ffmpeg -f image2 -i /home/ttwang/images/image%d.jpg  -vcodec libx264 -r 10  tt.mp4

-r 10 表示定义帧率为10,这样输出的视频就是每秒播放十帧

4.其余ffmpeg小技巧参考资料
   参考资料


Video options:
-r rate             set frame rate (Hz value, fraction or abbreviation)  

不使用下面这个参数,会导致每帧都提醒是否overwrite

-pattern_type glob

 

对我来说,

ffmpeg  -r 25 -pattern_type glob -i 'renguang_results/*.png' -c:v libx264 out.mp4

 


---------------------
参考链接:https://blog.csdn.net/fortiy/article/details/82883643

posted @ 2019-07-17 13:47  月亮下,六便士  阅读(31306)  评论(2编辑  收藏  举报