JessYanCoding / Camerafilters
Licence: apache-2.0
📷 摄像头实时滤镜处理库,自带10多种滤镜,支持滤镜扩展,并且兼容七牛云直播滤镜处理
Stars: ✭ 181
Programming Languages
java
68154 projects - #9 most used programming language
Projects that are alternatives of or similar to Camerafilters
Android Ffmpeg Camerarecord
使用JavaCV提供的支持, 使用OpenGL实时处理+显示摄像头采集的图像, 并使用FFMPEG实时录制音视频
Stars: ✭ 334 (+84.53%)
Mutual labels: camera, filter
Pixelsdk
The modern photo and video editor for your iPhone / iPad app. A fully customizable image & video editing iOS Swift framework.
Stars: ✭ 192 (+6.08%)
Mutual labels: camera, filter
Ezfilter
A lightweight (<180KB), easy-to-extend Android filter and dynamic sticker framework for adding filters and stickers for camera, video, bitmap and view.(一个轻量级(<180KB)、易扩展的Android滤镜和动态贴纸框架,支持摄像头、视频、图片和视图添加滤镜和贴纸。)
Stars: ✭ 155 (-14.36%)
Mutual labels: camera, filter
Ypimagepicker
📸 Instagram-like image picker & filters for iOS
Stars: ✭ 3,661 (+1922.65%)
Mutual labels: camera, filter
Ios tips
iOS的一些示例,持续更新中:1、AVFoundation 高仿微信相机拍摄和编辑 2、AVFoundation 人脸检测、实时滤镜、音视频编解码、GPUImage框架的使用等音视频相关内容 3、OpenGLES 4、LeetCode算法练习 5、iOS Crash防护和APM监控 6、WKWebView相关的内容 等........
Stars: ✭ 896 (+395.03%)
Mutual labels: camera, filter
Gpuimage X
A Cross-platform (for both Android & iOS) Framework for GPU-based Filters, Video and Image Processing.
Stars: ✭ 154 (-14.92%)
Mutual labels: camera, filter
Kalibr
The Kalibr visual-inertial calibration toolbox
Stars: ✭ 2,410 (+1231.49%)
Mutual labels: camera
Haishinkit.swift
Camera and Microphone streaming library via RTMP, HLS for iOS, macOS, tvOS.
Stars: ✭ 2,237 (+1135.91%)
Mutual labels: camera
Pynet Pytorch
Generating RGB photos from RAW image files with PyNET (PyTorch)
Stars: ✭ 169 (-6.63%)
Mutual labels: camera
Elasticsearch Gmail
Index your Gmail Inbox with Elasticsearch
Stars: ✭ 1,964 (+985.08%)
Mutual labels: filter
Alcameraviewcontroller
A camera view controller with custom image picker and image cropping.
Stars: ✭ 2,023 (+1017.68%)
Mutual labels: camera
Flutter camera ml vision
A flutter widget that show the camera stream and allow ML vision recognition on it, it allow you to detect barcodes, labels, text, faces...
Stars: ✭ 175 (-3.31%)
Mutual labels: camera
Annca
Android library to simplify work with camera for video and photo with using different camera apis.
Stars: ✭ 169 (-6.63%)
Mutual labels: camera
Icimulator
Simulate camera functions on iOS Simulator with images, videos, or your MacBook Camera.
Stars: ✭ 177 (-2.21%)
Mutual labels: camera
Fastbuy App
App to manage the products of the FastBuy Store (built with React Native and Redux).
Stars: ✭ 168 (-7.18%)
Mutual labels: camera
Shuffle
Categorize, sort, and filter a responsive grid of items
Stars: ✭ 2,170 (+1098.9%)
Mutual labels: filter
Aquila
IPCamera, aim to support V4L2/UVC/RaspberryPi/Hisi/XXX SDK production
Stars: ✭ 173 (-4.42%)
Mutual labels: camera
CameraFilters
摄像头实时滤镜处理库,自带10多种滤镜,支持滤镜扩展,并且兼容七牛云直播滤镜处理
Usage
Download
implementation 'me.jessyan:camerafilters:1.0'
Declare permissions:
<uses-permission android:name="android.permission.CAMERA"/>
Declare feature:
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
Step 1
mFilterManager = FilterManager
.builder()
.context(mApplicationContext)
.isUseQiniu(false)//是否在qiniu云直播上使用滤镜
.addExtFilterListener(new onExtFilterListener() {//添加扩展的滤镜,因为滤镜创建必须在render的回调中,所以统一在这里管理滤镜
@Override
public IFilter onCreateExtFilter(Context context, int index) {
switch (index) {
case 0://继承于cameraFitlter后可自定义filter,此Filter可任意添加一张图片到界面上
return new CameraFilterBlend(context, R.mipmap.
pic_addpic);
default:
return new CameraFilter(context, false);
}
}
})
.defaultFilter(new FilterInfo(false, 0))//设置默认滤镜(false为使用内置滤镜,角标范围是0-13,0为透明滤镜)
.build();
Step 2
- 在
GLSurfaceView.Renderer
的三个回调方法中,将参数传给FilterManager
对应的方法. - onSurfaceCreated ---> FilterManager.initialize();
- onSurfaceChanged ---> FilterManager.updateSurfaceSize(width, height);
- onDrawFrame ---> mFilterManager.drawFrame(mTextureId, mSTMatrix, mIncomingWidth, mIncomingHeight);
- 以上为
GLSurfaceView.Renderer
回调和FilterManager
方法的对应关系(请参照Demo) - 最后在结束时记得调用
mFilterManager.release()
释放资源
Step 3 ( if you use qiniu see here )
mCameraStreamingManager.setSurfaceTextureCallback(new SurfaceTextureCallback() {
@Override
public void onSurfaceCreated() {
mFilterManager.initialize();
}
@Override
public void onSurfaceChanged(int i, int i1) {
mFilterManager.updateSurfaceSize(i, i1);
}
@Override
public void onSurfaceDestroyed() {
mFilterManager.release();
}
@Override
public int onDrawFrame(int i, int i1, int i2, float[] floats) {
return mFilterManager.drawFrame(var1, null, var2, var3);
}
});
- 在七牛直播上使用滤镜也非常简单,和第二步相似,记得
FilterManager.isUseQiniu(true)
&mFilterManager.drawFrame(var1, null, var2, var3);
第二个参数一定要传null,七牛视频编码必须为硬编码
FilterInfo structure
使用默认滤镜和切换滤镜需要传入FilterInfo对象
Field | Description |
---|---|
isExt | 是否使用扩展的滤镜 |
index | 滤镜在对应滤镜列表中的角标,如果isExt为false,则使用内置滤镜列表,为true则对应扩展滤镜列表 |
Dev tips
具体用法参照Demo
,有Opengl
基础的可以自定义滤镜
About Me
- Email: [email protected]
- Home: http://jessyan.me
- 掘金: https://gold.xitu.io/user/57a9dbd9165abd0061714613
- 简书: http://www.jianshu.com/u/1d0c0bc634db
License
Copyright 2016, jessyan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].