yuv

How to find out resolution and count of frames in YUV 4:2:0 file?

你说的曾经没有我的故事 提交于 2019-11-27 01:59:56
问题 How to find out resolution and count of frames in YUV 4:2:0 file if i know how many pixel(luma samples) in the image? 回答1: YUV 4:2:0 planar looks like this: ---------------------- | Y | Cb|Cr | ---------------------- where: Y = width x height pixels (bytes) Cb = Y / 4 pixels (bytes) Cr = Y / 4 pixels (bytes) Total num pixels (bytes) = width * height * 3 / 2 This is how pixels are placed in 4:2:0 sub-sampling: As you can see, each chroma value is shared between 4 luma-pixels. Basically, the

Displaying YUV Image in Android

我怕爱的太早我们不能终老 提交于 2019-11-27 00:31:34
In my application, we need to display the Video frame receives from server to our android application, Server is sending video data @ 50 frame per second, having encoded in WebM i.e. using libvpx to encode and decode the images, Now after decoding from libvpx its getting YUV data, that we can displayed over the image layout, the current implementation is something like this, In JNI / Native C++ code, we are converting YUV data to RGB Data In Android framework, calling public Bitmap createImgae(byte[] bits, int width, int height, int scan) { Bitmap bitmap=null; System.out.println("video:

QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka color format

不羁的心 提交于 2019-11-26 23:24:07
问题 all Does anybody know details about QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka format, it's the output format of qcom 7x30 h/w decoder, how data is stored in such color format? thanks 回答1: This is my research on this, about QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka converting to YUV420Planar (I420) . As far as QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka format is concerned, you can refer to ($your_android_native_sdk_dir)/WORKING_DIRECTORY/hardware/qcom/media

How to perform RGB->YUV conversion in C/C++?

痴心易碎 提交于 2019-11-26 20:27:49
问题 How to perform RGB->YUV conversion in C/C++? I have some Bitmap.. RGB I need to convert it to YUV Libs? Tuts? Articles? 回答1: ImageMagick? 回答2: You might also want to try these integer only calculations (should be faster than floats) #define CLIP(X) ( (X) > 255 ? 255 : (X) < 0 ? 0 : X) // RGB -> YUV #define RGB2Y(R, G, B) CLIP(( ( 66 * (R) + 129 * (G) + 25 * (B) + 128) >> 8) + 16) #define RGB2U(R, G, B) CLIP(( ( -38 * (R) - 74 * (G) + 112 * (B) + 128) >> 8) + 128) #define RGB2V(R, G, B) CLIP((

Convert bitmap array to YUV (YCbCr NV21)

夙愿已清 提交于 2019-11-26 18:41:13
How to convert Bitmap returned by BitmapFactory.decodeFile() to YUV format (simillar to what camera's onPreviewFrame() returns in byte array)? Fracdroid Here is some code that actually works: // untested function byte [] getNV21(int inputWidth, int inputHeight, Bitmap scaled) { int [] argb = new int[inputWidth * inputHeight]; scaled.getPixels(argb, 0, inputWidth, 0, 0, inputWidth, inputHeight); byte [] yuv = new byte[inputWidth*inputHeight*3/2]; encodeYUV420SP(yuv, argb, inputWidth, inputHeight); scaled.recycle(); return yuv; } void encodeYUV420SP(byte[] yuv420sp, int[] argb, int width, int

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

╄→гoц情女王★ 提交于 2019-11-26 15:52:49
I am capturing image using SurfaceView and getting Yuv Raw preview data in public void onPreviewFrame4(byte[] data, Camera camera) I have to perform some image preprocessing in onPreviewFrame so i need to convert Yuv preview data to RGB data than image preprocessing and back to Yuv data. I have used both function for encoding and decoding Yuv data to RGB as following : public void onPreviewFrame(byte[] data, Camera camera) { Point cameraResolution = configManager.getCameraResolution(); if (data != null) { Log.i("DEBUG", "data Not Null"); // Preprocessing Log.i("DEBUG", "Try For Image

Rotate an YUV byte array on Android

China☆狼群 提交于 2019-11-26 10:51:35
问题 I\'m looking to rotate a YUV frame preview recieved from a Preview Callblack, so far I\'ve founded this post which cointains an algorithm to rotate the frame preview but is messing the preview image camera pixels rotated another way to rotate the image will be creating a jpg out of the YUV image, create a bitmap, rotate a bitmap and obtaining the byte array of the bitmap, but I really need the format in YUV (NV21). FYI. the reason I\'m asking this is because I have a camera app that supports

YUV_420_888 interpretation on Samsung Galaxy S7 (Camera2)

点点圈 提交于 2019-11-26 08:03:29
问题 I wrote a conversion from YUV_420_888 to Bitmap, considering the following logic (as I understand it): To summarize the approach: the kernel’s coordinates x and y are congruent both with the x and y of the non-padded part of the Y-Plane (2d-allocation) and the x and y of the output-Bitmap. The U- and V-Planes, however, have a different structure than the Y-Plane, because they use 1 byte for coverage of 4 pixels, and, in addition, may have a PixelStride that is more than one, in addition they

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

家住魔仙堡 提交于 2019-11-26 04:39:39
问题 I am capturing image using SurfaceView and getting Yuv Raw preview data in public void onPreviewFrame4(byte[] data, Camera camera) I have to perform some image preprocessing in onPreviewFrame so i need to convert Yuv preview data to RGB data than image preprocessing and back to Yuv data. I have used both function for encoding and decoding Yuv data to RGB as following : public void onPreviewFrame(byte[] data, Camera camera) { Point cameraResolution = configManager.getCameraResolution(); if