-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Refactor examples etc. to use android camera2 #163
Comments
Great, thanks! |
I noticed that the HttpBuilder is also removed and as of sdk 23 you should use I was thinking, once I toy around with a sample of my own, I may want to include http://square.github.io/okhttp/. @saudet, are you ok with using this library? It's well-known and handles some errors and stuff. |
Where are we using Anyway, the sample directory in JavaCV is meant to contain small self-contained samples as a sort of reference for the API. For more complex samples, they are very welcome as well, but it's probably best to provide projects files as well, and they would belong in this repository: |
Ah sorry my bad. It's been a while since I have been working on some experiments using the (awesome) library. I had some HTTP call and assumed it belonged to the sample, which I should've checked before. Ignore my previous post 😄 Once I toy around a bit again with the current version, I hope to find some time to look into the camera2 API |
I've written the following in #298: Use RGBA_8888, 8 bytes, 4 channels
Initialise the
then on
|
@kmlx Hey thanks for sharing that piece of knowledge. I actually did some work on capturing the frames but ran into the issue where the ImageReader cannot be initialized with NV21. I am unfortunately not that familiar with imaging etc. (but I learned now what image strides and planes are!) So your answer is one of the pieces I was still looking for. |
@kmlx I recalled having tried what you suggested. I have reimplemented it and confirmed that I got what a i saw before: |
@lfdversluis Not a problem. Thank you @saudet and @lfdversluis for providing support and keeping these forums alive! Regarding your issue, I'm assuming you're adding the imageReader as a target to the previewBuilder. In which case you'll need to make sure that the preview images aren't too big to fit in the yuvImage.
In my case, this outputs an Also, RGBA_8888 has 4 channels, 8 bytes/channel, so
where: Or you could make yuvImage bigger in order to fit your images. |
@kmlx Thanks for your response. If I initialize the ImageReader like this |
|
Hi guys, I've released version 1.2 :) Any updates on this? |
Hi @kmlx it has been a while, but I haven't forgotten this issue yet :) Do you have that code sample with camera2 and using the |
Hi @kmlx |
@lfdversluis @rahulsnitd1014 You should be able to get javacv to work with the Camera2Video sample from Google. |
Thanks. I have already seen these and implemented but its still giving green frame. |
Hi @lfdversluis @saudet , where u able to implement FFmpegframerecorderor sample RecordActivity.java for Camera2 api.If yes then can u please share the git repo for it ,it would be really helpfull. |
Hi @vishalghor, I managed to create some code that converts an |
@vishalghor more detail (camera2basic demo Camera2BasicFragment.java#L515):
So yeah, not an easy task if you're not hitting a device that works with RGB. Sure, I could work on a demo that works with just a couple of devices (ones that support RGBA_8888), but then we'll have a lot of issues on github. And producing a renderscript demo is currently too time consuming for me. Also, getting an rgb byte array from camera2 isn't really an issue for these forums, more like stackoverflow. So that's where we are right now:
And I haven't even mentioned performance :) |
Hi @kmlx you've stated that you can fully access rgb byte arrays for any device using camera1 API... How it is done? I'm using ffmpegframerecorder with camera1 api (onPreviewFrame) and with a Nexus 4 I'm getting green frames... Thanks. |
@xdeop green frames means the resolution or the camera settings are not supported. |
Ok. Thanks. I'll give it a try.
Has someone accomplished migrating the RecordActivity example with the
Camera2 api?
Thanks.
2017-04-18 10:14 GMT+02:00 Adrian Stanescu <notifications@github.com>:
… @xdeop <https://github.com/xdeop> green frames means the resolution or
the camera settings are not supported.
choose the right resolution/settings and it will work.
you can find how to choose the right resolution on stack overflow.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#163 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE_FrvdFCMR5a32b3FVvZWHNYU7NVUt1ks5rxHDlgaJpZM4FGM3V>
.
--
Xavi Deop
|
hardware.camera is deprecated.
The examples should be updated to use camera2.
If I find some time I will take a look at it.
The text was updated successfully, but these errors were encountered: