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.
3058 Discussions

Are B frames from h265 hw encoder actually B frames?

Santhoshini_S_
Beginner
2,048 Views
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
2,048 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

 

0 Kudos
Santhoshini_S_
Beginner
2,048 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 

0 Kudos
Anna_B_Intel
Employee
2,048 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

0 Kudos
Giri_b_
Beginner
2,048 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

 

0 Kudos
Anna_B_Intel
Employee
2,048 Views

Hi Giri,

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

Best wishes, Anna

0 Kudos
Santhoshini_S_
Beginner
2,048 Views

Thanks for your response Anna.

regards,

S.Santhoshini

0 Kudos
Reply