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