大全景到平移视频 [英] Large Panorama to Panning Video
问题描述
从全景图像创建视频的最有效方法是什么,例如,其尺寸为: 5000宽x 600高度
px?
What would be the most efficient way to create a video from a panoramic image that would for example have the size: 5000 width x 600 height
px?
我创建了这个GIF图像,可以更好地解释事情.想象一下,视频将位于红色边框内.因此视频可能会从左向右平移.
I created this GIF image that would explain things a bit better. Imagine that the video would be inside the red border. So the video would potentially be panning from left to right.
推荐答案
在ffmpeg中,移动作物是实现此目标的最便捷方法.
A moving crop is the most convenient way to achieve this in ffmpeg.
ffmpeg -loop 1 -i in.jpg -vf crop=500:ih:'min((iw/10)*t,9*iw/10)':0 -t 10 pan.mp4
农作物过滤器的尺寸为500 x ih,即500x600.裁剪窗口的左上角坐标固定为Y = 0.对于X,表达式为 min((iw/10)* t,9 * iw/10)
,即每秒钟,裁剪窗口将在图像宽度的10%范围内滑动.因此,在t = 9时,裁剪窗口覆盖了示例图像的(4500,0)至(5000,600).从那时起,min函数将返回另一个值 9 * iw/10
= 4500
,并且滑动停止.
The crop filter crops to a size of 500 x ih i.e. 500x600. The top-left co-ordinate of the cropping window is fixed to Y=0. For X, the expression is min((iw/10)*t,9*iw/10)
i.e. in each second, the cropping window will slide across 10% of the image width. So, at t=9, the cropping window covers (4500,0) to (5000,600) for the example image. From that time, the min function returns the other value 9*iw/10
= 4500
and the sliding stops.
这篇关于大全景到平移视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!