Questions tagged [yuv]

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

784 questions
8
votes
2 answers

Convert NV21 byte array into bitmap readable format

Hey I'm creating small camera app I have implemented every things but I have one problem which is converting NV21 byte array into jpeg format I have found many way but all of them even not working or work on some devices firstly i tried this…
Antwan
  • 3,837
  • 9
  • 41
  • 62
8
votes
2 answers

Rotate YUV420/NV21 Image in android

In PreviewCall back of surface we are getting YUV420SP format in camera Preview but due to wrong rotation of that image I want to perform correct rotation of YUV image as I need to send it through network.so correct rotation need to be applied. I…
Kirtan
  • 1,782
  • 1
  • 13
  • 35
8
votes
2 answers

Convert CMSampleBufferRef to UIImage with YUV color space?

I'm working with AVCaptureVideoDataOutput and want to convert CMSampleBufferRef to UIImage. Many answers are the same, like this UIImage created from CMSampleBufferRef not displayed in UIImageView? and AVCaptureSession with multiple previews It…
onmyway133
  • 45,645
  • 31
  • 257
  • 263
8
votes
2 answers

Correct conversion from rec. 709 to sRGB

How do I correctly convert colors stored as Y'CrCb (using rec. 709) to sRGB? I'm working with HDTV video and I'm extracting the raw data using libavcodec. While I have succeeded in making the conversion, I have yet to be confident that I'm doing it…
Sebastian Wahl
  • 324
  • 4
  • 11
8
votes
1 answer

Can YUV -> RGB conversion be hardware accelerated?

We have an application that reads a GigE YUV video stream and displays it on the screen. By profiling, we have learned that the function converting each frame from YUV (UYVY) to RGB24 is taking at least an order of magnitude more time and CPU than…
user1757226
  • 193
  • 2
  • 9
7
votes
1 answer

Rotating YUV image data for Portrait Mode Using RenderScript

for a video image processing project, I have to rotate the incoming YUV image data so that the data is not shown horizontally but vertically. I used this project which gave me a tremendous insight in how to convert YUV image data to ARGB for…
aminakoy
  • 413
  • 1
  • 5
  • 13
7
votes
1 answer

YCbCr Sampler in Vulkan

I've been trying to sample a YCbCr image in Vulkan but I keep getting incorrect results, and I was hoping someone might be able to spot my mistake. I have a NV12 YCbCr image which I want to render onto two triangles forming a quad. If i understand…
MulattoKid
  • 573
  • 6
  • 14
7
votes
4 answers

YUV file format

Does anybody know YUV:4:2:0 file format? I mean how a video is stored in a file with this format (in detail).
shahryar
  • 89
  • 1
  • 1
  • 2
7
votes
3 answers

YUV420 to BGR image from pixel pointers

I am capturing raw output from a decoder which is YUV420. I have got three pointers: Y(1920*1080), U(960*540) and V(960*540) separately. I want to save the image as JPEG using OpenCV. I tried using cvtcolor of opencv cv::Mat…
7
votes
1 answer

Error trying to use cvtColor with cv2.COLOR_YUV2BGR_Y422 - error: (-215) scn == 2 && depth == 0 in function cv::cvtColor

I want to read a YUV video with openCV. The YUV video is 1920*1080 and use the YUV422 format (I already tried to read this video with yuviewer and it worked) I am using Python3.6.4 with an Anaconda environnement with OpenCV 3.3.1 First I tried this…
amarion
  • 353
  • 3
  • 10
7
votes
2 answers

Greenish image with BGRA to YUV444 conversion using DirectX11 pixel shader

  I'm new to HLSL. I am trying to convert color space of an image captured using DXGI Desktop Duplication API from BGRA to YUV444 using texture as render target.   I have set my pixel shader to perform the required transformation. And taking the…
7
votes
2 answers

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

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…
user3032481
  • 548
  • 6
  • 18
7
votes
2 answers

Android camera2 jpeg framerate

I am trying to save image sequences with fixed framerates (preferably up to 30) on an android device with FULL capability for camera2 (Galaxy S7), but I am unable to a) get a steady framerate, b) reach even 20fps (with jpeg encoding). I already…
TobiasWeis
  • 491
  • 6
  • 14
7
votes
1 answer

NV21 format and odd image dimensions

I have been working for some time with NV21 images in Android and I have been tracking a bug that might be caused by incorrect indexing bytes in an NV21 image. The image in the answer of this question has a nice overview of how the Y, U and V bytes…
silvaren
  • 730
  • 6
  • 14
7
votes
1 answer

How to convert an FFMPEG AVFrame in YUVJ420P to AVFoundation cVPixelBufferRef?

I have an FFMPEG AVFrame in YUVJ420P and I want to convert it to a CVPixelBufferRef with CVPixelBufferCreateWithBytes. The reason I want to do this is to use AVFoundation to show/encode the frames. I selected…
arbief
  • 71
  • 1
  • 4