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.

Actual bitrate in sample_encode

ramya_s_
Beginner
888 Views

Hello,

I read through the doc for mfxVideoParam and mfxInfoMFX and did not find a field for the actual bitrate achieved by the encoder. The target bitrate printed is same as the input bitrate. Is the actual bitrate derivable from any other parameters that is available to the user through the API ? I am using a proffessional version of intel media server studio. 

0 Kudos
4 Replies
Harshdeep_B_Intel
888 Views

Hi Ramya,

Media SDK includes few common bitrate control methods (BRC) methods, where constant bitrate (CBR) mode is a default method shown with sample. In MSDK API you can control the bit rate by selecting the BRC mode suitable for your application. From mediaSDK manual in  mfxInfoMFX structure, you can set RateControlMethod parameter to achieve this. Here is link to article which explains different BRC modes available:https://software.intel.com/en-us/articles/common-bitrate-control-methods-in-intel-media-sdk. Hope this is the information you are looking for.

Thanks,

0 Kudos
Sravanthi_K_Intel
888 Views

Hi Ramya, If you want to find out the finally achieved bitrate by the encoder, you can use tools such as MediaInfo, Elecard, or even Intel(R) Video Pro Analyzer to find per-frame bitrate achieved. If you want the overall file bitrate, then use the filesize, the length of the stream to compute the bitrate (Mbps).

0 Kudos
ramya_s_
Beginner
888 Views

Hi harsha, thanks for the link. 

Hi sravanthi, 

Executed intel mss hevc encoder using sample_encode.exe on skylake using the following commandline

sample_encode.exe h265 -sw -hevc_encoder_plugin 1 -i apple_tree.yuv -w 1920 -h 1080 -f 25 -o spple_tree.hevc -u speed -b 1000 -async 3 -p 2fca99749fdb49aeb121a5b63ef568f7

The input video is of size roughly 1gb with 338 frames and the encoded file size is 1.28 mb. So say the overall file bit rate = encoded file size/no_of_frames * input fps. The value turns out to be 0.09 mbps whereas the input bitrate is 1 mbps. I notice that the achieved bitrate is off the desired bitrate by almost 1/10th for this particular case. 

Do spot any inconsistencies if any. Importantly, is there any command line option that I can pass to sample_encode.exe to achieve the desired bitrate ? 

0 Kudos
Alexey_F_Intel
Employee
888 Views

you have lost a multiplyer by 8, so got MByte/s not MBit/s.

338 frames with 25 fps framerate, it is 13.5 sec. with encoded file size = 1.28MB, you have (1.28 *8)Mbit = 10.24Mbit/13.5 sec = 0.76Mbps

To achieve exact encoded bitrate as desired you Constant Bitrate Control - CBR, it shal have least deviation from the desired target.

0 Kudos
Reply