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.
3058 Discussions

MFXVideoENCODE MFX_ERR_UNSUPPORTED with RGB4 color mode

Sven_R_
Beginner
927 Views
Hello, I'm new to the Intel Media SDK and currently I'm doing my first steps with it. My first steps are done with the encoder sample. Trying to encode RGB4 but the encoder initialization always results in a MFX_ERR_UNSUPPORTED status when validating the parameters. With NV12 format everything works. Below you can see my code. What I want to do is to convert RGB4 pictures to an H.264 video stream. Thanks in advance for your help. // Initialize encoder parameters mfxVideoParam mfxEncParams; memset(&mfxEncParams, 0, sizeof(mfxEncParams)); mfxEncParams.mfx.CodecId = MFX_CODEC_VC1; mfxEncParams.mfx.TargetUsage = MFX_TARGETUSAGE_BALANCED; mfxEncParams.mfx.TargetKbps = 2000; mfxEncParams.mfx.RateControlMethod = MFX_RATECONTROL_VBR; mfxEncParams.mfx.FrameInfo.FrameRateExtN = 30; mfxEncParams.mfx.FrameInfo.FrameRateExtD = 1; mfxEncParams.mfx.FrameInfo.FourCC = MFX_FOURCC_RGB4; mfxEncParams.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420; mfxEncParams.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE; mfxEncParams.mfx.FrameInfo.CropX = 0; mfxEncParams.mfx.FrameInfo.CropY = 0; mfxEncParams.mfx.FrameInfo.CropW = inputWidth; mfxEncParams.mfx.FrameInfo.CropH = inputHeight; // Width must be a multiple of 16 // Height must be a multiple of 16 in case of frame picture and a multiple of 32 in case of field picture mfxEncParams.mfx.FrameInfo.Width = MSDK_ALIGN16(inputWidth); mfxEncParams.mfx.FrameInfo.Height = (MFX_PICSTRUCT_PROGRESSIVE == mfxEncParams.mfx.FrameInfo.PicStruct)? MSDK_ALIGN16(inputHeight) : MSDK_ALIGN32(inputHeight); mfxEncParams.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY; // Create Media SDK encoder MFXVideoENCODE mfxENC(mfxSession); // Validate video encode parameters (optional) // - In this example the validation result is written to same structure // - MFX_WRN_INCOMPATIBLE_VIDEO_PARAM is returned if some of the video parameters are not supported, // instead the encoder will select suitable parameters closest matching the requested configuration sts = mfxENC.Query(&mfxEncParams, &mfxEncParams);
0 Kudos
2 Replies
Petter_L_Intel
Employee
927 Views

Hi Sven,

The intent of Media SDK encode component is to perform the encoding operation, and it only accepts NV12 input. If you need to perform color space conversion before feeding NV12 surface to the encoder you should use Media SDK VPP component. Please refer to the documentation and the VPP sample for details. With regards to RGB4 color space conversion with encode, there is also a simple sample for just this use case part of the Media SDK Tutorial here: http://software.intel.com/en-us/articles/intel-media-sdk-tutorial   (http://software.intel.com/en-us/articles/intel-media-sdk-tutorial-simple-6-encode-d3d-vpp-preproc)

Regards,
Petter 

0 Kudos
Sven_R_
Beginner
927 Views

Thanks for your fast answer and the hints to the samples.

0 Kudos
Reply