yuv

camera2 api convert yuv420 to rgb green out

╄→гoц情女王★ 提交于 2019-11-27 13:16:23
问题 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

PIL's colour space conversion YCbCr -> RGB

喜欢而已 提交于 2019-11-27 12:27:38
问题 The algorithm used by PIL v1.1.7 gives 'washed out' looking results. When converting the same source data using ffmpeg it looks correct. Using mplayer gives identical results to ffmpeg (perhaps they use the same library underneath). This leads me to believe PIL may be stuffing up the colour space conversions. The conversion seems to be sourced in libImaging/ConvertYCbCr.c : /* JPEG/JFIF YCbCr conversions Y = R * 0.29900 + G * 0.58700 + B * 0.11400 Cb = R * -0.16874 + G * -0.33126 + B * 0

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

为君一笑 提交于 2019-11-27 09:21:19
问题 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. 回答1: Yes, this is possible. It is normal that you can't

Incorrect image converting YUV_420_888 into Bitmaps under Android camera2

丶灬走出姿态 提交于 2019-11-27 08:20:23
问题 I’m trying to convert YUV_420_888 images into bitmaps, coming from the camera2 preview. But the output image has incorrect colors. Next is the test code I’m running to generate the bitmap. Is test code only, so please don’t do any code review about not relevant factors such as the bitmap is being recycled, or the RenderScript is continuously been created. This code is just to test the conversion from YUV to RGB and nothing more. Other factors, the code is meant to run from API 22 and above,

How to dump YUV from OMXCodec decoding output

余生颓废 提交于 2019-11-27 07:32:47
问题 I'd like to dump YUV data from OMXCodec decoding output. It's MediaBuffer type. It's impossible to access data() pointer. If I try to access data, crash happens due to the check code below. frameworks/av/media/libstagefright/MediaBuffer.cpp:119 CHECK(mGraphicBuffer == NULL) failed. Please let me know the solution to extract YUV data from this MediaBuffer . 回答1: From the MediaBuffer , I feel that the following should be functional. I haven't tried the same yet and have worked with rg2's

使用FFMPEG降低YUV视频分辨率(下采样)

。_饼干妹妹 提交于 2019-11-27 07:24:59
由于最近要将yuv视频下采样,于是使用ffmpeg快速将yuv视频下降分辨率。在此记录ffmpeg的基础使用方法和所遇到的问题: 1、下载FFmpeg 可到官网下载: https://www.ffmpeg.org/ 在这推荐一篇博客: https://www.cnblogs.com/liusx0303/p/7572050.html 里面详细的介绍了安装流程。 2、分辨率下降操作 操作方法一:下载安装完成之后,新建自己的工作目录。其次将所要降低分辨率的视频放入工作目录中。然后要使用cmd进入你的工作目录,写入命令: cd 加上你的工作目录地址。最后就可以输入降低分辨率的命令:ffmpeg -s 原始视频的size -i 输入视频名字及格式 -vf scale=1920:1080(这里是所要的分辨率), setsar=1:1 输出视频的名字及格式 -hide_banner 例如:ffmpeg -s 3840x1920 -i AerialCity_3840x1920_30fps_8bit_420_erp.yuv -vf scale=1920:1080,setsar=1:1 AerialCity_1920x1080.yuv -hide_banner 操作方法二:如果要批量处理,则在工作目录下写一个.bat文件。然后在.bat文件编辑中批量写入以上的命令直接执行即可。 3

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

落花浮王杯 提交于 2019-11-27 07:22:35
问题 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

Rotate an YUV byte array on Android

可紊 提交于 2019-11-27 07:07:15
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 rotation, but the frame previews are coming back in landscape mode only. The following method can rotate a

How to convert RGB from YUV420p for ffmpeg encoder?

我怕爱的太早我们不能终老 提交于 2019-11-27 04:00:40
I want to make .avi video file from bitmap images by using c++ code. I wrote the following code: //Get RGB array data from bmp file uint8_t* rgb24Data = new uint8_t[3*imgWidth*imgHeight]; hBitmap = (HBITMAP) LoadImage( NULL, _T("myfile.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); GetDIBits(hdc, hBitmap, 0, imgHeight, rgb24Data , (BITMAPINFO*)&bmi, DIB_RGB_COLORS); /* Allocate the encoded raw picture. */ AVPicture dst_picture; avpicture_alloc(&dst_picture, AV_PIX_FMT_YUV420P, imgWidth, imgHeight); /* Convert rgb24Data to YUV420p and stored into array dst_picture.data */ RGB24toYUV420P(imgWidth,

How to correctly use ImageReader with YUV_420_888 and MediaCodec to encode video to h264 format?

寵の児 提交于 2019-11-27 02:56:37
问题 I'm implementing a camera application on Android devices. Currently, I use Camera2 API and ImageReader to get image data in YUV_420_888 format, but I don't know how to exactly write these data to MediaCodec. Here are my questions: What is YUV_420_888 ? The format YUV_420_888 is ambiguous because it can be any format which belongs to the YUV420 family, such as YUV420P , YUV420PP , YUV420SP and YUV420PSP , right? By accessing the image's three planes(#0, #1, #2), I can get the Y(#0), U(#1), V(