我目前能够将一系列图像转换为视频,但我还需要在它们之间添加过渡/动画。
String[] ffmpegCommand = {"/data/data/mypackage/app_bin/ffmpeg", "-y",
"-qscale", "1", "-r", "" + framerate, "-i", "/data/data/mypackage/app_ipImg/image%3d.jpg",
"-t", "" + (((total_images) * delay_of_each_frame_in_seconds) + 4), //"-s",heightwidth,
"-vcodec", "libx264", "-s", "640x480",
Environment.getExternalStorageDirectory() + "/photo_directory/myVideo.mp4"};
上面的命令正在为我从图像系列创建视频
但是
现在,我确实想在每个帧之前添加淡入淡出或其他过渡/动画以显示在最终视频中。
我在谷歌上搜索了很多,但还没有找到解决这个问题的方法。
请给我建议方法。
提前致谢。
最佳答案
我建议您查找有关Frame Blending 或Motion interpolation 的更多信息。
例如,这用于延时视频以平滑渲染。
要混合帧,请使用带有 tblend 过滤器的 ffmpeg。 例如,以下命令可以提供帮助:
ffmpeg -i {input} -vf "tblend=average,framestep=2,setpts=0.50*PTS"-r {srcfps} -{编码参数} {output}
。将{input}
替换为您的输入文件,将{output}
替换为输出文件的名称,将{srcfps}
替换为您的每秒源帧数, 和-{encoding parameters}
你告诉 ffmpeg 输出的参数。 您还可以将minterpolate
过滤器添加到过滤器堆栈以添加一些运动模糊。要根据运动生成新帧,Butterflow 项目可以提供帮助:https://github.com/dthpham/butterflow
Features
Makes motion interpolated videos (increase a video's frame rate by rendering intermediate frames based on motion, uses a combination of pixel-warping and blending).
Makes smooth motion videos (simple blending between frames).
Leverages interpolated frames to make fluid slow motion videos.
关于image - ffmpeg 将一系列图像转换为视频 - 每两帧之间使用交叉淡入淡出或任何其他过渡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29845019/