Media (Intel® oneAPI 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

how to disable B frame of HEVC?

qiufang_l_
Beginner
1,682 Views

Hi, 

I run sample_encode on windows. I set the command arguments as follows: 

h265 -i D:\yuv\rpd_720p_slow.yuv -o output.h265 -w 1280 -h 720 -b 10000 -nobref -x 1 -u speed -p e5400a06c74d41f5b12d430bbaa23d0b

I expect hevc encoder output I P P P P P P...., but it's output is I BBBBBB. and the number of reference frame is not 1.

I saw the document Intel® Media Server Studio 2016 - HEVC Decoder and Encoder Release Notes, it says: 

 H.265 MAIN SP profile is not supported in current implementation.
 Real-time encoding not guaranteed.

My question is :

Is p frame supported by Hevc encoder ? Or how can i set the number of reference frames of B frame to 1?

 

0 Kudos
9 Replies
Jeffrey_M_Intel1
Employee
1,682 Views

I've replicated the behavior you've described.  Hope to get back to you in a day or two with some updates and recommendations.

0 Kudos
Surbhi_M_Intel
Employee
1,682 Views

Hi qiufang

We don't have a public API to not encode B frames for HEVC codec, included as a new feature in our next release. we have a workaround at the moment, will send you that by end of the day. 

Thanks,
Surbhi

0 Kudos
qiufang_l_
Beginner
1,682 Views

Hi, Jeffrey and Surbhi.

Thank both of you.

0 Kudos
Jeffrey_M_Intel1
Employee
1,682 Views

Glad to help!  Just wanted to add, on the subject of reference counts: 

The NumRefFrame parameter works differently for H264 and HEVC.  With HEVC, references are based on pyramid hierarchy, not the NumRefFrame setting.

0 Kudos
qiufang_l_
Beginner
1,682 Views

Thanks for your information and for being helpful.

 

Jeffrey Mcallister (Intel) wrote:

Glad to help!  Just wanted to add, on the subject of reference counts: 

The NumRefFrame parameter works differently for H264 and HEVC.  With HEVC, references are based on pyramid hierarchy, not the NumRefFrame setting.

0 Kudos
Silviu_B
Beginner
1,682 Views

Any update for this? Right now, the HEVC encoder marks all the P frames as B frames. The only indication that you have a P frame is that the slice_pic_order_cnt_lsb value jumps ahead for P frames.

For example, if I indicate I want a GOP size of 5 and distance between reference frame of 2:

GopPicSize=5

GopRefDist=2

I get the following output (I listed the values of slice type and slice_pic_order_cnt_lsb from the output):

slice type     slice_pic_order_cnt_lsb

I                   0
B                  2
B                  1
B                  4
B                  3

I                   5

But I should get

I                   0
P                  2
B                  1
P                  4
B                  3

I                   5

 

0 Kudos
Erwan_L_1
Beginner
1,682 Views

Hello,

I use last Media sdk (MediaServerStudioEssentials2017R2) under linux .

This is a bug..

in mediasdk-man.pdf we are advised to configure GopOptFlag value to MFX_GOP_STRICT . It does not work for to configure my hevc encoder.  

The encoder must strictly follow the given GOP structure as
defined by parameter GopPicSize, GopRefDist

How fix it ? thank in avance

 

 

 

0 Kudos
马__域
Beginner
1,682 Views

Have you solved this problem?

0 Kudos
cedronius__anders
New Contributor I
1,487 Views

I'm experiencing the same 'problem'

Media SDK 20.5.1

Installed like this ->

https://github.com/Unit-X/Intel-MSDK-Ubuntu20-04-Installer

System Ubuntu 20.04

$uname -a

5.4.0-59-generic #65-Ubuntu SMP Thu Dec 10 12:01:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$cat /proc/cpuinfo -> 

model name : Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz

I set 

IdrInterval = 0
GopOptFlag = 0
GopRefDist = 1-4 (meaning I changed this parameter from 1 to 4)
GopPicSize = 30

This produces as expected a IDR with a distance of 30 frames however when looking at the codestream all other pictures are marked as slice_type==0 meaning B frame slice. 

Is that correct behaviour for coding HEVC? What parameter in the codestream should I look for indicating there is a reference frame according to the setting GopRefDist?

 

Is there a better or updated example for controlling the GOP structure apart from 'example 17' as referred too in the documentation.

Thanks for helping.

 

/Anders 

0 Kudos
Reply