-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support of converting YUV_240_888 to Bitmap #6
Comments
Hi @siralam ! First, without further look at the actual running code, I would like to point out that errors like these most often comes from unexpected-sized input. The input for the NV21 byte array input should be Then, there is the bigger issue of actual conversion support of the format you are trying to do on this library. As far as I know, Camera 2 API provides these YUV_420_888 images in a separate plane presentation. Note in the referred documentation that each plane has pixel and row stride, meaning several formats could be encoded in that In short, it looks like the big issue is actually lack of conversion support for Camera 2 API provided images. I think this is a legitimate request and a valuable one, and while I may not have the time to do it shortly, I'd be glad to mark it as "Help wanted" and welcome community contributions to it. So please if you'd like that support to be implemented please open that issue so that people could eventually contribute to it :) |
Hi @silvaren ! Thanks for your response, actually I have managed to do it, but did not use any RenderScript. What I did is convert the And below is how I convert that
I believe the above method is a bit slower compared to using RenderScript. But since I don't know how to implement a RenderScript by myself, I have to use this method. But I also found someone posted how to use RenderScript to convert YUV_240_888 to RGB, you may have a try to see if it works. Thanks! |
The renderscript version you pointed out looks great @siralam ! I might give it a try at some point to include it in the library :) Thanks! |
Thanks @silvaren , looking forward to your good news :D |
I am not able to create instance of RenderScript . below is the code byte[] bytes = YUV420toNV21(image); Error : Cannot resolve symbol 'create' |
Hello, first of all thanks for your great library!
I am now trying to do something to each frame returned by Android Camera 2 API (Which I guess most user of this library do).
Note that I have already specified YUV_240_888 for the ImageReader:
And in onImageAvailable:
When I attach a debugger, I can see the conversion line is executed but before the logging line, the app crashes without any stacktrace, instead giving this error message:
Fatal signal 7 (SIGBUS), code 2, fault addr 0xbe68f040 in tid 1699
Do you have any idea / any working example with Camera 2 API?
By the way, Camera 1 returns NV21 format and I have tried with Camera 1 API and NV21 works perfectly. But Camera 2 does not support NV21...
The text was updated successfully, but these errors were encountered: