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.

How to define MaxLength of mfxBitstream?

jigong
Beginner
457 Views
In my application, mfxBitstream to an existing h264 decoder maybe changed from different resources. Once the decoder returned MFX_WRN_VIDEO_PARAM_CHANGED, I need to reset the decoder. So I need to assign a new MaxLenght to mfxBitstream.
It looks like that MaxLenth can be any size. But how to select a proper size.Is there any relationship between MaxLength of mfxBitstream and the resolution of video frame? Can it found by new uploaded mfxBitstream.

Thanks in advance.

Jiuxiang
0 Kudos
1 Reply
Vassili_Yakovlev
Beginner
457 Views
Hi Jiuxiang,

You have to initialize encoder/decoder session with the parameters you need (resolution, framerate, etc.)and request recommended parameters by calling GetVideoParam with mfxVideoParam structure which is initialized with all zeroes. You receive the recommended buffer size (in KB) in mfxVideoParam.mfx.BufferSizeInKB.

So MaxLength must be mfxVideoParam.mfx.BufferSizeInKB * 1024.

Kind regards,
Vassili
0 Kudos
Reply