# CameraRecorder-android **Repository Path**: BDWen/CameraRecorder-android ## Basic Information - **Project Name**: CameraRecorder-android - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-08-07 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html) [![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=21)
Video Recording with Camera2 and apply video filter.
## Gradle ```groovy dependencies { // jCenter implementation 'com.daasuu:CameraRecorder-android:0.1.0' } ``` ## Usage SetUp on onResume method. ```JAVA sampleGLView = new GLSurfaceView(getApplicationContext()); FrameLayout frameLayout = findViewById(R.id.wrap_view); frameLayout.addView(sampleGLView); cameraRecorder = new CameraRecorderBuilder(activity, sampleGLView) .lensFacing(LensFacing.BACK) .build(); ``` Release on onPause method. ```JAVA sampleGLView.onPause(); cameraRecorder.stop(); cameraRecorder.release(); cameraRecorder = null; ((FrameLayout) findViewById(R.id.wrap_view)).removeView(sampleGLView); sampleGLView = null; ``` Start and Stop Video record. ```JAVA // record start. cameraRecorder.start(filepath); // record stop. cameraRecorder.stop(); ``` This filter is OpenGL Shaders to apply effects on camera preview. Custom filters can be created by inheriting GlFilter.java. , default GlFilter(No filter). Filters is here. ```JAVA cameraRecorder.setFilter(GlFilter); ``` Other methods. ```JAVA // if flash enable, turn on or off camera flash. cameraRecorder.switchFlashMode(); // autofocus change. cameraRecorder.changeAutoFocus(); // set focus point at manual. cameraRecorder.changeManualFocusPoint(float eventX, float eventY, int viewWidth, int viewHeight); // scale camera preview cameraRecorder.setGestureScale(float scale); ``` ## Builder Method | method | description | |:---|:---| | cameraRecordListener | onGetFlashSupport, onRecordComplete, onError, and onCameraThreadFinish. Detail is here. | | filter | This filter is OpenGL Shaders to apply effects on camera preview. Custom filters can be created by inheriting GlFilter.java. , default GlFilter(No filter). Filters is here. | | videoSize | Resolution of the movie, default `width=720, height=1280`. | | cameraSize | Preview size. | | lensFacing | Select back or front camera. Default `LensFacing.FRONT`. | | flipHorizontal | Flip Horizontal on recorded video. Default `flipHorizontal = false`. | | flipVertical | Flip Vertical on recorded video. Default `flipVertical = false`. | | mute | Mute audio track on recorded video. Default `mute = false`. | | recordNoFilter | No Filter on recorded video although preview apply a filter. Default `recordNoFilter = false`. | ## References And Special Thanks to * [AudioVideoRecordingSample](https://github.com/saki4510t/AudioVideoRecordingSample) * [android-gpuimage](https://github.com/CyberAgent/android-gpuimage) * [grafika](https://github.com/google/grafika) ## License [MIT License](https://github.com/MasayukiSuda/CameraRecorder-android/blob/master/LICENSE)