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.

Add SPS and VPS Information (UltraHD compatible)

Celio_A_
Beginner
1,126 Views

Hi, i like to know how can i add SPS and VPS information to be compatible with UltraHD specification, follow strict requirements

The following fields in SPS shall have the following pre-determined values.

 general_profile_space shall be set to “0”.

 sps_temporal_id_nesting_flag shall be set to “1”.

 colour_description_present_flag shall be set to “1”.

 chroma_format_idc shall be set to “1”.

 vui_parameters_present_flag shall be set to “1” (VUI parameters shall be present).

 aspect_ratio_info_present_flag in VUI parameters shall be set to “1”.

 vui_hrd_parameters_present_flag in VUI parameters shall be set to “1”.

 vui_timing_info_present_flag in VUI parameters shall be set to “1”.

 nal_hrd_parameters_present_flag in VUI parameters shall be set to “1”.

 sub_pic_hrd_params_present_flag in VUI parameters shall be set to “0”.

 fixed_pic_rate_general_flag in HRD parameters shall be set to “1”.

 overscan_appropriate_flag should be set to “0” if overscan_info_present_flag is set to 1.

 bit_depth_luma_minus8 shall be set to “2”.

 bit_depth_chroma_minus8 shall be set to “2”.

• The following fields in PPS shall have the following pre-determined values.

 dependent_slice_segments_enabled_flag shall be set to “0”. • Only progressive source is used and all pictures shall be encoded as a frame.

 general_progressive_source_flag in SPS shall be set to “1”.

 general_interlaced_source_flag in SPS shall be set to “0”.

 general_frame_only_constraint_flag in SPS shall be set to “1”.

• The no_output_of_prior_pics_flag shall be set to “0”. • The following fields in VPS shall have the following pre-determined values.

 vps_temporal_id_nesting_flag shall be set to 1.

 general_profile_space shall be set to 0.

 general_profile_idc shall be set to 2.

 general_tier_flag shall be set to 1.

 general_level_idc shall be set to 153.

 general_progressive_source_flag shall be set to “1”.

 general_interlace_source_flag shall be set to “0”.

 general_frame_only_constraint_flag shall be set to “1”.

 fixed_pic_rate_general_flag in HRD parameters, if present, shall be set to “1”

Thats all if someone from Intel can help me out

0 Kudos
5 Replies
Mark_L_Intel1
Moderator
1,126 Views

Hi Celio,

Is this for H.264 or HEVC?

Mark

0 Kudos
Celio_A_
Beginner
1,126 Views

These are needed for UltraHD and HD Hevc encoding

0 Kudos
Mark_L_Intel1
Moderator
1,126 Views

Hi Celio,

This are operations happen at the hardware level, I have to check internally and get back to you.

Please don't hesitate to ping me from forum if you didn't get the answer.

Mark

0 Kudos
Dmitry_E_Intel
Employee
1,126 Views

If you need VPS/SPS/PPS have some specific values then there are two options.

1) You may adjust values in mfxVideoParam passed to MFXVideoENCODE_Init() function so that the encoder generates VPS/SPS/PPS which you need. Here is the code how HEVC encoder builds VPS/SPS/PPS from mfxVideoParams:  https://github.com/Intel-Media-SDK/MediaSDK/blob/ac85bb6730bbd7b19a81e598a18e702fe1c7d898/_studio/hevce_hw/h265/src/mfx_h265_encode_hw_utils.cpp#L1380

2) The second option (I guess it will suite better) is to use mfxExtCodingOptionVPS/mfxExtCodingOptionSPSPPS. 

From MediaSDK manual:

mfxExtCodingOptionSPSPPS
Definition

struct {

  mfxExtBuffer Header;
  mfxU8 *SPSBuffer;
  mfxU8 *PPSBuffer;
  mfxU16 SPSBufSize;
  mfxU16 PPSBufSize;
  mfxU16 SPSId;
  mfxU16 PPSId;
} mfxExtCodingOptionSPSPPS;

Description
Attach this structure as part of the extended buffers to configure the SDK encoder during MFXVideoENCODE_Init. ... 

The SDK encoder imports parameters from these buffers. If the encoder does not support the specified parameters, the encoder does not initialize and returns the status code MFX_ERR_INCOMPATIBLE_VIDEO_PARAM.

 

In other words if you needs VPS/SPS/PPS have some specific pre-defined values you can provide VPS/SPS/PPS in a bitstream format to MFXVideoENCODE_Init functions, then MediaSDK encoder will initialize from these provided buffers and final encoded bistream will contain VPS/SPS/PPS with values you prefer. You can use example of code from https://github.com/Intel-Media-SDK/MediaSDK/blob/ac85bb6730bbd7b19a81e598a18e702fe1c7d898/_studio/hevce_hw/h265/src/mfx_h265_encode_hw_bs.cpp#L1412 to generate VPS/SPS/PPS. 

 

Regards,

Dmitry

0 Kudos
VASILY_V_
Beginner
1,126 Views

Hi, Dmitry E.

We've tried to use MFXVideoENCODE_Init with SPS VPS PPS from other source but getting MFX_ERR_INCOMPATIBLE_VIDEO_PARAM. Also this functions works perfectly with structures already generated from Media SDK.

Is there any way how to deal with it? Maybe to find out which parameters are not accepted by MediaSDK or maybe ask MediaSDK to fix some of them? So to generate stream close enough to original, but not identical.

Thanks

0 Kudos
Reply