Questions tagged [yuv]

YUV is a color space typically used as part of a color image pipeline.

784 questions
7
votes
3 answers

CVOpenGLESTextureCacheCreateTextureFromImage returns error 6683

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…
Doc
  • 1,480
  • 2
  • 16
  • 28
6
votes
1 answer

Problems converting YV12 to RGB through GLSL

I'm trying to accomplish YV12 to RGB conversion mentioned in this post with GLSL shaders. My application loads a raw YV12 frame from the disk and tries to perform the conversion using GLSL shaders. However, the resulting image is flipped vertically…
karlphillip
  • 92,053
  • 36
  • 243
  • 426
6
votes
1 answer

glPopMatrix() yells "unsupported texture format in setup_hardware_state"

I'm trying to make some optimizations in a private video player for Linux aiming to improve performance because playing MP4 files are heavy on the CPU, since the video frames are encoded in YV12 and OpenGL doesn't provide a native way to display…
karlphillip
  • 92,053
  • 36
  • 243
  • 426
6
votes
4 answers

Correct YUV422 to RGB conversion

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…
Seb
  • 3,414
  • 10
  • 73
  • 106
6
votes
0 answers

Firebase MLKit Android from an external camera

I believe I found a bug in the Firebase MLKit for Android, but perhaps other people have some insight into it. I am currently streaming video from a drone to my Android device. It is being decoded to YUV420-888 with MediaCodecand written to an…
hellowill89
  • 1,538
  • 2
  • 15
  • 26
6
votes
3 answers

SIMD: Why is the SSE RGB to YUV color conversion about the same speed as the c++ implementation?

I've just tried to optimize an RGB to YUV420 converter. Using a lookup table yielded a speed increase, as did using fixed point arithmetic. However I was expecting the real gains using SSE instructions. My first go at it resulted in slower code and…
Ralf
  • 9,405
  • 2
  • 28
  • 46
6
votes
1 answer

DirectX: The best way to get RGB data from ID3D11Texture2D with DXGI_FORMAT_NV12 format?

I'm using DirectX to draw videos. After decoding by Intel Media SDK. And then I draw it by the following Intel's Code: mfxStatus CD3D11Device::RenderFrame(mfxFrameSurface1 * pSrf, mfxFrameAllocator * pAlloc) { HRESULT hres = S_OK; mfxStatus…
TTGroup
  • 3,575
  • 10
  • 47
  • 79
6
votes
1 answer

Camera2 api Imageformat.yuv_420_888 results on rotated image

Lots of questions have been made about camera2 api and RAW image format, but searching online I have still not found the answer (that's why I am here btw). I am trying to do some real-time image processing on camera-captured frames using ImageReader…
jackops
  • 776
  • 5
  • 15
6
votes
1 answer

Convert YUV4:4:4 to YUV4:2:2 images

There is a lot of information on the internet about the differences between YUV4:4:4 to YUV4:2:2 formats, however, I can not find anything that tells how to convert the YUV4:4:4 to YUV4:2:2. Since such conversion is performed using software, I was…
Nazar
  • 820
  • 5
  • 13
  • 36
6
votes
4 answers

No conversion from RGB to YUV

I fail to find an easy-to-use function in any Python library (preferrably PIL) for conversion from RGB to YUV. Since I have to convert many images, I don't want to implement it myself (would be expensive without LUTs and so on). When I do the…
romeasy
  • 260
  • 1
  • 3
  • 12
6
votes
1 answer

Converting from YUV colour space to RGB using OpenCV

I am trying to convert a YUV image to RGB using OpenCV. I am a complete novice at this. I have created a function which takes a YUV image as source and converts it into RGB. It is like this : void ConvertYUVtoRGBA(const unsigned char *src, unsigned…
d1xlord
  • 239
  • 3
  • 4
  • 12
6
votes
1 answer

How to convert NV21 image format in bitmap?

I am getting preview data from camera. It is in NV21 format. I want to save the preview to SD Card i.e in bitmap. My code is getting image and saving it, but in the gallery it is not captured preview. It is just black rectangle, Here is the code. …
user3864752
  • 143
  • 3
  • 15
6
votes
2 answers

Android org.webrtc.VideoRenderer.I420Frame arrays to PreviewCallback.onPreviewFrame byte[]

I keep hoping some code will appear on the internet, but getting nowhere ;) WebRTC incoming I420Frame object seems to have 3 arrays of yuvPlanes A typical Android camera app gets PreviewCallback.onPreviewFrame byte[] as a single array of bytes. Can…
6
votes
1 answer

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

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…
Andrew Cottrell
  • 3,312
  • 3
  • 26
  • 41
6
votes
1 answer

RGB to YCbCr Conversion problems

i need convert RGB image to YCbCr colour space, but have some colour shift problems, i used all formulas and got the same result. Formula in python cbcr[0] = int(0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]) #Y cbcr[1] = int(-0.1687*rgb[0] -…
Runnko
  • 61
  • 1
  • 3