Search code examples
androidsurfaceviewblending

Is it possible to render two video file on a one surfaceview for blending on Android?


Is it possible to render two video streams on a one surfaceview for blending?

I wanna make an application to render two videos for blending to a one same surfaceview and then save as a video file.

If that's impossible, is this approach possible that render two videos using two surfaceview for blending and save as a one video file?

Please help me.

Thank you for reading.


Solution

  • No, that's not possible. You'll need to use multiple SurfaceTextures instead, one per video decoder, and render all the textures into one view using Open GL.

    See https://source.android.com/devices/graphics/architecture.html for more explanations on how this works; in particular, each Surface can only have one producer and one consumer.