Unable to encode YUV4:2:0 data to color JPEG image

Unable to encode YUV4:2:0 data to color JPEG image

I have video streaming (YUV 4:2:0 1920x1080) that comes from hardware. I was able to encode and muxing this video to MPEG2, MPEG4 and H.264 file, but I have the problem to save a single frame as jpeg file.

I have buffer with raw YUV 4:2:0 video frame (1920x1080) and using a sample code from UIC jpeg I only was able to encode the data only as image with GRAY color. I tried to manipulate with different configuration and parameters but the image file has 0 size or if the file doesn't have 0 bytes size when I try to open the image I receive the message that the file can't be opened because the file appears to be damaged, corrupted, or is too large.

Any ideas what could be wrong?

I tried to use the SaveImageJPEG functions from jpeg.cpp without and play around with data that I am passing to it. This is the sample of one of my try code before using SaveImageJPEG function

CIppImage data(1920,1080,1,8,0);
data.Attach(1920,1080,1,8, YUV_4_2_0_buffer, 0);

params.nthreads = 1;
params.color = IC_RGB;
params.huffman_opt = 1;
params.mode = JPEG_BASELINE;
params.point_transform = 0;
params.predictor = 1;
params.quality = 100;
params.sampling = IS_422;
params.dct_scale = JD_1_8;
params.use_qdct = 1;
params.tmode = 1;
params.restart_interval = 1;
params.comment_size = sizeof(params..comment);


Thank you in advance,

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Sergey,

This is a question best addressed on the Intel IPP forum. Could you please post your question there for appropriate support.



Hi, Peter:

Thank you. I will try to post there.


Leave a Comment

Please sign in to add a comment. Not a member? Join today