生成包含滚动图像的视频 [英] generate video containing scrolling image
问题描述
我想从800x10000静止图像生成视频[比方说800x600].
图像必须从上到下滚动,就像有人在真正滚动页面一样.
如果它可以在某些部分上更快地滚动,而在另一些部分上更慢,那太好了,如果不是这样,我想我可以只制作几个单独的视频,然后将它们缝合起来.
我找不到有关此主题的任何文档;谁能给我一个提示吗?感谢您的宝贵时间!
使用滚动过滤器. crop 过滤器是可选的,将为大图像输入输出合理的宽度和高度.您也可以考虑使用 scale 过滤器. format 过滤器可输出广泛兼容的像素格式/色度二次采样方案.>
垂直
ffmpeg -loop 1 -i input.png -vf "scroll=vertical=0.01,crop=iw:600:0:0,format=yuv420p" -t 10 output.mp4
水平
ffmpeg -loop 1 -i input.png -vf "scroll=horizontal=0.01,crop=800:600:0:0,format=yuv420p" -t 10 output.mp4
滚动过滤器选项
-
horizontal, h
设置水平滚动速度.默认值为0.允许的范围是-1至1.负值会更改滚动方向. -
vertical, v
设置垂直滚动速度.默认值为0.允许的范围是-1至1.负值会更改滚动方向. -
hpos
设置初始水平滚动位置.默认值为0.允许的范围是0到1. -
vpos
设置初始垂直滚动位置.默认值为0.允许的范围是0到1.
I want to generate a video [let's say 800x600] from a 800x10000 still image.
The image has to scroll, from top to bottom as if someone was actually scrolling a page.
If it could scroll faster over some portions and slower over others, that would be great, if not I think I could just make a few separate videos and then just stitch them up.
I cannot find any documentation on this subject; could anyone give me a hint? Thanks for your time!
Use the scroll filter. The crop filter is optional and will output a reasonable width and height for large image inputs. You can consider using the scale filter too. The format filter outputs a widely compatible pixel format / chroma subsampling scheme.
Vertical
ffmpeg -loop 1 -i input.png -vf "scroll=vertical=0.01,crop=iw:600:0:0,format=yuv420p" -t 10 output.mp4
Horizontal
ffmpeg -loop 1 -i input.png -vf "scroll=horizontal=0.01,crop=800:600:0:0,format=yuv420p" -t 10 output.mp4
Scroll filter options
horizontal, h
Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1. Negative values changes scrolling direction.vertical, v
Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1. Negative values changes scrolling direction.hpos
Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.vpos
Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
这篇关于生成包含滚动图像的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!