在preVIEW转换YUV到YUV420的Andr​​oid

编程入门 行业动态 更新时间:2024-10-22 15:42:45
本文介绍了在preVIEW转换YUV到YUV420的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

A)我在想,什么是YUV和YUV420之间的区别? B)我想从相机使用原始帧并将它们转换成YUV420的实时性。什么是做到这一点的最快方法?我用位图厂从YUV转换成JPG,我用的onDraw()方法来绘制位图。然而,这需要一些时间来处理。什么是做转换,如果我想从转换为YUV YUV420的最佳替代品?

a)I was wondering what is the difference between YUV and YUV420? b)I want to use the raw frames from Camera and convert them into YUV420 in real time. What is the fastest way to do this? I used bitmap factory to convert from yuv to jpg and I used onDraw() method to draw the bitmap. However, this takes some time to process. What is the best alternative to do the conversion if I want converting from YUV to YUV420?

推荐答案

我发现了一个很简单的方法来转换NV12到YV12 / YUV 420两行code的做的工作对我来说:

I found a very straight forward way to convert from NV12 to YV12/YUV 420. Two lines of code did the job for me:

公共无效surfaceCreated(SurfaceHolder持有者){

public void surfaceCreated(SurfaceHolder holder) {

try { // set view of surface in cameraview Camera.Parameters p = mCamera.getParameters(); p.setPreviewFormat(ImageFormat.YV12); mCamera.setParameters(p); mCamera.setPreviewDisplay(holder); mCamera.startPreview(); }

}

更多推荐

在preVIEW转换YUV到YUV420的Andr​​oid

本文发布于:2023-11-30 20:38:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1651409.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:YUV   preVIEW   oid   Andr

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!