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.

Is mfxEncodeStatsContainer ready to be used?

svutran
New Contributor I
1,553 Views

Hi,

We have noticed that the mfxEncodeStatsContainer structure is available with OneVPL experimental mode.

At the moment, it seems that it returns nothing after the sync operation when passing the extended buffer to the bitstream before encode.

We are currently testing it on the hello-encode code.

 

Do you have any code example on how to retrieve the encode statistics (mfxEncodeStatsContainer) or is there any limitations on this feature?

 

Thanks you.

 

System Informations: 

Ubuntu 22.04

Linux kernel: 6.2.0-36-generic

OneVPL API version 2.8

Intel i7 11th generation

 

Labels (1)
7 Replies
ThasneemV_Intel
Moderator
1,524 Views

Hi,


Thanks for posting in Intel Communities. As of now, we don't have any samples for mfxEncodeStatsContainer and we don't have any limitations for this feature. Please find more info here: https://spec.oneapi.io/onevpl/latest/API_ref/VPL_structs_encode.html#mfxencodestatscontainer


Could you please share the following details for triaging your issue further:

1) Sample reproducer code

2) Screenshot of the obtained output for reference.


Regards,

Thasneem Vazim


0 Kudos
svutran
New Contributor I
1,515 Views

So, I am using the hello-encode.cpp provided in the examples folder of OneVPL.

 

First, I am trying to attach the EncodeStatsOutput structure to the bitstream

 

        mfxEncodeStatsContainer* poStatsContainer = new mfxEncodeStatsContainer();
        mfxExtEncodeStatsOutput* poEncodeStatsOutput = new mfxExtEncodeStatsOutput();
        poEncodeStatsOutput->Header.BufferId = MFX_EXTBUFF_ENCODESTATS;
        poEncodeStatsOutput->Header.BufferSz = sizeof(mfxExtEncodeStatsOutput);
        poEncodeStatsOutput->Mode = MFX_ENCODESTATS_MODE_DEFAULT;
        poEncodeStatsOutput->EncodeStatsContainer = poStatsContainer;

        bitstream.NumExtParam = 1;
        bitstream.ExtParam    = (mfxExtBuffer **)(&poEncodeStatsOutput);

        sts = MFXVideoENCODE_EncodeFrameAsync(session,
                                              NULL,
                                              (isDraining == true) ? NULL : encSurfaceIn,
                                              &bitstream,
                                              &syncp);

 

 

Then, I try to retrieve the stats after a successful sync operation

 

                    sts = MFXVideoCORE_SyncOperation(session, syncp, WAIT_100_MILLISECONDS);
                    VERIFY(MFX_ERR_NONE == sts, "MFXVideoCORE_SyncOperation error");

                    WriteEncodedStream(bitstream, sink);
                    framenum++;

                    // Extract statistics
                    mfxExtEncodeStatsOutput* poEncodeStatsOutput = (mfxExtEncodeStatsOutput*)(bitstream.ExtParam[0]);
                    {
                        // Do something with poEncodeStatsOutput
                    }

 

 

But when inspecting the values of poEncodeStatsOutput->EncodeStatsContainer, it is always empty. Below, is the content of the EncodeStatsOutput structure retrieved after the sync operation. We see that EncodeStatsContainer is empty.

svutran_1-1701276979991.png

 

Thank you for your time.

 

Stephan

ThasneemV_Intel
Moderator
1,422 Views

Hi,

 

We are checking on this internally. Meanwhile, could you please provide the modified hello-encode.cpp file and any other files that you have modified so that we can triage your issue further?

 

Regards,

Thasneem Vazim

 

0 Kudos
svutran
New Contributor I
1,355 Views

Hi,

 

Here is the modified hello-encode.cpp.

 

Thank you

0 Kudos
ThasneemV_Intel
Moderator
1,304 Views

Hi,


Thank you for sharing the details. We are checking on this internally.


Regards,

Thasneem vazim


0 Kudos
Pamela_H_Intel
Moderator
1,058 Views

Stephan,

Experimental features are unsupported. For this particular feature we expect to add documentation and sample code, but cannot provide these yet, as experimental status means that the dev team may rework various aspects of the feature.

We do appreciate you asking though. Your question sparked some good conversation around experimental features and how we might easily be able to offer some pointers.

Pamela

0 Kudos
svutran
New Contributor I
921 Views

Thank you for the update

0 Kudos
Reply