使用ffmpeg从具有Ken Burns效果的图像生成视频
我正在尝试从图像生成视频.
I am trying to generate video from images.
以下代码生成视频,每3秒1帧.
The following code generates the video, 1 frames per 3 seconds.
exec("ffmpeg -f image2 -r 1/3 -loop_input -shortest -y -i tmp/image%3d.jpg -i tmp/ag1.mp3 -target ntsc-dvd -s 1280x720 tmp/video.mwv");
我想对其应用ken burns效果,我进行了很多搜索,但找不到任何解决方法.
I want to apply ken burns effect to it, I have searched a lot but couldn't find any solution.
有人可以帮我吗?如果可以提供任何代码段,将不胜感激.
Can anybody help me out ? If can provide any code snippet, will be really appreciated.
我不认为仅靠ffmpeg就能做到这一点.过去,我是使用名为 diascope 的工具完成此操作的.我从没听说过,但是它可以产生一些我见过的最好的图片幻灯片,因为可以使用Ken Burns之类的效果.它在最后一步中确实使用了ffmpeg来对视频进行实际编码.
I don't think this can be done with ffmpeg alone. I have done this in the past with a tool called diascope. I never hear much about it, but it produces some of the best picture slideshows I have seen since you can use effects like Ken Burns. It does use ffmpeg in its final step to actually encode the video.
看看例子,它应该很简单.
Take a look at the examples, it should be pretty straightforward.