Peter Bartha
Peter Bartha

Reputation: 98

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?

Upvotes: 7

Views: 618

Answers (1)

Soma Lucz
Soma Lucz

Reputation: 159

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

Upvotes: 1

Related Questions