CameraFilter | 研究 Android 用 OpenGL ES 2.0 处理相机预览和滤镜。 | Graphics library
kandi X-RAY | CameraFilter Summary
kandi X-RAY | CameraFilter Summary
研究 Android 用 OpenGL ES 2.0 处理相机预览和滤镜。. 使用 GLSurfaceView 显示相机画面,用 OpenGL 实现不同滤镜效果。. android-gpuimage 使用 GL_TEXTURE_2D 作为纹理目标。 在处理相机预览画面时,需要将每帧的图像颜色由 YUV 转成 RBGA,画面不流畅。. 这里使用 GL_TEXTURE_EXTERNAL_OES 作为纹理目标,绕过了 YUV 转 RBGA 步骤。 另外简单处理了一下预览画面的比例。. 使用 grafika 方案(需要Android 4.3),用 MediaCodec、MediaMuxer 编码生成 MP4。使用 MediaCodec 的 createInputSurface,接收来自 OpenGL 渲染的画面。. 与 android-gpuimage 一样,使用 GL_TEXTURE_2D 作为纹理目标,传入需要处理的图片,然后用滤镜渲染。不过因为纹理目标不同,不能直接套用相机的滤镜,导致每个滤镜分别要写两次…….
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Handles a set of parameters
- Sets the camera
- Returns the optimal size for the given picture size and view height
- Configure camera parameters
- Handle camera click
- Gets the cache directory
- Get cache directory
- Start touch autoFocus
- Calculate tap area
- Shuts down a shared context
- Returns the EGL config
- Called when a surface is created
- Creates a texture with the specified text content
- Sets the texture size and height
- Called when the draw is drawn
- Start the encoder thread
- Sets the bitmap
- From interface CameraHandler
- Check if a font facing is facing
- Returns a suitable EGLConfig
- Initializes the View
- Binds the torque curve
- Called when a drawable is drawn
- Saves the current frame to a file
- Set curves from input stream
- Release the EGL context
CameraFilter Key Features
CameraFilter Examples and Code Snippets
Community Discussions
Trending Discussions on CameraFilter
QUESTION
I'm trying to follow the answer given here: https://stackoverflow.com/a/32381052/8422218 to create an app which uses the back facing camera and adds a filter, then displays it on the screen in real time
here is my code:
...ANSWER
Answered 2017-Nov-01 at 22:41There are a few things wrong with your code on top
You are using a AVCaptureVideoPreviewLayer
but this is going to transport pixels capture by the camera directly to the screen, skipping your image processing and CIFilter
and is not necessary.
Your conformance to AVCaptureVideoDataOutputSampleBufferDelegate
is out of date. func captureOutput(captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, fromConnection connection: AVCaptureConnection!)
is now called func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection)
Because you won't be using AVCaptureVideoPreviewLayer
you'll need to ask for permission before you'll be able to start getting pixels from the camera. This is typically done in viewDidAppear(_:)
Like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install CameraFilter
You can use CameraFilter like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the CameraFilter component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page