ffmpeg透视滤镜动画错误
ffmpeg perspective filter animation error
我正在尝试使用透视滤镜在 ffmpeg 中创建伪 3d 平移效果。
这是起点的示例...
ffmpeg -y -filter-complex "color=black:s=1600x900,trim=0:5,drawgrid=width=100:height=100:thickness=2:color=white,perspective=x0=200:y0=200:x1=1600:y1=0:x2=200:y2=700:x3=1600:y3=900[skew]" -an -map [skew] "skew-start.mp4"
这是终点的示例...
ffmpeg -y -filter-complex "color=black:s=1600x900,trim=0:5,drawgrid=width=100:height=100:thickness=2:color=white,perspective=x0=0:y0=0:x1=1600:y1=0:x2=0:y2=900:x3=1600:y3=900[skew]" -an -map [skew] "skew-end.mp4"
到目前为止一切顺利。添加动画会给这个...
ffmpeg -y -filter-complex "color=black:s=1600x900,trim=0:5,drawgrid=width=100:height=100:thickness=2:color=white,perspective=eval=frame:x0='200-(200*t/5)':y0='200-(200*t/5)':x1=1600:y1=0:x2='200-(200*t/5)':y2='700+(200*t/5)':x3=1600:y3=900[skew]" -an -map [skew] skew.mp4
这就是问题所在。我收到一条错误消息 [Eval @ 000000f36ebfebf0] Undefined constant or missing '(' in 't/5)' Error while filtering: Invalid argument
perspective docs 说它应该与 eval=frame
选项一起使用。有人有什么想法吗?这看起来像 ffmpeg 中的错误吗?我使用的是最新版本 4.3.2.
正如文档所说,
The expressions can use the following variables:
W
H
the width and height of video frame.
in
Input frame count.
on
Output frame count.
t
不是允许的变量之一。使用 in
,其中 in
是表示时间 x fps 的整数。我可以添加时间,但请给我几天时间来推动它。
我正在尝试使用透视滤镜在 ffmpeg 中创建伪 3d 平移效果。
这是起点的示例...
ffmpeg -y -filter-complex "color=black:s=1600x900,trim=0:5,drawgrid=width=100:height=100:thickness=2:color=white,perspective=x0=200:y0=200:x1=1600:y1=0:x2=200:y2=700:x3=1600:y3=900[skew]" -an -map [skew] "skew-start.mp4"
这是终点的示例...
ffmpeg -y -filter-complex "color=black:s=1600x900,trim=0:5,drawgrid=width=100:height=100:thickness=2:color=white,perspective=x0=0:y0=0:x1=1600:y1=0:x2=0:y2=900:x3=1600:y3=900[skew]" -an -map [skew] "skew-end.mp4"
到目前为止一切顺利。添加动画会给这个...
ffmpeg -y -filter-complex "color=black:s=1600x900,trim=0:5,drawgrid=width=100:height=100:thickness=2:color=white,perspective=eval=frame:x0='200-(200*t/5)':y0='200-(200*t/5)':x1=1600:y1=0:x2='200-(200*t/5)':y2='700+(200*t/5)':x3=1600:y3=900[skew]" -an -map [skew] skew.mp4
这就是问题所在。我收到一条错误消息 [Eval @ 000000f36ebfebf0] Undefined constant or missing '(' in 't/5)' Error while filtering: Invalid argument
perspective docs 说它应该与 eval=frame
选项一起使用。有人有什么想法吗?这看起来像 ffmpeg 中的错误吗?我使用的是最新版本 4.3.2.
正如文档所说,
The expressions can use the following variables:
W
H
the width and height of video frame.
in
Input frame count.
on
Output frame count.
t
不是允许的变量之一。使用 in
,其中 in
是表示时间 x fps 的整数。我可以添加时间,但请给我几天时间来推动它。