gpt4 book ai didi

bash - 如何在 FFMPEG 的同一命令中使用 -vf 和 -filter_complex

转载 作者:行者123 更新时间:2023-12-04 23:32:36 30 4
gpt4 key购买 nike

我正在使用以下命令在 mac 上将视频转换为 FFMPEG 中的 gif:

ffmpeg -i screenAnimation2.mov -i palette.png -lavfi paletteuse -r "12" -s 300x200 -loop 2 screenAnimation2.gif 

效果很好,但我只想指定宽度并保持纵横比,这可以使用缩放过滤器来完成:
ffmpeg -i screenAnimation2.mov -i palette.png -lavfi paletteuse -r "12" -vf "scale=300:-1" -loop 2 screenAnimation2.gif 

但是,这会输出错误:
Filtergraph 'scale=300:-1' was specified through the -vf/-af/-filter option for output stream 0:0, which is fed from a complex filtergraph.
-vf/-af/-filter and -filter_complex cannot be used together for the same stream.

有没有办法结合2个过滤器?或者也许是一种获得正确高度值并避免使用比例过滤器的方法?

最佳答案

您可以将它们组合在一个复杂的过滤器中:

-lavfi 'paletteuse,scale=300:-1'

关于bash - 如何在 FFMPEG 的同一命令中使用 -vf 和 -filter_complex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56457818/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com