- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your fast answer and the hints to the samples.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page