What is the best way for Camera Live filters. I am recently using GPUImage Library from Link: https://github.com/CyberAgent/android-gpuimagelibrary.
Than I have found SurfaceView and GLSurfaceView.
Problem is:
How to apply live filter to camera using SurfaceView or GLSurfaceView.
Thanks in advance.
This link uses Texture View
https://github.com/google/grafika/blob/master/app/src/main/java/com/android/grafika/LiveCameraActivity.java
This uses surface view to play a movie..u can manipulate it for live camera
https://github.com/google/grafika/blob/master/app/src/main/java/com/android/grafika/PlayMovieSurfaceActivity.java
To choose on whether to use surfaceView or GLSurfaceView
take a look at this
Difference between SurfaceView and GLSurfaceView in Android
Related
I'm trying to find simple examples of using OpenGL with Camera preview. Help me with code examples.
Luxand FaceSDK contains samples for Android using OpenGL to draw image from camera - you can look at the code.
I have to create a circular video player using textureview in android. I don't have idea how to achieve this. Kindly help.
It's possible to modify the Camera output as you record it, but this has nothing to do with TextureView. You can use a GLES fragment shader or apply a mask bitmap with GLES. Grafika ( github.com/google/grafika ) has some relevant code, but doesn't do what you're specifically asking for
You can achieve by providing overlay of TextureView
here is sample how you can achieve!
Can I set an ImageView to a camerapreview? Instead of using a surfaceview? I'm trying to make a camera preview semi transparent with setAlpha method, but It doesn't work on surfaceview. I mean it does work, but the camera preview is not semi transparent.
Well actually you can but not using SurfaceView. You achieve this by using GLSurface view, where you render each of your frame using shaders. In the fragment shader you can specify the opacity of your video. If you don't know OpenGL ES 2.0 you can start from here http://developer.android.com/training/graphics/opengl/index.html, but there are also many tutorial including rendering frames using opengl.
No you cannot do this, SurfaceView is the only way to create a Camera preview in Android.
iam currently using camera and surfaceview in my app to use Torch etc ... , im using these in an Activity ,
How to use Camera and SurfaceView in Background , ex . : I want to keep Torch/Led Flash On , i saw many Widget that work fine in Background , how they do it ?
Thanks .
Take a look here:
http://developer.android.com/guide/topics/media/camera.html
There is all the code you need to make an activity which shows the camera preview.
As the Camera API:
http://developer.android.com/reference/android/hardware/Camera.html#setPreviewDisplay%28android.view.SurfaceHolder%29
specifies...you need to use a SurfaceHolder for your preview. Thus you can only use a SurfaceView or a derived class for your automatic preview. Otherwise you can use for example a TextureView or an ImageView to draw your preview by yourself. You'll need though to implement the onFramePreview method to grab the frames from the preview and handle them by yourself. By using OpenGL or the ANI API you can also add effects to your frame. This is the only way, I know about, to also add effects directly on your preview, unless these effects can be achieved by overlaying a semi-transparent colored surface above your preview image.
i need to create a camera class which draw animation from openGL ES. image which captured from camera will be surfaceholder for image animation from OpenGL.
its like navigation on Wikitude or Layar.
Is there any way to do this?
you can start from make a surfaceView and add a callback to it. this example maybe can help solve your problem
John,