Community
cancel
Showing results for 
Search instead for 
Did you mean: 
stsybikov
Beginner
85 Views

YUV data to BMP file

Hi,

I have the issue to save YUV 1920x1080 data that I received from the video stream (single frame) as bitmap file. The created bitmap image has three separate gray pictures. The size of full image is correct 1920x1080

My sample code:

CIppImage src(1920,1080,3,3);

src.Attach(1920,1080,3,3, pFrameBuffer, 0);

src.Color(IC_YCBCR);

src.Sampling(IS_411);

src.ComponentOrder(0);

src.Format(IF_FIXED);

PARAMS_BITMAP params_bmp;

err = SaveImageBMP(src,params_bmp, fileout);

I tried to use SameImageBMP function from picnic and uic_transcoder_con samples - the same result.

I am able to save YUV buffer as bitmap file using standard bitmap functionality with correct size and colors but I want to use Intel process to do this.

Any suggestion what I did wrong.

Thank you in advance,

Sergey

0 Kudos
3 Replies
Chao_Y_Intel
Employee
85 Views

Hello, I checked the SaveImageBMP() function code. I only take the following three color space: ... switch(image.NChannels()) { case 1: imageCn.ColorSpec().SetEnumColorSpace(Grayscale); break; case 3: imageCn.ColorSpec().SetEnumColorSpace(BGR); break; case 4: imageCn.ColorSpec().SetEnumColorSpace(BGRA); break; default: break; } so, you need to covert the YUV data to BGR data first, than save to the BMP file. Thanks, Chao
stsybikov
Beginner
85 Views

Hi Chao: OK I will try do that. The other question. Do you know where video and image encoding have been processed when I used Intel API? On the Intel chip? Or on the PC RAM? Thank you. Sergey
Chao_Y_Intel
Employee
85 Views

Hi Sergey, I am not quite sure I understand the question. basically, Intel IPP is software encoder/decoder, so the encoding and decoding parts are processed by the CPUs. Thanks, Chao
Reply