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.

Intel VPL sample encode/Decode for AYUV format

Areekkal
Beginner
1,185 Views

Hi,

I have a requirement to encode /decode AYUV file using intel one VPL library. i already found samples to encode decode YUV420 ( hello-encode/hello-decode sample in intel VPL library).

Anyone help me to get a sample code to encode /decode AYUV file.

 

Thanks

Areekkal

 

0 Kudos
4 Replies
Areekkal
Beginner
1,142 Views

Hi,

 

i modified the hello-encode.cpp and hello-decode.cpp  with MFX_FOURCC_AYUV and it successfully encoded and decoded. But the decoded file contains a vertical white strip. modified code is below.

In hello-encode.cpp, set FourCC and chroma format as below.

encodeParams.mfx.CodecId = MFX_CODEC_HEVC; // MFX_CODEC_AVC;
encodeParams.mfx.TargetUsage = MFX_TARGETUSAGE_BALANCED;
encodeParams.mfx.TargetKbps = TARGETKBPS;
encodeParams.mfx.RateControlMethod = MFX_RATECONTROL_VBR;
encodeParams.mfx.FrameInfo.FrameRateExtN = FRAMERATE;
encodeParams.mfx.FrameInfo.FrameRateExtD = 1;
encodeParams.mfx.FrameInfo.FourCC = MFX_FOURCC_AYUV; // MFX_FOURCC_NV12;
encodeParams.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV444; // MFX_CHROMAFORMAT_YUV420;
encodeParams.mfx.FrameInfo.CropW = cliParams.srcWidth;
encodeParams.mfx.FrameInfo.CropH = cliParams.srcHeight;
encodeParams.mfx.FrameInfo.Width = ALIGN16(cliParams.srcWidth);
encodeParams.mfx.FrameInfo.Height = ALIGN16(cliParams.srcHeight);
encodeParams.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY; // MFX_IOPATTERN_IN_VIDEO_MEMORY;

 

Util.hpp -> mfxStatus ReadRawFrame(mfxFrameSurface1 *surface, FILE *f)  added one more entry in switch (info->FourCC) 

 

case MFX_FOURCC_AYUV:
// In AYUV, you will typically have four planes: A, Y, U, and V
pitch = data->Pitch;

printf("In ReadRawFrame -- MFX_FOURCC_AYUV\n");

// read luminance (Y) plane

for (i = 0; i < height; i++)
{
bytes_read = (mfxU32)fread(data->Y + i * pitch, 1, pitch, f);

if (pitch != bytes_read)
{
std::cout << "In ReadRawFrame -- Byte read are not equal to pitch - Reading Y -->> Byte Read =" << bytes_read << std::endl;
fclose(yDest);
return MFX_ERR_MORE_DATA;
}

// fwrite(data->Y + i * pitch, 1, pitch, yDest);

}

break;

 

While iam doing decode operation, added one more entry in switch (info->FourCC) 

 

case MFX_FOURCC_AYUV:

printf("In WriteRawFrame -- MFX_FOURCC_AYUV\n");
pitch = data->Pitch;

// A,Y,U,V
for (i = 0; i < height; i++)
{
fwrite(data->Y + i * pitch, 1, pitch, f);
}

break;

 

Original inputfile ( AYUV file ) and decoded output file is attached.

 

 

0 Kudos
DiyaN_Intel
Moderator
1,116 Views

Hi,


Thank you for posting in Intel communities.

Can you please share the following details which will help us to reproduce the issue from our end:


1. Intel VPL version.


2. OS details.


3. Processor and kernel details.


We could see a video file from your screenshots. Can you send the Original input file ( AYUV file ) and the decoded output file so that we can try reproducing your exact steps with the same video file of yours?


Regards,

Diya


0 Kudos
DiyaN_Intel
Moderator
920 Views

Hi,


We have not heard back from you.

Could you please share the above details so that we can try to investigate the issue from our end?


Regards,

Diya 



0 Kudos
DiyaN_Intel
Moderator
852 Views

Hi, 


We have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks and Regards, 

Diya


0 Kudos
Reply