Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

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

stsybikov
Beginner
480 Views
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);
data.Color(IC_RGB);
data.NChannels(1);
data.Format(IF_FIXED);
data.ComponentOrder(0);
data.Sampling(IS_422);

PARAMS_JPEG params;
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);

SaveImageJPEG(......);

Thank you in advance,
Sergey
0 Kudos
2 Replies
IDZ_A_Intel
Employee
480 Views
Hi Sergey,

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

http://software.intel.com/en-us/forums/intel-integrated-performance-primitives/

Thanks,
Petter
0 Kudos
stsybikov
Beginner
480 Views
Hi, Peter:

Thank you. I will try to post there.

Sergey
0 Kudos
Reply