yuv

Rotate YUV420/NV21 Image in android

半世苍凉 提交于 2019-11-29 00:12:42
In PreviewCall back of surface we are getting YUV420SP format in camera Preview but due to wrong rotation of that image I want to perform correct rotation of YUV image as I need to send it through network.so correct rotation need to be applied. I found this link it does correct rotation but image loose the color. http://www.wordsaretoys.com/2013/10/25/roll-that-camera-zombie-rotation-and-coversion-from-yv12-to-yuv420planar/ also checked Rotate an YUV byte array on Android but it does not show image properly. I do have checked links on stckoverflow but none of them have satisfactory answer

CVOpenGLESTextureCacheCreateTextureFromImage returns error 6683

人走茶凉 提交于 2019-11-29 00:09:55
I am currently attempting to draw an image in openGL using YUV420 format (bi-planar). I receive raw data, and am attempting to parse it into a CVPixelBuffer, and then pass said buffer using CVOpenGLESTextureCacheCreateTextureFromImage. While I receive no errors when parsing into the CVPixelBuffer, I receive an error (-6683) when trying to pass into CVOpenGLESTextureCacheCreateTextureFromImage. I'm trying my best to follow apple's GLCameraRipple sample code - except again, I'm using raw image data instead of data from the camera. Hopefully someone can explain what it is that I'm missing here -

Resize (downsize) YUV420sp image

情到浓时终转凉″ 提交于 2019-11-28 21:41:45
I am trying to resize (scale down) an image which comes in YUV420sp format. Is it possible to do such image resizing without converting it into RGB, so directly manipulating the YUV420sp pixel array? Where can I find such algorithm? Thanks YUV 4:2:0 planar looks like this: ---------------------- | Y | Cb|Cr | ---------------------- where: Y = width x height pixels Cb = Y / 4 pixels Cr = Y / 4 pixels Total num pixels (bytes) = width * height * 3 / 2 And the subsamling used like this: Which means that each chroma-pixel-value is shared between 4 luma-pixels. One approach is just to remove pixels,

camera2 api convert yuv420 to rgb green out

只谈情不闲聊 提交于 2019-11-28 20:54:09
i trying convert image from YUV_420_888 to rgb and i have some trouble with output image. In ImageReader i get image in format YUV_420_888 (using camera 2 api for get this image preview). imageReader = ImageReader.newInstance(1920,1080,ImageFormat.YUV_420_888,10); In android sdk for YuvImage class writing, that YuvImage using only NV21, YUY2. as we can see difference between N21 and yuv420 not big and i try convert data to N21 YUV420: and N21: in onImageAvailable i get separately each Planes and put them in correct place (as on image) ByteArrayOutputStream outputStream = new

420YpCbCr8BiPlanarVideoRange To YUV420 ?/How to copy Y and Cbcr plane to Single plane?

不羁岁月 提交于 2019-11-28 18:58:12
i have captured video using AVFoundation .i have set (video setting )and get in outputsamplebuffer kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange format. But i need YUV420 format for further processing . My doubt is 1.difference among 420YpCbCr8BiPlanarVideoRange,420YpCbCr8BiPlanarFULLRange, 420YpCbCr8PlanarFullRange,420YpCbCr8Planar and YUV420 ? 2.how can i convert 420YpCbCr8BiPlanarVideoRange to YUV420 ? 3. How to Convert YUV420 To 32BGRA ? 4) or some other Way to do this??? that is Any open source library or Apple Framework.... i have gone through Accelerate framework ...... it has image

Using FFMPEG to losslessly convert YUV to another format for editing in Adobe Premier

对着背影说爱祢 提交于 2019-11-28 15:44:44
I have a raw YUV video file that I want to do some basic editing to in Adobe CS6 Premiere, but it won't recognize the file. I thought to use ffmpeg to convert it to something Premiere would take in, but I want this to be lossless because afterwards I will need it in YUV format again. I thought of avi, mov, and prores but I can't seem to figure out the proper command line to ffmpeg and how to ensure it is lossless. Thanks for your help. Yes, this is possible. It is normal that you can't open that raw video file since it is just raw data in one giant file, without any headers. So Adobe Premiere

camera2 captured picture - conversion from YUV_420_888 to NV21

烂漫一生 提交于 2019-11-28 13:04:36
Via the camera2 API we are receiving an Image object of the format YUV_420_888 . We are using then the following function for conversion to NV21 : private static byte[] YUV_420_888toNV21(Image image) { byte[] nv21; ByteBuffer yBuffer = image.getPlanes()[0].getBuffer(); ByteBuffer uBuffer = image.getPlanes()[1].getBuffer(); ByteBuffer vBuffer = image.getPlanes()[2].getBuffer(); int ySize = yBuffer.remaining(); int uSize = uBuffer.remaining(); int vSize = vBuffer.remaining(); nv21 = new byte[ySize + uSize + vSize]; //U and V are swapped yBuffer.get(nv21, 0, ySize); vBuffer.get(nv21, ySize, vSize

Has anyone managed to obtain a YUV_420_888 frame using RenderScript and the new Camera API?

南笙酒味 提交于 2019-11-28 12:45:19
I'm using RenderScript and Allocation to obtain YUV_420_888 frames from the Android Camera2 API, but once I copy the byte[] from the Allocation I receive only the Y plane from the 3 planes which compose the frame, while the U and V planes values are set to 0 in the byte[]. I'm trying to mimic the onPreviewframe from the previos camera API in order to perform in app processing of the camera frames. My Allocation is created like: Type.Builder yuvTypeBuilderIn = new Type.Builder(rs, Element.YUV(rs)); yuvTypeBuilderIn.setX(dimensions.getWidth()); yuvTypeBuilderIn.setY(dimensions.getHeight());

Convert android.media.Image (YUV_420_888) to Bitmap

笑着哭i 提交于 2019-11-28 09:58:18
I'm trying to implement camera preview image data processing using camera2 api as proposed here: Camera preview image data processing with Android L and Camera2 API . I successfully receive callbacks using onImageAvailableListener, but for future processing I need to obtain bitmap from YUV_420_888 android.media.Image. I searched for similar questions, but none of them helped. Could you please suggest me how to convert android.media.Image (YUV_420_888) to Bitmap or maybe there's a better way of listening for preview frames? I write some code about this, and it's the YUV datas preview and chang

OnPreviewFrame data image to imageView

谁都会走 提交于 2019-11-28 07:50:49
i'm trying to get the byte[] from the preview of the camera, convert it to bitmap and display it on a imageview with imageView.setImageBitmap() i've managed to start the preview and display it on a surfaceView, but i don't know how to convert the byte[] data (that comes in Yuv format i think) in a RGB bitmap to display it on a imageView. the code i'm trying is the following: camera = camera.open(); parameters = camera.getParameters(); camera.setParameters(parameters); surfaceHolder = surfaceView.getHolder(); surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); camera