How to real time preview change of Video recorder on camera like Vigo Video Hypstar

我的未来我决定 提交于 2019-12-03 02:02:21

Use GLSurfaceView. The basic idea is to have the camera preview in GLSurfaceView and draw OpenGL renderings.
The common approach is to subclass the GLSurfaceView and implements the GLSurfaceView.Renderer. The rendering tasks are performed by implementing the interface.

public class CameraRenderer extends GLSurfaceView implements GLSurfaceView.Renderer, SurfaceTexture.OnFrameAvailableListener { 
    @Override
    public synchronized void onSurfaceCreated(GL10 gl, EGLConfig config) {
        ...
        //compile shader here
    }

    @Override
    public synchronized void onSurfaceChanged(GL10 gl, int width, int height) {
        ...
        //open camera and start preview here
    }

    @Override
    public synchronized void onDrawFrame(GL10 gl) {
        ...
        //draw frame as required
    }

}

Check out this grafika project to get a better idea and this project which is close to what you're trying to do.

You need to use external libraries for that.

for using filters in camera,and such virtual effects.

Try this Libraries:

1)CameraFilter

2)This are Basic filters.

You can learn here how to implement this basic filters.

3)EffectFactory

This are effects like Instagram.

3)FaceLandMarks

This are effects like Snapchat,but for this you will need to purchase a key for using that from that api page.

I hope this helps,if this is not your answer,please ignore this answer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!