Currently FFmpeg support VP9 compression to yuva420p.
目前FFmpeg支持VP9压缩到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.
使用grafika作为代码库我实现在Android中播放VP9 yuva420p编码视频(使用SurfaceTexture和MediaCodec),但我无法从视频中获取Alpha通道。
I checked that video encoded with VideoAlphaMode; ID: 0x53c0 size: 4, so I am sure that video contains alpha channel.
我检查了用VideoAlphaMode编码的视频; ID:0x53c0大小:4,所以我确信该视频包含alpha通道。
So the question is: does Android 4.4+ decoder supports VP9 with Alpha channel?
所以问题是:Android 4.4+解码器支持带有Alpha通道的VP9吗?
2 个解决方案
#1
0
Try It
ffmpeg -i input.mov -c:v libvpx -pix_fmt yuva420p out.webm
#2
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.
建议您首先在64位Linux工作站上构建最新版本的libvpx。 libvpx测试套件应包括alpha通道测试。确保测试通过。如果没有,这是一个不好的迹象,因为libvpx是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.
如果是这样,下一步将尝试使用更高级别的库进行alpha解码和覆盖,仍在Linux上。我建议使用GStreamer 1.8.2或更高版本。将剪辑叠加在“videotestsrc”生成器的顶部,这将生成大多数视频格式。
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).
在Linux上启动的原因是你将有一个更容易的时间构建和故障排除,我怀疑你可能在规范的边缘甚至没有在参考实现(libvpx)中实现,或者很难整合到更高级别的库(因此GStreamer建议)。
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.
也就是说,虽然我对VP8和libvpx有丰富的经验,但我还没有使用VP9特有的功能集。但是,我很想跟随你的努力,并且可以在你取得进步时提供建议。
#1
0
Try It
ffmpeg -i input.mov -c:v libvpx -pix_fmt yuva420p out.webm
#2
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.
建议您首先在64位Linux工作站上构建最新版本的libvpx。 libvpx测试套件应包括alpha通道测试。确保测试通过。如果没有,这是一个不好的迹象,因为libvpx是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.
如果是这样,下一步将尝试使用更高级别的库进行alpha解码和覆盖,仍在Linux上。我建议使用GStreamer 1.8.2或更高版本。将剪辑叠加在“videotestsrc”生成器的顶部,这将生成大多数视频格式。
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).
在Linux上启动的原因是你将有一个更容易的时间构建和故障排除,我怀疑你可能在规范的边缘甚至没有在参考实现(libvpx)中实现,或者很难整合到更高级别的库(因此GStreamer建议)。
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.
也就是说,虽然我对VP8和libvpx有丰富的经验,但我还没有使用VP9特有的功能集。但是,我很想跟随你的努力,并且可以在你取得进步时提供建议。