Open okaa-pi opened 11 years ago
Yes, this is a currently known problem. One way to speed it up is to lower the resolution of the camera. I have not yet had enough time to get this working well. But I am not using the camera preview anyway, which is why I did not spend much time on it. But if anyone can get it to run faster, please send a pull request.
Thanks for your answer. I faced some other missing elements, so I just used something else. Have a good day.
@okaa-pi may I ask what other library you ended up using? I also need fast live previews.
I've traced down slow camera previews to constant GC activity. The root seems to be the data
byte array in GPUImageRenderer.onPreviewFrame()
. However, as of now I've no solution to that problem. Will investigate further...
Okay, the issue seems to be related to this bug: http://code.google.com/p/android/issues/detail?id=2794. I've fixed it - preparing a pull request now. However, frame rate doesn't seem to have improved considerably, but at least the constant GC runs are gone.
I just used the standard way of displaying the camera. I realised I didn't need GPUImage to do what I was looking for. Sorry, I can't help you =/
Thank you very much. The GC runs seem to be gone with this, but somehow on my Galaxy Nexus the frame rate drops. That is why i have not merged it in yet. I kind of want to, but not if the frame late goes lower. Or maybe it is just my phone (running CyanogenMod)?
Let's just continue the discussion over at the pull request's thread: https://github.com/CyberAgent/android-gpuimage/pull/44#issuecomment-20457410
Any solution for this issue ? me too facing this issue ? Any help please ?
use Camera.set preview size method and set a lower res value eg(640,480)
Hi! I'm currently trying to port my iPhone app which use GPUImage, on Android. I successfully created a GLSurfaceView and can affect it to my GPUImage object. But the activity is really slow and the preview is laggy.
Is it 'normal'?
Here is my code if it can be helpful:
mCamera = getCameraInstance(); // Method found in the developer guide
if(mCamera == null) { Toast.makeText(this, "No camera found", Toast.LENGTH_SHORT).show(); onBackPressed(); }
mGPUImage = new GPUImage(this); mGPUImage.setGLSurfaceView(surfaceView); mGPUImage.setUpCamera(mCamera, 90, false, frontCAM); mGPUImage.setScaleType(GPUImage.ScaleType.CENTER_CROP);