alnitak / flutter_opengl

A Flutter OpenGL ES plugin using a Texture() widget. Supports Android, Linux and Windows. Many shaders from ShaderToy.com can be copy/pasted
Other
173 stars 20 forks source link

Question: Does flutter_opengl support playing video from AVFrame or YUV format buffer data #9

Closed dinhthienkhai closed 2 months ago

dinhthienkhai commented 2 months ago

Hi everyone, I am building a Flutter application that can liveview IPCAM. Currently my application is using native lib (libc++.so) to receive data stream from IPCAM. I used ffi and was able to get buffer data on Dart, the current buffer is in AVFrame format because I used ffmpeg_mobile decode from h265 (in libc++.so). I want to ask if flutter_opengl has an api that supports playing video from buffer with avframe format? Or is there another plugin that supports this, hope everyone can support. Thanks a lot

alnitak commented 2 months ago

Hi,

only RGBA32 is supported. Maybe something can be done by adding a specific method to src/Sampler2D.cpp. Something like Sampler2D::add_YUV. And then in Sampler2D::genTexture use the correct GL format instead of GL_RGBA.

dinhthienkhai commented 2 months ago

Hi,

only RGBA32 is supported. Maybe something can be done by adding a specific method to src/Sampler2D.cpp. Something like Sampler2D::add_YUV. And then in Sampler2D::genTexture use the correct GL format instead of GL_RGBA.

Hi, Thank you for your feedback, I will try to find out according to your suggestion.