Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adaptive video encoding with alpha channel

I've created a WebM media file with transparent background in Adobe After Effects. Due to Widevine specs, I have to encode this file to an adaptive format for playing.

With the following command I've successfully created a webm file with DASH:

ffmpeg -i example.webm -c:v libvpx-vp9 -s 200x113 -b:v 250k -keyint_min 150 -g 150 -tile-columns 4 -frame-parallel 1 -an -f webm -dash 1 adaptive.webm

Unfortunately, the resulting video has lost the alpha channel completely.

Is it possible to encode a video to an adaptive format without losing the alpha channel?

like image 227
Peter Bartha Avatar asked Sep 14 '20 10:09

Peter Bartha


1 Answers

Yes, it is possible. In this case, you need to use libvpx for decoding as well as encoding, in order to access the alpha channel in the source video. Note the additional codec specifier before the input:

ffmpeg -c:v libvpx-vp9 -i example.webm -c:v libvpx-vp9 -b:v 250k -keyint_min 150 -g 150 -tile-columns 4 -frame-parallel 1 -an -f webm -dash 1 adaptive.webm
like image 186
Soma Lucz Avatar answered Oct 04 '22 00:10

Soma Lucz