Comments (4)
预览变形主要是因为分辨率宽高与预览的尺寸不一致导致的。你可以看看cameralibrary里面的RenderManager.java。里面将纹理尺寸和预览尺寸的VertexBuffer、TextureBuffer 做了拆分。全屏预览时需要将预览尺寸做调节处理。比如你相机输入的纹理是16:9的,而你全屏预览时SurfaceView的尺寸是18:9还是其他什么奇怪比例。这是你就需要调整预览的顶点坐标或者纹理坐标了。关于如何调整,你先理解顶点坐标(-1.0 ~ 1.0)和纹理坐标(0.0 ~ 1.0)映射到图像分辨率的关系,调整实际的预览顶点坐标/纹理坐标即可。
from caincamera.
十分感谢
from caincamera.
大神,能不能麻烦再帮忙提示一下。具体怎么改啊。本人初学者。还望见谅
from caincamera.
个人建议初学者先好好把OpenGL ES的基础知识弄懂了再来搞美颜类相机等涉及GPU编程的应用开发,要不然遇到其他问题还是不搞不明白的,Shader 的方方面面都跟这个密切相关。OpenGLES的基础知识是移动端GPU编程应用开发的先决条件。技术这饭是要一口一口吃的,这跟初学者没任何关系,谁第一次接触不是初学者?
解决思路的话,可以参考以往的讨论正方形录制的issue,里面涉及了关键的技术要点:
正方形录制
你先配合这个isssue里面的技术要点,自己找关于OpenGLES顶点坐标和纹理坐标的文章配合起来看,自己弄懂怎么去实现这个。关于顶点坐标/纹理坐标映射图像之后,怎么裁剪怎么处理变形都是一样的套路,剩下的都是数学计算了。你可以尝试着调整VertexBuffer/TexturBuffer 的坐标值,然后看图像的变化,这样会理解得更深入一点。
from caincamera.
Related Issues (20)
- setPreviewSize 无效,保存的图片分辨率只和预览尺寸有关吗
- 想获取美颜后的数据 HOT 3
- 录制视频花屏 HOT 1
- Android11 录制视频失效
- Video black screen HOT 1
- 贴纸的延迟比较高
- 更改了人脸识别API_KEY和API_SECRET,滤镜无效果 HOT 2
- 关于多线程预览录制的问题
- 腮红妆没效果
- 部分滤镜延迟较高.怎么优化啊 HOT 1
- 华为应用市场有个 233相机 的应用,包名都没变,加了个广告就上线了。。。
- 大佬还优化嘛
- RtmpPusher in pushlibrary
- Black screen when use all function relate PlayVideo
- GLConsumer: error creating EGLImage: 0x3002
- E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
- 美颜磨皮效果欠佳 HOT 1
- 使用VideoPlayer组件播放视频时有杂音
- 在 Java 层实现绘制逻辑效率较低也不具备跨平台,建议把对 GL 的操作以及 Render 逻辑都放到 c 层实现
- avcodec_open2! -542398533
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caincamera.