使用 ffmpeg 将带有 Alpha 的 .mov 转换为带有 alpha 的 .webm 时出现错误“使用 auto_alt_ref 进行透明度编码不起作用”

问题描述 投票:0回答:2

我正在尝试将具有 alpha 透明度的 .mov 文件转换为 .webm 文件,并一直在关注此线程寻求帮助:Convert mov with Alpha to VP9 Webm with Alpha using ffmpeg

我一直使用的命令行是

ffmpeg -r 24/1 -i Desktop/Skel_Walk_1.mov -c:v libvpx -pix_fmt yuva420p Desktop/Skel_Walk_1.webm

但是,当我运行该命令时,它出现了 2 个错误

Transparency encoding with auto_alt_ref does not work

Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 
- maybe incorrect parameters such as bit_rate, rate, width or height

我不太清楚这里的问题是什么,有什么建议吗,我很困惑!

video ffmpeg alpha webm mov
2个回答
61
投票

我想我可能已经解决了这个问题,在输出解决这个问题之前添加

-auto-alt-ref 0
!!

工作命令

ffmpeg -i Desktop/Skel_Walk_1.mov -c:v libvpx -pix_fmt yuva420p -auto-alt-ref 0 Desktop/Skel_Walk_1.webm

0
投票

@ThomTTP的解决方案是正确的,但是Alpha通道没有了。

-vf "premultiply=inplace=1"

如果同时使用这些选项,您可能不会丢失 VP8 中的 Alpha 通道。

© www.soinside.com 2019 - 2024. All rights reserved.