-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera2 pipeline; synchronously get PRIVATE/YUV/RGB Image data from a Frame #131
Comments
It should be ok to use OpenGL for "image processing" and then draw the result into the input BUT It's not so efficient to retrieve 'RGB' values by calling
See androidx for more details. Note: If you want to get YUV instead of RGB, here are two choices for you:
|
Thanks for your reply! I'm currently going through an ImageReader -> ImageWriter setup ( This seems a bit unstable and some devices had problems with that, but to confirm; that'd be the recommended approach to get access to the raw Camera frames before passing them along to a MediaRecorder, right? |
Detaching an The underlying pixel format that is chosen for this special use case (PRIVATE format combined with USAGE_GPU_SAMPLED_IMAGE usage) is implementation-defined and depends on the contract between Gralloc and GL driver. In most cases, though, the pixel format should be About the combination |
Well, that sucks. Is there no alternative to this? I guess it's just gonna work on some phones, and won't work on others? |
Hey all!
I have a Camera library that can do preview, photo capture, video capture, and frame processing at the same time. On iOS, this works perfectly. But on Android, it actually seems to be impossible to do this with Camera2/android.media APIs.
This is my structure:
Important detail: The
VideoPipeline
would do Frame Processing/ImageAnalysis and Video Recording in one, aka synchronous.I need to support
YUV_420_888
,PRIVATE
andRGBA_8888
as pixel formats for the MLKit image processor.Is it possible to start off with PRIVATE/YUV/RGB frames, then later pass it to OpenGL for RGB processing/rendering?
Or is there a way to receive PRIVATE/YUV frame data from OpenGL? I'm only aware of glReadPixels, which reads RGB.
I guess my main question is: Is OpenGL even the right tool for the job? It feels like setting up a rendering context etc is a large overhead, especially because I am now working in RGB instead of YUV/PRIVATE.
The text was updated successfully, but these errors were encountered: