Questions tagged [libyuv]

libyuv is an open source project that includes YUV scaling and conversion functionality

libyuv is an open source project that includes YUV scaling and conversion functionality.

  • Scale YUV to prepare content for compression, with point, bilinear or box filter.
  • Converts webcam formats to YUV (I420).
  • Convert YUV to formats for rendering/effects.
  • Rotate by 90 degrees to adjust for mobile devices in portrait mode.
  • Optimized for SSE2/SSSE3 on x86/x64.
  • Optimized for Neon on Arm.

Source: code.google.com (libyuv)

39 questions
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
  • 9,572
  • 4
  • 39
  • 79
6
votes
2 answers

NV12 format and UV plane

i am a little confused about the NV12 format. i am looking the this page to understand the format. What i currently understand is that if you have an image or video of 640 x 480 diminsion then the Y plane will be having 640 x 480 bytes and U and V…
Madu
  • 4,157
  • 7
  • 38
  • 69
5
votes
1 answer

Convert from RGB to YUYV in OpenCV

Is there a way to convert from RGB to YUYV (YUY 4:2:2) format? I noted that OpenCV has reverse operation, but not RGB to YUYV for some reason. Maybe someone can point to code which does that (even outside of OpenCV library)? UPDATE I found libyuv…
Pavel Podlipensky
  • 7,973
  • 5
  • 38
  • 52
4
votes
0 answers

Crop YUV420/NV21 byte array directly in android

I need to crop every frame from the camera's onPreviewFrame. I want to crop it directly doing operations with the byte array without converting it to a bitmap. The reason I want to do it directly on the array is because it can't be too slow or too…
stanete
  • 3,714
  • 9
  • 19
  • 28
4
votes
1 answer

Convert YUV_420 _888 to ARGB using Libyuv

I am processing Android camera2 preview frames which are encoded in YUV_420 _888, by calling the method I420ToARGB from the Libyuv library but I get images in wrong colors. libyuv::I420ToARGB( ysrc, //const uint8* src_y, ystride, //int…
Weber
  • 425
  • 5
  • 9
3
votes
1 answer

Rotate YUV420Sp image by 90 degrees counter clockwise

I want to rotate YUV420SP image by 90 counter clockwise. Image size is 640*480, so the rotated image size becomes 480*640 which i don't want, So i want to extract 480*480 data (or any other square size) and rotate that data. I have seen : Rotate an…
nkalra0123
  • 1,965
  • 10
  • 16
2
votes
2 answers

Scaling YUV420 Image using libyuv produces weird output

Possible duplicate of This question with major parts picked from here. I've tried whatever solutions were provided there, they don't work for me. Background I'm capturing an image in YUV_420_888 image format returned from ARCore's…
Clinkz
  • 615
  • 5
  • 18
2
votes
1 answer

How to convert android camera preview data in NV21 format to i420 by libyuv?

I receive the preview data in NV21 format by: public void onPreviewFrame(byte[] data, Camera camera) I want to convert data to I420 format by libyuv. It seems NV21ToI420 or ConvertToI420 in include/libyuv/convert.h is what i need. // Convert NV21…
Jerikc XIONG
  • 3,189
  • 5
  • 36
  • 62
1
vote
1 answer

opencv can't open a yuv422 image while rawpixels.net can display the image

I am trying to open a yuv format image. I can open it with rawpixels.net and display it after setting the following width:1920 height:1080 predefined format: yuv420 (nv12) pixel format yuv But if I open with opencv with the following code I failed…
takanoha
  • 121
  • 6
1
vote
0 answers

libyuv crash on iPhone

I get a libyuv crash recently. I try a lot, but no use. Please help or try to give some ideas how to achieve this. Thanks! I have a iOS project(Objective C). One of the functions is encode the video stream. My idea is Step 1: Start a timer(20…
Phineas Huang
  • 683
  • 7
  • 17
1
vote
0 answers

Android NV12ToARGB LibYUV?

I want to convert byte[] NV12 format to ARGB. In LibYUV, I found that: LIBYUV_API int NV12ToARGB(const uint8* src_y, int src_stride_y, const uint8* src_uv, int src_stride_uv, uint8* dst_argb, int dst_stride_argb, …
1
vote
0 answers

convert NV21 to NV12 an rotate 90 degrees By libyuv?

I'm developing an Android Camera application. When I deal the frame, I met some troubles. In Camera's onPreviewFrame(byte[] data, Camera camera) function, I set data's format is NV21 fromat, because NV21 is all Android devices supported. When I use…
I'm SuperMan
  • 383
  • 3
  • 18
1
vote
0 answers

The transparent pixels in my Bitmap shown as white

I'm using c code to get frame from a gif file and it's working fine using ffmpeg library av_read_frame, then I convert the returned image from this format BGRA to ARGB format using this method libyuv::ABGRToARGB. In the java part I receive the…
1
vote
0 answers

Concatenating Video Files using FFMPEG YUV issue

I am concatenating three videos with FFMPEG. The 1st and 3rd video of the concatenation were pulled from an AVI file using FFMPEG and converted into MP4. Their codec information is below. The 2nd video in the concatenation is compiled using…
SpoiledTechie.com
  • 9,951
  • 19
  • 73
  • 98
1
vote
1 answer

How to implement the Mirror by libyuv::I420Scale for android front camera?

The following words are from libyuv#rotation Mirror - Horizontal Flip Mirror functions for horizontally flipping an image, which can be useful for 'self view' of a webcam. int I420Mirror(const uint8* src_y, int src_stride_y, const…
Jerikc XIONG
  • 3,189
  • 5
  • 36
  • 62
1
2 3