Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Santhoshini_S_
Beginner
609 Views

Are B frames from h265 hw encoder actually B frames?

Hello, I'm running the below command line on Skylake i7 6700k Windows 10, intel media sdk proffessional version. sample_encode.exe h265 -hw -hevc_encoder_plugin 1 -i inputvideo.yuv -w 1920 -h 1080 -f 30 -ooutput.hevc -u speed -b 1000 -async 3 I opened the encoded bitstreams on IntelVideoProAnalyzer and found that all the frames except the first I frame were marked as B. But all the B frames were referring to only one reference frame where I would expect two reference frames, one for forward prediction and the other for backward prediction. Does the above command line produce bitstreams with B frames and with no P frame at all? Or is there any problem with analyser and the bitstream? Am I missing anything here ? Thanks, Santhoshini
0 Kudos
6 Replies
Anna_B_Intel
Employee
609 Views

Hi Santhoshini,

The frame type is B. You can control number of reference frames (DPB buffer size) yourself by using NumRefFrame from mfxInfoMFX structure. To change number of reference frames in sample_encode.exe use [-x numRefs] option. For example the following command line encodes each B-frame with 3 or less reference frames:

sample_encode.exe h265 -i input.yuv -o output.h265 -w 176 -h 144 -b 10000 -f 30 -u quality -x 3

Best wishes,

Anna

 

Santhoshini_S_
Beginner
609 Views

Hi Anna,

Thanks, for the clarification. I was able to encode with [-x numRefs] option and observe the difference in the number of reference frames used.

1) In the anlayser I found the first frame to be I and the next frame to be B. Being the second frame it has only the previous I frame to refer. Both the L0 and L1  lists of the second frame has the same I frame for reference. How can a single reference frame be used for both forward and backward prediction in the case of a B frame ?

I was also trying to use the option [-r distance] and the comment in the sample_encode reads "Distance between I- or P- key frames (1 means no B-frames)". My command line was like this:

h265 -hw -hevc_encoder_plugin 1 -i input.yuv -w 1920 -h 1080 -f 30 -o output.h265 -u speed -b 1000 -async 3 -r 1.

Even this bitstream has only B frames. I want to see P frames. Is there an option to enable P frames explicitly?


S.Santhoshini 

Anna_B_Intel
Employee
609 Views

Hi Santhoshini,

Sorry for a delayed response. Media SDK HW HEVC encoder uses Low Delay B-frames (LDB) or Generalized P/B (GPB) instead of P-frames. So, instead of encode P-frame with L0, Media SDK encodes LDB or GPB with the same L0 and L1. That's why you see just such LDB or GPB frame where both the L0 and L1 lists have the same I frame for reference and no P-frames.

Best wishes, Anna

Giri_b_
Beginner
609 Views

Dear Anna B,

I tried to install MSS SDK on HSW system , right now i can able to triggered HW accelerators (h264_qsv decoder),

I am trying to compare decoding outputs with qsv decoder and without qsv decoder (default decoder )those two outputs are not matched..

commands used are as follows..

1) with qsv : ./ffmpeg -vcodec h264_qsv -r 30 -i input.264 -pix_fmt yuv420p output_qsv.yuv

2) with out qsv : ./ffmpeg -i input.264 output_x264.yuv ( default decoder )

these output_qsv.yuv and output_x264.yuv files are not matched..

I think that both decoders (with and with out qsv options....) should match right..?

ffmpeg version -- ffmpeg-3.0.1 downloaded from https://www.ffmpeg.org/download.html

This is a latest one build from source repo only..

I have faced few issues like:

i) duplicate frames are existing into the output sequence and some frames are also dropped and most of the sequences getting " 0 " th frame twice while decoding with h264_qsv decoder,
ii) few frames are also dropped into output file,
please give reply as soon as possible, please let me know any information needed..

Thanks & Regards,
L V GiriBabu

 

Anna_B_Intel
Employee
609 Views

Hi Giri,

Please create another forum topic for this question and attach output .yuv files with and without qsv.

Best wishes, Anna

Santhoshini_S_
Beginner
609 Views

Thanks for your response Anna.

regards,

S.Santhoshini

Reply