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

IConfigureVideoEncoder with H.264 encoder in MSDK 2012

jaybo_nomad
Beginner
305 Views
I'm successfully using IConfigureVideoEncoder from C# to change the dimensions of the output stream from the H.264 encoder. But a bunch of the fields within the Params structure seem to be underdocumented, so here are a list of questions:

Q1. I am calling IConfigureVideoEncoder.SetParams() after the input is connected, but before the output is connected. Is this the best time?

Q2. Here are the default values in Params:

level_idc: LL_AUTOSELECT
preset: 3
ps_control: all zeros
target_usage: 7

I would guess that setting some of these values will alter some of the others, but the the interactions are opaque to me.

Q2a. What is target_usage?
Q2b. If ps_control is all zeros does this mean "codec, you figure it out?"
Q2c. Because preset is 3 (PRESET_FAST), does this mean none of my other settings will be accepted unless I set preset to PRESET_USER_DEFINED?

Q3: Does setting these values affect codec settings stored in the registry?
0 Kudos
1 Reply
Nina_K_Intel
Employee
305 Views
Hello,

Params structure fields are ducumented via commetatriesin the header file where defined. Also they mostly match mfxVideoParam fields so their definitions can be found in Media SDK manual.

Here are the answers to your questions:
1) This time is good. You should not call the method before input is connected as some parameters may be overwritten during connection in CheckInputType method.

2) a) target usage parameter has the same meaning as mfxVideoParam::mfx::TargetUsage, i.e. tradeoff between speed and quality of encoding, having other parameters, such as bitrate, fixed. Params::Preset is a similar but higher level tradeoff but having only stream resolution fixed - bitrate and others are tuned.

2) a) Yes, zero parameters will be passed as mfxVideoParam fields and this means codec will choose its defaults.
2) c) This is a correct assumption - choose Preset=USER_DEFINED to make sure all of your settings take effect. We will document this limitation explicitly in the next release.

3) Yes, settings will be stored in registry (see StoreEncoderParams)

Best Regards,
Nina
0 Kudos
Reply