Error "Transparency encoding with auto_alt_ref does not work" when converting a .mov with Alpha to .webm with alpha with ffmpeg
Asked Answered
S

2

23

I am trying to convert a .mov file with alpha transparency into a .webm file and have been following this thread for help: Convert mov with Alpha to VP9 Webm with Alpha Using ffmpeg

The command line I have been using is

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

However when I go to run the command it comes up with 2 errors

Transparency encoding with auto_alt_ref does not work

and

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

I am not too sure what the problem is here, any suggestions, I am very confused!

Species answered 9/8, 2017 at 10:26 Comment(0)
S
63

I think I may have solved this, adding -auto-alt-ref 0 before the output fixed this issue!!

Working Command

ffmpeg -i Desktop/Skel_Walk_1.mov -c:v libvpx -pix_fmt yuva420p -auto-alt-ref 0 Desktop/Skel_Walk_1.webm
Species answered 9/8, 2017 at 10:41 Comment(2)
This unfortunately also removes alpha, do you know of any workaround that doesn't remove alpha?Glamour
@AugustBjornberg use libvpx-vp9 instead of libvpx in the command. This will preserve the alphaLantha
L
0

@ThomTTP's solution is correct, but the Alpha channel is gone.

-vf "premultiply=inplace=1"

If you use the options together, you may not lose the alpha channel in VP8.

Linkman answered 4/1, 2024 at 2:14 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.