yuv

Android Renderscript - Rotate YUV data in Renderscript

走远了吗. 提交于 2019-12-04 05:33:44
问题 Based on the discussion I had at Camera2 api Imageformat.yuv_420_888 results on rotated image, I wanted to know how to adjust the lookup done via rsGetElementAt_uchar methods so that the YUV data is rotated by 90 degree. I also have a project like the HdrViewfinder provided by Google. The problem is that the output is in landscape because the output surface used as target surface is connected to the yuv allocation which does not care if the device is in landscape or portrait mode. But I want

QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka converter

南楼画角 提交于 2019-12-04 05:29:24
问题 I need to handle YUV data from H/W decoding output on Android. Actually, I'm using Nexus4 and the decoding output format is QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka type. But I need YUV420 Planar format data, it need to be converted. Could you share the converting function or any way? 来源: https://stackoverflow.com/questions/21797923/qomx-color-formatyuv420packedsemiplanar64x32tile2m8ka-converter

manipulating luma in YUV color space

一个人想着一个人 提交于 2019-12-04 05:23:44
问题 I wont to set contrast / brightnes on image witch is in form byte[]. The image is in YCbCr_420 color space (android camera). I am geting luma value this way : for (int j = 0, yp = 0; j < height; j++) { for (int i = 0; i < width; i++, yp++) { int y = (0xff & (yuv420sp[yp])) - 16; } } How to manipulate y value to set more light? I am also not sure if this is gut way to set back the value : yuv420sp[yp] = (byte) ((0xff & y) +16); Thanx for any help. 回答1: The little that I know from this API is

avcodec YUV to RGB

本秂侑毒 提交于 2019-12-04 01:36:05
问题 I'm trying to convert an YUV frame to RGB using libswscale. Here is my code : AVFrame *RGBFrame; SwsContext *ConversionContext; ConversionContext = sws_getCachedContext(NULL, FrameWidth, FrameHeight, AV_PIX_FMT_YUV420P, FrameWidth, FrameHeight, AV_PIX_FMT_RGB24, SWS_BILINEAR, 0, 0, 0); RGBFrame = av_frame_alloc(); avpicture_fill((AVPicture *)RGBFrame, &FillVect[0], AV_PIX_FMT_RGB24, FrameWidth, FrameHeight); sws_scale(ConversionContext, VideoFrame->data, VideoFrame->linesize, 0, VideoFrame-

CVOpenGLESTextureCacheCreateTextureFromImage return -6683(kCVReturnPixelBufferNotOpenGLCompatible)

不想你离开。 提交于 2019-12-04 00:10:35
问题 I had extract Y U V data from video frame separately and saved them in data[0],data[1],data[2]; The frame size is 640*480; Now I creat the pixelBuffer as below: void *pYUV[3] = {data[0], data[1], data[2]}; size_t planeWidth = {640, 320, 320}; size_t planeHeight = {480, 240, 240}; size_t planeBytesPerRow = {640, 320, 320}; CVReturn renturn = CVPixelBufferCreateWithPlanarBytes(kCFAllocatorDefault, 640, 480, kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange, nil, nil, 3, pYUV, planeWidth,

how to display data of yuv format without converting rgb in OpenGL ES?

不羁岁月 提交于 2019-12-03 20:08:09
I have being study about OpenGL ES for iOS. I wonder that data of YUV format is can display without converting RGB. In most, the yuv data have to convert RGB for display. But, converting process is very slow, Then, that is not display smoothly. So, I would like to try to dispaly YUV data without convert to RGB. Is it possible? If possible, what can I do? Please, let me give a advice. I think it is not possible in OpenGL ES to display YUV data without convert to RGB data. jpap You can do this very easily using OpenGL ES 2.0 shaders. I use this technique for my super-fast iOS camera app

need to create a webm video from RGB frames

心不动则不痛 提交于 2019-12-03 16:18:09
I have an app that generates a bunch of jpgs that I need to turn into a webm video. I'm trying to get my rgb data from the jpegs into the vpxenc sample. I can see the basic shapes from the original jpgs in the output video, but everything is tinted green (even pixels that should be black are about halfway green) and every other scanline has some garbage in it. I'm trying to feed it VPX_IMG_FMT_YV12 data, which I'm assuming is structured like so: for each frame 8-bit Y data 8-bit averages of each 2x2 V block 8-bit averages of each 2x2 U block Here is a source image and a screenshot of the video

How can I create a YUV422 frame from a JPEG or other image on Ubuntu

喜你入骨 提交于 2019-12-03 16:08:10
I want to create a sample YUV422 Frame on Ubuntu from any image so I can code a YUV422 to RGB888 function for the sake of learning. I'd really like to be able to use a trusted tool to create a sample and convert back to a jpeg. I've tried ImageMagick but am clearly doing something wrong: convert -size 640x480 -depth 24 test.jpg -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv convert -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv -size 640x480 -depth 24 -colorspace RGB test2.jpg I've also install the mpegtools package on Ubuntu, in order to

Correct YUV422 to RGB conversion

僤鯓⒐⒋嵵緔 提交于 2019-12-03 16:02:48
I've been trying to tackle a YUV422 into a RGB conversion problem for about a week. I've visited many different websites and have gotten different formulas from each one. If anyone else has any suggestions I would be glad to hear about them. The formulas below give me an image with either and overall purple or a green hue in them. As of this moment I haven't been able to find a formula that allows me to get back a proper RGB image. I have include all my various chunks of code below. //for(int i = 0; i < 1280 * 720 * 3; i=i+3) //{ // /*m_RGB->imageData[i] = pData[i] + pData[i+2]*((1 - 0.299)/0

Fastest way to draw a MediaCodec-decoded video frame to screen?

回眸只為那壹抹淺笑 提交于 2019-12-03 14:44:15
I'm looking for the fastest way to take an image frame received from the MediaCodec decoder and draw it to the Android device screen. The important constraints and explanations are: Cannot use MediaPlayer. No intermediate app allowed. Must draw output frames from the MediaCodec decoder to the screen as quickly as possible (minimize latency). The available decoder output formats are as follows: ColorFormat[0] 0x00000013 COLOR_FormatYUV420Planar ColorFormat[1] 0x00000015 COLOR_FormatYUV420SemiPlanar ColorFormat[2] 0x7F000001 OMX_SEC_COLOR_FormatNV12TPhysicalAddress ColorFormat[3] 0x7FC00002 OMX