1. 任务描述:由给定图像序列合成 24fps 视频

方案一

直接对图像进行操作,适用于图像名比较规范且默认顺序即为所需顺序的情景

ffmpeg -f image2 -i ./images_crop_%d.png -pix_fmt yuv420p -vcodec libx264 -r 24 -y output.mp4

方案二

将图像顺序写入一个文件列表,让 ffmpeg 从列表读入并合成视频,适用于自定义图像顺序的情景

ffmpeg -f concat -safe 0 -i input.txt -pix_fmt yuv420p -vcodec libx264 -r 24 -y -an output.mp4

其中列表格式如下

ffmpeg基本功能使用
file '/Users/cv/playground/data/cam_1_frame_00.png'
duration 0.5
file '/Users/cv/playground/data/cam_2_frame_01.png'
duration 0.5
……
input.txt

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-07-22
  • 2021-11-20
猜你喜欢
  • 2021-10-30
  • 2021-12-01
  • 2021-12-13
  • 2022-01-22
  • 2021-04-17
  • 2022-01-14
相关资源
相似解决方案