YUV is a color space typically used as part of a color image pipeline.
Questions tagged [yuv]
784 questions
41
votes
10 answers
Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?
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…

Hitesh Patel
- 2,868
- 2
- 33
- 62
34
votes
8 answers
YUV_420_888 interpretation on Samsung Galaxy S7 (Camera2)
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…

Settembrini
- 1,366
- 3
- 20
- 32
33
votes
1 answer
Using FFMPEG to losslessly convert YUV to another format for editing in Adobe Premier
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…

kilgoretrout
- 3,547
- 5
- 31
- 46
32
votes
6 answers
Convert bitmap array to YUV (YCbCr NV21)
How to convert Bitmap returned by BitmapFactory.decodeFile() to YUV format (simillar to what camera's onPreviewFrame() returns in byte array)?

Abhijeet Pathak
- 1,948
- 3
- 20
- 28
29
votes
5 answers
Displaying YUV Image in Android
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…

Amitg2k12
- 3,765
- 10
- 48
- 97
27
votes
5 answers
Problems when scaling a YUV image using libyuv library
I'm developing a camera app based on Camera API 2 and I have found several problems using the libyuv.
I want to convert YUV_420_888 images retrieved from a ImageReader, but I'm having some problems with scaling in a reprocessable surface.
In…

Francisco Durdin Garcia
- 12,540
- 9
- 53
- 95
26
votes
4 answers
How to convert RGB -> YUV -> RGB (both ways)
I want a pair of conversion algorithms, one from RGB to YUV, the other from YUV to RGB, that are inverses of each other. That is, a round-trip conversion should leave the value unchanged. (If you like, replace YUV with Y'UV, YUV, YCbCr,…

Camille Goudeseune
- 2,934
- 2
- 35
- 56
25
votes
3 answers
Rotate an YUV byte array on Android
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…

Francisco
- 253
- 1
- 3
- 5
22
votes
6 answers
Convert Android camera2 api YUV_420_888 to RGB
I am writing an app that takes the camera feed, converts it to rgb, in order to do some processing.
It works fine on the old camera implementation which uses NV21 Yuv format.
The issue I am having is with the new Yuv format, YUV_420_888. The image…

Constantin Georgiu
- 418
- 2
- 5
- 10
21
votes
2 answers
Camera.PreviewCallback equivalent in Camera2 API
Is there any equivalent for Camera.PreviewCallback in Camera2 from API 21,better than mapping to a SurfaceTexture and pulling a Bitmap ? I need to be able to pull preview data off of the camera as YUV?

user3605225
- 285
- 1
- 3
- 7
20
votes
1 answer
Difference between YUV420 and YUV422
Can you please help me understand what are the differences between YUV420 and YUV422 format?
I read this, http://www.fourcc.org/yuv.php, but I can't find the difference.
And does "YUV420" and "YUV420 SP" mean the same thing?
And does "YUV422" and…

michael
- 106,540
- 116
- 246
- 346
19
votes
1 answer
PIL's colour space conversion YCbCr -> RGB
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…

wim
- 338,267
- 99
- 616
- 750
18
votes
2 answers
How to convert RGB from YUV420p for ffmpeg encoder?
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"),…

TTGroup
- 3,575
- 10
- 47
- 79
17
votes
4 answers
Where can I obtain a raw YUV File?
I need a raw YUV file for research purposes. Neither the size nor the content is critical. Any ideas on where such files exist?

Bob Morris
- 189
- 1
- 1
- 3
17
votes
3 answers
How to deal with RGB to YUV conversion
The formula says:
Y = 0.299 * R + 0.587 * G + 0.114 * B;
U = -0.14713 * R - 0.28886 * G + 0.436 * B;
V = 0.615 * R - 0.51499 * G - 0.10001 * B;
What if, for example, the U variable becomes negative?
U = -0.14713 * R - 0.28886 * G + 0.436 *…

maximus
- 4,201
- 15
- 64
- 117