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.

mfx encoder strange behavior bitrate is upto 200mbps.

Zurab_T_1
Beginner
552 Views
I am encoding raw yuv420 to avc 8mbps, but the result8ng videos bitrate is in range 20mbps to 200mbps. here is set5ings which I am using. 1280x720x50p nv12 yuv420 aspectratio=1÷1 use va-drm for memory allocation. asyncdepth=4. targetusage=best_speed, but changing this parameter to best_quality gives no changes. use vbr targetkbps=8000 cropx=cropy=0 cropw and croph are both aligned. gopsize=12 goprefdist=1 all other parameters are set to zero. can someone tell me what to check? the same va api implementation works fine when i use it in my transcoder.
0 Kudos
5 Replies
Zurab_T_1
Beginner
552 Views
Is there anybody? I really need help.
0 Kudos
Zurab_T_1
Beginner
552 Views

It was my problem. I set framerate 50/1 instead of 1/50, but it is very interesting why this affect on the bitrate.

0 Kudos
Surbhi_M_Intel
Employee
552 Views

Hi Zurab, 

Apologies for late response. Were you using sample - sample_encode to do so? Generally when bitrate(in Kbps) is less than 0 or not mentioned then it is passed through the function of Calculatedefaultbitrate() which consider height width and framerate to calculate frame rate. Check sample_utils.cpp in sample_encode for more details.  

    mfxF64 at = nWidth * nHeight * dFrameRate / 30.0;

    if (!at)
        return 0;

    switch (nTargetUsage)
    {
    case MFX_TARGETUSAGE_BEST_QUALITY :
        {
            bitrate = (&fnc)->at(at);
            break;
        }
    case MFX_TARGETUSAGE_BEST_SPEED :
        {
            bitrate = (&fnc)->at(at) * 0.5;
            break;
        }
    case MFX_TARGETUSAGE_BALANCED :
    default:
        {
            bitrate = (&fnc)->at(at) * 0.75;
            break;
        }
    }

    return (mfxU16)bitrate;
}

If I didn't get your question right, can you please provide us the reproduces and input in which you are seeing the issue, will be happy to debug. 

Thanks,
Surbhi

0 Kudos
Zurab_T_1
Beginner
552 Views

I already solved the problem..

It was my mistake, but I will try describe the situation more detailed.

I was set targetkbps to 8000, targetusage to speed also I set ratecontrol to vbr, but the framerate I set not correctyl, except 1/50 it was 50/1.

and the resulting bitstream was very bad quality and the bitrate was up to 200mbps. by changing framerate to correct value it was fixed.

 

Thanx for the answer.

 

0 Kudos
Surbhi_M_Intel
Employee
552 Views

I am glad you got it resolved! thanks for updating the post :)

-Surbhi

0 Kudos
Reply