-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Use C++ OpenGL GPU VideoPipeline again #1836
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This was referenced Sep 22, 2023
Currently we don't support YUV or PRIVATE because OpenGL just works in RGB.
I would prefer to move away from OpenGL to instead use something that works similar to how iOS works by just passing GPU buffers around, but it's not that simple. Android.media APIs just aren't as good yet. See this issue ($4.000 bounty!) for more information: #1837 |
textureExternalOES can do PRIVATE
isaaccolson
pushed a commit
to isaaccolson/deliveries-mobile
that referenced
this pull request
Oct 30, 2024
1. Reverts mrousavy@4e96eb7 (PR mrousavy#1789) to bring the C++ OpenGL GPU Pipeline back. 2. Fixes the "initHybrid JNI not found" error by loading the native JNI/C++ library in `VideoPipeline.kt`. This PR has two downsides: 1. `pixelFormat="yuv"` does not work on Android. OpenGL only works in RGB 2. OpenGL rendering is fast, but it has an overhead. I think for Camera -> Video Recording we shouldn't be using an entire OpenGL rendering pipeline. The original plan was to use something similar to how it works on iOS by just passing GPU buffers around, but the android.media APIs just aren't as advanced yet. `ImageReader`/`ImageWriter` is way too buggy and doesn't really work with `MediaRecorder`/`MediaCodec`. This sucks, I hope in the future we can use something like `AHardwareBuffer`s.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
This PR consists of 2 parts:
ImageWriter
instead of OpenGL Pipeline for faster processing #1789) to bring the C++ OpenGL GPU Pipeline back.VideoPipeline.kt
.The original plan was to use an
ImageReader
->ImageWriter
setup since that:native
andyuv
pixelFormats, right now the OpenGL pipeline always operates in RGB)The problem was,
ImageReader
is designed for CPU access, and when I pass Images along to theImageWriter
to send them into theMediaRecorder
, it just fails. This sucks. I have no idea what I'm doing wrong.^ if you know anyone that could help here, please let me know. Otherwise we just have to use the OpenGL pipeline
Downsides of this PR/the C++ OpenGL GPU Video Pipeline:
ImageReader
->ImageWriter
pipeline as we do actual render-passes instead of just moving buffers aroundnative
andyuv
pixel formats; it crashes when you passpixelFormat="yuv"
!I think the Android Media APIs are just not as advanced as iOS' Media APIs yet.
We have to settle for the OpenGL pipeline for now, which uses RGB and might be a bit slower than just passing native Images around, but whatever.
I spent way too much time on this already, no other Camera library out there is this advanced. I read through thousands of pages of API reference, guides (not a lot of those), documentation, issues, and mostly: C++ code.
Changes
Tested on
Related issues