Decoding VP9 with Alpha Channel in Android, is it possible?
Asked Answered
E

2

9

Currently FFmpeg support VP9 compression to yuva420p.

Using grafika as code base I am implemented playing VP9 yuva420p encoded video in Android (using SurfaceTexture and MediaCodec), but I can't get Alpha channel from the video.

I checked that video encoded with VideoAlphaMode; ID: 0x53c0 size: 4, so I am sure that video contains alpha channel.

So the question is: does Android 4.4+ decoder supports VP9 with Alpha channel?

Ellis answered 18/10, 2016 at 18:0 Comment(1)
This may be a decoder issue; many VP9 decoders do not support alpha channel decoding.Pieria
L
0

Try It

 ffmpeg -i input.mov -c:v libvpx -pix_fmt yuva420p out.webm
Lacking answered 5/6, 2017 at 9:3 Comment(1)
Please explain what that does, not only say "try this" and supply code. Explain what it is, what does what and why this is the (or a) correct way to do itAthirst
D
0

Recommend you start by building the latest version of libvpx itself on a 64-bit Linux workstation. The libvpx test suite should include a test for alpha-channel. Ensure that test passes. If it doesn't, that's a bad sign, because libvpx is the reference implementation for VP9.

If it does, the next step would be to attempt an alpha decode and overlay using a higher-level library, still on Linux. I suggest using GStreamer 1.8.2 or higher. Overlay your clip on top of the "videotestsrc" generator, which will generate most video formats.

If either of those tests fail, I would recommend you closely investigate why before proceeding.

The reason for starting on Linux is that you will have an easier time building and troubleshooting, and I suspect you may be hitting an edge of the specification that hasn't even been implemented in the reference implementation (libvpx), or which is difficult to integrate into higher-level libraries (hence the GStreamer suggestion).

That said, while I have significant experience with VP8 and libvpx, I have not used the VP9-specific feature set. I'm curious to follow your efforts, however, and may be able to offer advice as you make progress.

Demagogue answered 5/6, 2017 at 18:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.