Log in

View Full Version : How to read b-frame stats?


Losko
13th July 2020, 14:07
I noticed this statement among others into final x265 statistics and I just can't understand what it means:

x265 [info]: frame I: 1, Avg QP:17.48 kb/s: 101.60
x265 [info]: frame P: 3, Avg QP:24.08 kb/s: 61.07
x265 [info]: frame B: 21, Avg QP:28.86 kb/s: 13.57
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: Weighted B-Frames: Y:4.8% UV:4.8%
x265 [info]: consecutive B-frames: 25.0% 0.0% 0.0% 0.0% 0.0% 25.0% 0.0% 0.0% 50.0%

(this is just a 25 frames encoding test, btw)
I don't get why there are 9 values when I asked x265 to use max 8 b-frames (--bframes 8).
Any suggestions?

Boulder
13th July 2020, 14:34
The first value is for zero consecutive B-frames, like in a sequence 'IPBP'. If you enable csv logging, you can see how the frame types are in the final encode along with other stats.

Losko
14th July 2020, 09:46
Encode Order, Type, POC, QP, Bits, Scenecut, RateFactor, Latency, List 0, List 1, Intra 64x64 DC, Intra 64x64 Planar, Intra 64x64 Ang, Intra 32x32 DC, Intra 32x32 Planar, Intra 32x32 Ang, Intra 16x16 DC, Intra 16x16 Planar, Intra 16x16 Ang, Intra 8x8 DC, Intra 8x8 Planar, Intra 8x8 Ang, 4x4, Inter 64x64, Inter 64x64 (Rect), Inter 64x64 (Amp), Inter 32x32, Inter 32x32 (Rect), Inter 32x32 (Amp), Inter 16x16, Inter 16x16 (Rect), Inter 16x16 (Amp), Inter 8x8, Inter 8x8 (Rect), Inter 8x8 (Amp), Skip 64x64, Skip 32x32, Skip 16x16, Skip 8x8, Merge 64x64, Merge 32x32, Merge 16x16, Merge 8x8
0, I-SLICE, 0, 17.48, 4064, 0,18.087,24, -, -, 0.00%, 0.00%, 0.00%,51.18%, 38.52%, 0.00%, 1.07%, 9.23%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%
1, P-SLICE, 9, 20.23, 5192, 0,21.000,15, 0 , -, 0.00%, 0.00%, 0.00%,40.61%, 27.30%, 0.88%, 9.69%, 8.61%, 0.49%, 0.88%, 0.59%, 0.29%, 0.20%, 2.05%, 0.00%, 0.00%, 0.29%, 0.00%, 0.00%, 0.20%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 7.63%, 0.00%, 0.00%, 0.00%, 0.29%, 0.00%
2, B-SLICE, 5, 28.00, 856, 0,23.271,19, 0 ,9 , 0.00%, 0.00%, 0.00%, 6.71%, 0.35%, 0.71%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.53%, 0.00%, 0.00%, 0.00%, 0.53%, 0.00%, 0.18%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.35%, 0.00%, 0.00%, 20.32%, 56.36%, 13.96%, 0.00%
3, b-SLICE, 1, 29.00, 1104, 0,23.271,23, 0 ,5 9 , 0.00%, 0.00%, 0.00%,28.17%, 8.25%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.60%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 7.44%, 0.00%, 0.00%, 27.77%, 11.67%, 16.10%, 0.00%
4, b-SLICE, 2, 29.00, 1112, 0,23.271,22, 0 ,5 9 , 0.00%, 0.00%, 0.00%,28.00%, 8.20%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.60%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 7.40%, 0.00%, 0.00%, 27.40%, 12.40%, 16.00%, 0.00%
5, b-SLICE, 3, 29.00, 424, 0,23.271,21, 0 ,5 9 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.62%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 61.88%, 12.50%, 25.00%, 0.00%
6, b-SLICE, 4, 29.00, 624, 0,23.271,20, 0 ,5 9 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.54%, 0.00%, 0.00%, 0.00%, 8.89%, 0.27%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.54%, 0.00%, 0.00%, 48.79%, 19.41%, 21.56%, 0.00%
7, b-SLICE, 6, 29.00, 512, 0,23.271,18, 5 0 ,9 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.78%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 45.95%, 32.38%, 20.89%, 0.00%
8, b-SLICE, 7, 29.00, 424, 0,23.271,17, 5 0 ,9 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.31%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 62.19%, 12.50%, 25.00%, 0.00%
9, b-SLICE, 8, 29.00, 424, 0,23.271,16, 5 0 ,9 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.31%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 62.19%, 12.50%, 25.00%, 0.00%
10, P-SLICE, 15, 26.00, 1176, 0,21.000,9, 9 5 0 , -, 0.00%, 0.00%, 0.00%, 8.24%, 0.22%, 0.22%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.22%, 9.54%, 8.24%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 33.41%, 21.69%, 18.22%, 0.00%
11, B-SLICE, 12, 28.00, 1104, 0,23.271,12, 9 5 0 ,15 , 0.00%, 0.00%, 0.00%,33.41%, 0.90%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.22%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 9.19%, 17.94%, 0.00%, 35.43%, 2.02%, 0.90%, 0.00%
12, b-SLICE, 10, 29.00, 408, 0,23.271,14, 9 5 0 ,12 15 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.31%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 62.19%, 12.50%, 25.00%, 0.00%
13, b-SLICE, 11, 29.00, 360, 0,23.271,13, 9 5 0 ,12 15 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 62.50%, 12.50%, 25.00%, 0.00%
14, b-SLICE, 13, 29.00, 408, 0,23.271,11, 12 9 5 0 ,15 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.62%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 61.88%, 12.50%, 25.00%, 0.00%
15, b-SLICE, 14, 29.00, 440, 0,23.271,10, 12 9 5 0 ,15 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.31%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 61.30%, 13.62%, 24.77%, 0.00%
16, P-SLICE, 24, 26.00, 960, 0,21.000,0, 15 12 9 5 0 , -, 0.00%, 0.00%, 0.00%, 6.46%, 0.18%, 0.18%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.18%, 0.00%, 0.00%, 0.18%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 7.36%, 0.00%, 0.00%, 21.54%, 49.55%, 14.36%, 0.00%
17, B-SLICE, 20, 28.00, 424, 0,23.271,4, 15 12 9 5 ,24 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.62%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 61.88%, 12.50%, 25.00%, 0.00%
18, b-SLICE, 16, 29.00, 472, 0,23.271,8, 15 12 5 ,20 24 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.79%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 46.58%, 31.58%, 21.05%, 0.00%
19, b-SLICE, 17, 29.00, 488, 0,23.271,7, 15 12 5 ,20 24 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 1.17%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 55.43%, 19.94%, 23.46%, 0.00%
20, b-SLICE, 18, 29.00, 360, 0,23.271,6, 15 12 5 ,20 24 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 62.50%, 12.50%, 25.00%, 0.00%
21, b-SLICE, 19, 29.00, 360, 0,23.271,5, 15 12 5 ,20 24 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 62.50%, 12.50%, 25.00%, 0.00%
22, b-SLICE, 21, 29.00, 352, 0,23.271,3, 20 15 12 5 ,24 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 62.50%, 12.50%, 25.00%, 0.00%
23, b-SLICE, 22, 29.00, 352, 0,23.271,2, 20 15 12 5 ,24 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 62.50%, 12.50%, 25.00%, 0.00%
24, b-SLICE, 23, 29.00, 392, 0,23.271,1, 20 15 12 5 ,24 , 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.31%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 62.19%, 12.50%, 25.00%, 0.00%

This is becoming very hard to understand: B-SLICE 2 has 7 following bframes, B-SLICE 11 has 4 and B-SLICE 17 has 7 again.
I just can't achieve that final line:
25.0% 0.0% 0.0% 0.0% 0.0% 25.0% 0.0% 0.0% 50.0%

MasterNobody
14th July 2020, 10:23
I0 - 0 B-frames following
P1 - 8 B-frames following
P10 - 5 B-frames following
P16 - 8 B-frames following
Result: 0 B-frames: 1/4=25%, 5 B-frames: 1/4=25%, 8 B-frames: 2/4=50%

Losko
14th July 2020, 13:46
OH thanks :eek:
I see now the percentage is calculated with respect to possible placements, NOT the total bframes amount.
Feeling newbie...