Camera2 1440x1080 is maximum? What? #123
Comments
Next information depressed me: https://stackoverflow.com/questions/31362202/android-camera2-output-sizes#comment50709560_31362202 p.s. I have tested on Xiaomi device |
@anonym24 I'm not really sure if I can help you, but that's kinda concerning... Regards |
@anonym24 Would you mind trying my app to see how my camera is displayed on your device, you made me doubt and I have no device like yours to test it, although since I'm using |
Manually I also tried to set 1920x1080 ( |
@anonym24
I just measured the screenshot and it is in fact 1080x1440, the black frame at the bottom is because I have the EDIT: If what you want is to set 1920x1080 as you would with the deprecated Regards |
@GuanacoDevs So I wanted to use two SurfaceTexture (one for preview, another for video recording) - add two targets |
@anonym24 Ouch, sorry, know nothing regarding Video Recording.
Usage: For the Video Recording, maybe changing Best Regards |
@GuanacoDevs there is no point to use any calc method as I already tried to manually set 1920x1080 and it didn't work (picture just was stretched from 1440x1080 to 1920x1080) anyway it doesn't matter anymore as I decided to not use Camera2 api anyway but just stay with legacy api seems really many phone manufactures just didn't implement it normally |
i solve this issue in my case by followed this answer https://stackoverflow.com/questions/53957388/camera2-api-issue?noredirect=1#comment94752473_53957388 |
@yudikarma is this a joke? So did you just crop the frame? And how is it related to this issue? |
Actually all of this in general is normal thing in Android developing. android/sunflower#299 |
No, before i have isue my preview not full screnn then i chek on here and some one tell to change onmeisure in autofitTextureview.class to make full screen. But that not help, that just scale frame and makes preview full screen and make image capture not same with preview. Then i read this issue and find the problem is camera 2 api output is so small then mw screen. So i need chooseOptimalsize method better to get maximal size output. Then i find and paste that method on that link. So this is not joke |
@yudikarma as I said before already I tried to set FullHD (1920x1080) manually and all I got is stretched 1440x1080 to 1920x1080. If you got a real 1920x1080 with Camera2 on your device it doesn't mean that you can get it 100% on other devices |
I was having the same issue and it was affecting my preview image size, I checked step by step and I found there was an issue in the AutoFitTextureView class you should replace this
after that, the function who gets the largest size will work well. |
@alejouribesanchez sorry but you don't understand this issue at all. You didn't even read though it! It's not about a function which chooses resolution! just for a test you can remove all these calculations, functions, auto texture views get phone with FullHD display resolution (1920x1080) use ordinary set width, height to 1920, 1080 (constants) in your code for texture buffer you're the second here trying to suggest nonsense without even understanding the issue (as @yudikarma did) |
I had the same issue...
But it goes further than that, since apparently the |
Same thing. Developing app using Honor 8X. As described by anonym24 i have same situation with Camera2 API. I give it Surface object with size that i got as supported from Camera2 - 1920x1080. In fact, when my algorithm selects this size and proceed with it, Camera2 give to my Surface object only 1440x1080 image. It is stretched. I have no idea how to solve it. Camera2 hardware support level of my device is limited. |
@ancaiova you have no idea what are you talking about read this #123 (comment) |
@anonym24 i solved my problem. After that i moved ISurfaceHolder.SetFixedSize from SurfaceCreated method to OnMeasure everything is okay. I placed it before View.SetMeasuredDimension. Hope it helps somebody. |
@shpingalet007 you solved nothing |
@anonym24 keep in mind when you creating an issue you are communicating with other. I solved my issue that was the same with described method. If it doesn't works for you - okay. But i tried to help and it worked for me. Good luck |
@shpingalet007 I understand, but you are a fourth or fifth user here who absolutely doesn't understand the problem I described in the question. You don't need to move any methods if you can set a hardcoded resolution to just test that it doesn't work. Also there is a method which returns which resolutions supports camera2 on your device:
e.g. Output on some Xiaomi devices: imageDimension 1440x1080 (the highest... not a full hd) |
I'm trying to display normal Full HD preview in landscape orientation (1920x1080) using
Camera2
, but camera returns 1440x1080 as the highest resolution.With Legacy Camera (
android.hardware.camera
) there was no such issue for the same device. What am I doing wrong?Output:
Also it seems that to correctly display preview in landscape we need a lot of headache code like:
From official sample https://github.com/googlesamples/android-Camera2Basic/blob/master/Application/src/main/java/com/example/android/camera2basic/Camera2BasicFragment.java#L740
Isn't Camera2 supposed to make things easier than legacy camera? I'm not sure...
Though one good thing I see: we can set many surface targets, with legacy camera we could not use
setPreviewDisplay
andsetPreviewTexture
together, but Camera2 allows many outputsThe text was updated successfully, but these errors were encountered: