ROI encoding with 01_video_encode sample

Hello, I am not sure if this is the best forum for this question, but I would like to ask for tips and suggestions on using the ROI feature in the 01_video_encode sample application on the Jetson AGX Xavier.

I am encoding a 1920x1080 video as follows:

./video_encode traffic.yuv 1920 1080 H264 out.h264 --input-metadata --eroi -roi roi.txt -br 1000000

And the format of the roi.txt file is:

1 -5 0 0 256 256
…repeated for N frames…

From what I understand, a negative Qpdelta should improve the quality inside the ROI. I can see that the ROI setting is having some effect, but at -5 it is a subtle improvement. Reducing it further does show a nice improvement in the stationary parts of the video within the ROI, but in areas with motion there are a lot of bothersome artifacts.

I don’t have a lot of experience with all these encoder settings, so do I need to adjust some other properties in order to get good results with the ROI?

Thanks!

Hi,
We are checking the functionalityof setting ROI. Will update.

There is a similar topic:
How to use ROI encoding on XavierNX

Thanks for looking into this. We have been experimenting with this a bit more and found that if we lower the I-frame interval and the IDR interval, then we can reduce the artifacts inside the ROI. For example:

./video_encode traffic.yuv 1920 1080 264 out.h264 -br 1000000 -p baseline -rc cbr -ifi 4 -idri 30 --input-metadata --eroi -roi roi.txt

The problem, though, is that this increases the overall bitrate, so it seems to defeat the purpose of doing ROI encoding.

Hi,
Could you try JP4.5? We have some fix in the release. See if it helps your usecase.

Thanks, but I am already using JP4.5.

Hi @DaneLLL

I am running into the same issue. I am using Jetpack 4.5. I built the same 01_encode_video sample. Then, I used the following command to encode a 1080p30 (420) video:
./encode_video <file_name> 1920 1080 H264 <file_name>.h264 -br 1000000 -p baseline -rc cbr -ifi 30 --cd --report-metadata --input-metadata --eroi -roi roi.cfg.

The roi.cfg contents are:
1 -15 1600 540 128 128

What I see is that the ROI region is not being updated every frame. If I set ifi to 30, then the ROI updates once per second (fps is 30). And the only way, as @phelps2020devel mentioned, to get the ROI to update is to decrease the i-frame interval. I have tried with other encoders and even at 500kbps, the ROI seems to update just fine every frame with similar settings. It is as though the nvVideoEncoder makes no use of P-frames for the ROI region …

Please advise.

Hi,
Please try VBR mode. In CBR mode, obeying to bitrate is with highest priority. Other settings may be overwritten.

Hi @DaneLLL

I had tried VBR and tried it again. The same issue persists. Can you please try it on your end?

Thanks.

Hi,
Could you share how you verify the function? With –eroi -roi roi.cfg, I can see frame size increase for each frame. Since I frames are with larger size than P frames, probably the size increase is not significant in P frames.

Hi @DaneLLL

Please see attached a couple of videos. You can see the ROI starting at col 1600, row 540 and size of 128x128. The rest of the frame is updating fine but the ROI is very jittery as though it only updates during an i-frame.
The videos were encoded using 1mbps and 4mbps (see names).
Once again, we have tried it with other encoders and this is not an issue i.e. the other encoder preserves details in the ROI (at the expense of the rest of the frame) but without compromising the update rate in the ROI itself…

Please let me know if you have anymore questions. This is of significant concern to us and we are somewhat relying on this to use the AGX for our product. Appreciate the help!

Thanks!

Hi,
Looks like the bitrate setting is too small so it cannot encode in larger q value. Please try to set QP range:

$ ./video_encode a.yuv 1920 1080 H264 a.h264 -br 4000000 -p baseline -rc cbr -ifi 30 --cd --report-metadata --input-metadata --eroi -roi roi.cfg -MinQpP 1 -MaxQpP 40 -MinQpI 1 -MaxQpI 40

In this case, it may not be able to obey 4Mbps setting.

If you have tool to check the qp value of macroblocks and you observe the macroblocks not be encoded with lower q value(-15 in the roi.cfg), please share the method so that we can check. We have other users using JP4.5 and they confirm the function is good. If you still hit the issue, would need to investigate where the deviation is from.

Hi @DaneLLL

Thanks for the post. I am trying to understand this a bit. A larger qp value would mean increased compression i.e. lower bit rate. So, by capping the MaxQp<I,P>, aren’t you forcing it to use more bits?

I am also uploading a file that was encoded using the Xilinx VCU (H264 encoder). This is what we are after but we would like to use the AGX to do the same. Here, the requested bitrate is 1mbps and the actual is 806kbps. As you can see that at 1600,540 a 128x128 region is given priority for encoding - see towards the right of the frame about halfway down. What settings in the AGX encoder would yield similar results?

Thank you!

Hi @DaneLLL

Did you get a chance to review the above?

Thank you!

Hi,
We have confirmed ROI encoding works on JP4.5. The region does have different q value. For video quality, please try to set CBR + Virtual buffer size. You can refer to this pipeline:
H264 vs H265 - #4 by DaneLLL

Hi @DaneLLL

I tried your suggestions but the ROI is still choppy. Is there a way to force the background to use the maximum QP and the ROI to use whatever the result is of using QPDelta?

For example, if I run the following command:

./encode traffic_1920x1080_420_8bit.yuv 1920 1080 H264 traffic_1920x1080_420_8bit.h264 -br 1000000 -p baseline -rc cbr -ifi 300 -idri 300 --cd -vbs 450000 --report-metadata --input-metadata --eroi -roi roi.cfg

with roi.cfg containing:

1 -15 1600 540 128 128

The output is as follows:

> Creating Encoder in blocking mode
Opening in BLOCKING MODE
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
875967048
842091865
H264: Profile = 66, Level = 51
NVMEDIA_ENC: bBlitMode is set to TRUE
EOF of ROI_param_file & rewind
Frame 0: isKeyFrame=1 AvgQP=44 MinQP=42 MaxQP=48 EncodedBits=275792
EOF of ROI_param_file & rewind
Frame 1: isKeyFrame=0 AvgQP=47 MinQP=47 MaxQP=50 EncodedBits=13904
EOF of ROI_param_file & rewind
Frame 2: isKeyFrame=0 AvgQP=47 MinQP=47 MaxQP=50 EncodedBits=17648
EOF of ROI_param_file & rewind
Frame 3: isKeyFrame=0 AvgQP=47 MinQP=47 MaxQP=50 EncodedBits=18760
EOF of ROI_param_file & rewind
Frame 4: isKeyFrame=0 AvgQP=47 MinQP=47 MaxQP=50 EncodedBits=19112
EOF of ROI_param_file & rewind
EOF of ROI_param_file & rewind
Frame 5: isKeyFrame=0 AvgQP=47 MinQP=47 MaxQP=50 EncodedBits=20776
EOF of ROI_param_file & rewind
Frame 6: isKeyFrame=0 AvgQP=49 MinQP=49 MaxQP=49 EncodedBits=17480
Frame 7: isKeyFrame=0 AvgQP=48 MinQP=48 MaxQP=49 EncodedBits=21552
EOF of ROI_param_file & rewind
Frame 8: isKeyFrame=0 AvgQP=48 MinQP=48 MaxQP=49 EncodedBits=21360
Frame 9: isKeyFrame=0 AvgQP=48 MinQP=48 MaxQP=49 EncodedBits=21616
EOF of ROI_param_file & rewind
Frame 10: isKeyFrame=0 AvgQP=47 MinQP=47 MaxQP=49 EncodedBits=25008
Frame 11: isKeyFrame=0 AvgQP=46 MinQP=46 MaxQP=48 EncodedBits=25656
EOF of ROI_param_file & rewind
Frame 12: isKeyFrame=0 AvgQP=46 MinQP=46 MaxQP=47 EncodedBits=22576
Frame 13: isKeyFrame=0 AvgQP=46 MinQP=46 MaxQP=47 EncodedBits=22304
EOF of ROI_param_file & rewind
Frame 14: isKeyFrame=0 AvgQP=46 MinQP=46 MaxQP=47 EncodedBits=24048
Frame 15: isKeyFrame=0 AvgQP=45 MinQP=45 MaxQP=46 EncodedBits=28576
EOF of ROI_param_file & rewind
Frame 16: isKeyFrame=0 AvgQP=45 MinQP=45 MaxQP=46 EncodedBits=26968
Frame 17: isKeyFrame=0 AvgQP=45 MinQP=45 MaxQP=46 EncodedBits=25080
EOF of ROI_param_file & rewind
Frame 18: isKeyFrame=0 AvgQP=44 MinQP=44 MaxQP=45 EncodedBits=36440
Frame 19: isKeyFrame=0 AvgQP=44 MinQP=44 MaxQP=44 EncodedBits=28128
EOF of ROI_param_file & rewind
Frame 20: isKeyFrame=0 AvgQP=44 MinQP=44 MaxQP=44 EncodedBits=28752
Frame 21: isKeyFrame=0 AvgQP=44 MinQP=44 MaxQP=44 EncodedBits=26432
EOF of ROI_param_file & rewind
Frame 22: isKeyFrame=0 AvgQP=44 MinQP=44 MaxQP=44 EncodedBits=27512
Frame 23: isKeyFrame=0 AvgQP=44 MinQP=44 MaxQP=44 EncodedBits=22496
EOF of ROI_param_file & rewind
Frame 24: isKeyFrame=0 AvgQP=43 MinQP=43 MaxQP=44 EncodedBits=35424
Frame 25: isKeyFrame=0 AvgQP=43 MinQP=43 MaxQP=43 EncodedBits=24832
EOF of ROI_param_file & rewind
Frame 26: isKeyFrame=0 AvgQP=43 MinQP=43 MaxQP=43 EncodedBits=22512
Frame 27: isKeyFrame=0 AvgQP=43 MinQP=43 MaxQP=43 EncodedBits=23552
EOF of ROI_param_file & rewind
Frame 28: isKeyFrame=0 AvgQP=42 MinQP=42 MaxQP=43 EncodedBits=33192
Frame 29: isKeyFrame=0 AvgQP=42 MinQP=42 MaxQP=42 EncodedBits=26256
EOF of ROI_param_file & rewind
Frame 30: isKeyFrame=0 AvgQP=42 MinQP=42 MaxQP=42 EncodedBits=25608
Frame 31: isKeyFrame=0 AvgQP=41 MinQP=41 MaxQP=42 EncodedBits=45616
EOF of ROI_param_file & rewind
Frame 32: isKeyFrame=0 AvgQP=41 MinQP=41 MaxQP=41 EncodedBits=32688
Frame 33: isKeyFrame=0 AvgQP=41 MinQP=41 MaxQP=41 EncodedBits=29320
EOF of ROI_param_file & rewind
Frame 34: isKeyFrame=0 AvgQP=42 MinQP=42 MaxQP=42 EncodedBits=18984
Frame 35: isKeyFrame=0 AvgQP=41 MinQP=41 MaxQP=41 EncodedBits=27192
EOF of ROI_param_file & rewind
Frame 36: isKeyFrame=0 AvgQP=41 MinQP=41 MaxQP=41 EncodedBits=22344
Frame 37: isKeyFrame=0 AvgQP=40 MinQP=40 MaxQP=40 EncodedBits=38976
EOF of ROI_param_file & rewind
Frame 38: isKeyFrame=0 AvgQP=40 MinQP=40 MaxQP=40 EncodedBits=22560
Frame 39: isKeyFrame=0 AvgQP=39 MinQP=38 MaxQP=40 EncodedBits=35312
EOF of ROI_param_file & rewind
Frame 40: isKeyFrame=0 AvgQP=39 MinQP=39 MaxQP=39 EncodedBits=54376
Frame 41: isKeyFrame=0 AvgQP=40 MinQP=40 MaxQP=40 EncodedBits=17048
EOF of ROI_param_file & rewind
Frame 42: isKeyFrame=0 AvgQP=40 MinQP=40 MaxQP=40 EncodedBits=22376
Frame 43: isKeyFrame=0 AvgQP=40 MinQP=39 MaxQP=41 EncodedBits=19456
EOF of ROI_param_file & rewind
Frame 44: isKeyFrame=0 AvgQP=39 MinQP=39 MaxQP=40 EncodedBits=23360
Frame 45: isKeyFrame=0 AvgQP=39 MinQP=37 MaxQP=40 EncodedBits=44336
EOF of ROI_param_file & rewind
Frame 46: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=39 EncodedBits=41112
Frame 47: isKeyFrame=0 AvgQP=37 MinQP=36 MaxQP=39 EncodedBits=56400
EOF of ROI_param_file & rewind
Frame 48: isKeyFrame=0 AvgQP=39 MinQP=39 MaxQP=39 EncodedBits=21952
Frame 49: isKeyFrame=0 AvgQP=40 MinQP=40 MaxQP=40 EncodedBits=14288
EOF of ROI_param_file & rewind
Frame 50: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=40 EncodedBits=24072
Frame 51: isKeyFrame=0 AvgQP=38 MinQP=37 MaxQP=40 EncodedBits=37072
EOF of ROI_param_file & rewind
Frame 52: isKeyFrame=0 AvgQP=37 MinQP=36 MaxQP=39 EncodedBits=42520
Frame 53: isKeyFrame=0 AvgQP=37 MinQP=35 MaxQP=38 EncodedBits=42840
EOF of ROI_param_file & rewind
Frame 54: isKeyFrame=0 AvgQP=38 MinQP=36 MaxQP=39 EncodedBits=22384
Frame 55: isKeyFrame=0 AvgQP=38 MinQP=37 MaxQP=40 EncodedBits=23736
EOF of ROI_param_file & rewind
Frame 56: isKeyFrame=0 AvgQP=38 MinQP=37 MaxQP=40 EncodedBits=29376
Frame 57: isKeyFrame=0 AvgQP=37 MinQP=36 MaxQP=39 EncodedBits=37552
EOF of ROI_param_file & rewind
Frame 58: isKeyFrame=0 AvgQP=37 MinQP=35 MaxQP=38 EncodedBits=48480
Frame 59: isKeyFrame=0 AvgQP=37 MinQP=35 MaxQP=38 EncodedBits=30304
EOF of ROI_param_file & rewind
Frame 60: isKeyFrame=0 AvgQP=36 MinQP=35 MaxQP=38 EncodedBits=30888
Frame 61: isKeyFrame=0 AvgQP=37 MinQP=35 MaxQP=38 EncodedBits=37824
EOF of ROI_param_file & rewind
Frame 62: isKeyFrame=0 AvgQP=36 MinQP=35 MaxQP=38 EncodedBits=28168
Frame 63: isKeyFrame=0 AvgQP=36 MinQP=34 MaxQP=37 EncodedBits=56072
EOF of ROI_param_file & rewind
Frame 64: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=29784
Frame 65: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=18232
EOF of ROI_param_file & rewind
Frame 66: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=38 EncodedBits=36648
Frame 67: isKeyFrame=0 AvgQP=35 MinQP=34 MaxQP=37 EncodedBits=58040
EOF of ROI_param_file & rewind
Frame 68: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=41904
Frame 69: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=22016
EOF of ROI_param_file & rewind
Frame 70: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=19352
Frame 71: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=19920
EOF of ROI_param_file & rewind
Frame 72: isKeyFrame=0 AvgQP=37 MinQP=36 MaxQP=38 EncodedBits=31144
Frame 73: isKeyFrame=0 AvgQP=36 MinQP=35 MaxQP=37 EncodedBits=41208
EOF of ROI_param_file & rewind
Frame 74: isKeyFrame=0 AvgQP=35 MinQP=33 MaxQP=36 EncodedBits=64784
Frame 75: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=36272
EOF of ROI_param_file & rewind
Frame 76: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=23136
Frame 77: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=30752
EOF of ROI_param_file & rewind
Frame 78: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=30656
Frame 79: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=22928
EOF of ROI_param_file & rewind
Frame 80: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=31016
Frame 81: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=29784
EOF of ROI_param_file & rewind
Frame 82: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=38 EncodedBits=23680
Frame 83: isKeyFrame=0 AvgQP=36 MinQP=35 MaxQP=37 EncodedBits=43584
EOF of ROI_param_file & rewind
Frame 84: isKeyFrame=0 AvgQP=36 MinQP=35 MaxQP=37 EncodedBits=28448
Frame 85: isKeyFrame=0 AvgQP=36 MinQP=34 MaxQP=37 EncodedBits=42176
EOF of ROI_param_file & rewind
Frame 86: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=52072
Frame 87: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=23960
EOF of ROI_param_file & rewind
Frame 88: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=27376
Frame 89: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=29840
EOF of ROI_param_file & rewind
Frame 90: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=21496
Frame 91: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=43200
EOF of ROI_param_file & rewind
Frame 92: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=41312
Frame 93: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=24000
EOF of ROI_param_file & rewind
Frame 94: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=38 EncodedBits=19968
Frame 95: isKeyFrame=0 AvgQP=37 MinQP=36 MaxQP=39 EncodedBits=25552
EOF of ROI_param_file & rewind
Frame 96: isKeyFrame=0 AvgQP=36 MinQP=35 MaxQP=38 EncodedBits=28232
Frame 97: isKeyFrame=0 AvgQP=36 MinQP=35 MaxQP=38 EncodedBits=37152
EOF of ROI_param_file & rewind
Frame 98: isKeyFrame=0 AvgQP=35 MinQP=34 MaxQP=37 EncodedBits=39392
Frame 99: isKeyFrame=0 AvgQP=35 MinQP=33 MaxQP=36 EncodedBits=50344
EOF of ROI_param_file & rewind
Frame 100: isKeyFrame=0 AvgQP=36 MinQP=34 MaxQP=37 EncodedBits=19256
Frame 101: isKeyFrame=0 AvgQP=36 MinQP=35 MaxQP=38 EncodedBits=26328
EOF of ROI_param_file & rewind
Frame 102: isKeyFrame=0 AvgQP=36 MinQP=35 MaxQP=38 EncodedBits=33328
Frame 103: isKeyFrame=0 AvgQP=35 MinQP=34 MaxQP=37 EncodedBits=33496
EOF of ROI_param_file & rewind
Frame 104: isKeyFrame=0 AvgQP=35 MinQP=33 MaxQP=36 EncodedBits=47688
Frame 105: isKeyFrame=0 AvgQP=35 MinQP=33 MaxQP=36 EncodedBits=33184
EOF of ROI_param_file & rewind
Frame 106: isKeyFrame=0 AvgQP=35 MinQP=33 MaxQP=36 EncodedBits=31016
Frame 107: isKeyFrame=0 AvgQP=35 MinQP=33 MaxQP=36 EncodedBits=30976
EOF of ROI_param_file & rewind
Frame 108: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=56664
Frame 109: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=38864
EOF of ROI_param_file & rewind
Frame 110: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=34648
Frame 111: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=21224
EOF of ROI_param_file & rewind
Frame 112: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=28056
Frame 113: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=42584
EOF of ROI_param_file & rewind
Frame 114: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=33704
Frame 115: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=31792
EOF of ROI_param_file & rewind
Frame 116: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=29800
Frame 117: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=32080
EOF of ROI_param_file & rewind
Frame 118: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=30360
Frame 119: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=33000
EOF of ROI_param_file & rewind
Frame 120: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=32320
Frame 121: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=29448
EOF of ROI_param_file & rewind
Frame 122: isKeyFrame=0 AvgQP=34 MinQP=33 MaxQP=35 EncodedBits=32840
Frame 123: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=35032
EOF of ROI_param_file & rewind
Frame 124: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=33256
Frame 125: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=33464
EOF of ROI_param_file & rewind
Frame 126: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=31960
Frame 127: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=40800
EOF of ROI_param_file & rewind
Frame 128: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=33792
Frame 129: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=31384
EOF of ROI_param_file & rewind
Frame 130: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=29016
Frame 131: isKeyFrame=0 AvgQP=34 MinQP=33 MaxQP=35 EncodedBits=32888
EOF of ROI_param_file & rewind
Frame 132: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=35024
Frame 133: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=28104
EOF of ROI_param_file & rewind
Frame 134: isKeyFrame=0 AvgQP=34 MinQP=33 MaxQP=35 EncodedBits=35576
Frame 135: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=34120
EOF of ROI_param_file & rewind
Frame 136: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=31928
Frame 137: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=33808
EOF of ROI_param_file & rewind
Frame 138: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=37280
Frame 139: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=29552
EOF of ROI_param_file & rewind
Frame 140: isKeyFrame=0 AvgQP=34 MinQP=33 MaxQP=35 EncodedBits=30056
Frame 141: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=36088
EOF of ROI_param_file & rewind
Frame 142: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=34280
Frame 143: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=30896
EOF of ROI_param_file & rewind
Frame 144: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=36184
Frame 145: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=29272
EOF of ROI_param_file & rewind
Frame 146: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=39088
Frame 147: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=29112
EOF of ROI_param_file & rewind
Frame 148: isKeyFrame=0 AvgQP=34 MinQP=33 MaxQP=35 EncodedBits=33344
Frame 149: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=34864
EOF of ROI_param_file & rewind
Frame 150: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=30272
Frame 151: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=34264
EOF of ROI_param_file & rewind
Frame 152: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=34160
Frame 153: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=32448
EOF of ROI_param_file & rewind
Frame 154: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=32824
Frame 155: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=33984
EOF of ROI_param_file & rewind
Frame 156: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=35496
Frame 157: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=34448
EOF of ROI_param_file & rewind
Frame 158: isKeyFrame=0 AvgQP=34 MinQP=34 MaxQP=35 EncodedBits=30712
Frame 159: isKeyFrame=0 AvgQP=34 MinQP=33 MaxQP=35 EncodedBits=32080
EOF of ROI_param_file & rewind
Frame 160: isKeyFrame=0 AvgQP=34 MinQP=32 MaxQP=35 EncodedBits=36104
Frame 161: isKeyFrame=0 AvgQP=34 MinQP=33 MaxQP=35 EncodedBits=46360
EOF of ROI_param_file & rewind
Frame 162: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=41040
Frame 163: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=33712
EOF of ROI_param_file & rewind
Frame 164: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=22400
Frame 165: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=21608
EOF of ROI_param_file & rewind
Frame 166: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=37 EncodedBits=29672
Frame 167: isKeyFrame=0 AvgQP=34 MinQP=33 MaxQP=36 EncodedBits=40160
EOF of ROI_param_file & rewind
Frame 168: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=35328
Frame 169: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=34824
EOF of ROI_param_file & rewind
Frame 170: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=34600
Frame 171: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=37432
EOF of ROI_param_file & rewind
Frame 172: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=34224
Frame 173: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=30232
EOF of ROI_param_file & rewind
Frame 174: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=35864
Frame 175: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=29936
EOF of ROI_param_file & rewind
Frame 176: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=33960
Frame 177: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=30800
EOF of ROI_param_file & rewind
Frame 178: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=39208
Frame 179: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=37944
EOF of ROI_param_file & rewind
Frame 180: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=32992
Frame 181: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=24496
EOF of ROI_param_file & rewind
Frame 182: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=29440
Frame 183: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=59320
EOF of ROI_param_file & rewind
Frame 184: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=37112
Frame 185: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=47360
EOF of ROI_param_file & rewind
Frame 186: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=19376
Frame 187: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=22880
EOF of ROI_param_file & rewind
Frame 188: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=33040
Frame 189: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=37 EncodedBits=42320
EOF of ROI_param_file & rewind
Frame 190: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=63280
Frame 191: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=35472
EOF of ROI_param_file & rewind
Frame 192: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=30952
Frame 193: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=22216
EOF of ROI_param_file & rewind
Frame 194: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=24520
Frame 195: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=31888
EOF of ROI_param_file & rewind
Frame 196: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=32944
Frame 197: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=29344
EOF of ROI_param_file & rewind
Frame 198: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=22552
Frame 199: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=22880
EOF of ROI_param_file & rewind
Frame 200: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=38536
Frame 201: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=51416
EOF of ROI_param_file & rewind
Frame 202: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=34896
Frame 203: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=28016
EOF of ROI_param_file & rewind
Frame 204: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=27520
Frame 205: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=37 EncodedBits=30584
EOF of ROI_param_file & rewind
Frame 206: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=48960
Frame 207: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=26040
EOF of ROI_param_file & rewind
Frame 208: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=27368
Frame 209: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=45360
EOF of ROI_param_file & rewind
Frame 210: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=36136
Frame 211: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=35 EncodedBits=42192
EOF of ROI_param_file & rewind
Frame 212: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=29432
Frame 213: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=23088
EOF of ROI_param_file & rewind
Frame 214: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=20832
Frame 215: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=37 EncodedBits=24440
EOF of ROI_param_file & rewind
Frame 216: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=58720
Frame 217: isKeyFrame=0 AvgQP=34 MinQP=34 MaxQP=35 EncodedBits=71720
EOF of ROI_param_file & rewind
Frame 218: isKeyFrame=0 AvgQP=34 MinQP=34 MaxQP=34 EncodedBits=48008
Frame 219: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=25192
EOF of ROI_param_file & rewind
Frame 220: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=19056
Frame 221: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=19600
EOF of ROI_param_file & rewind
Frame 222: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=38 EncodedBits=36144
Frame 223: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=41064
EOF of ROI_param_file & rewind
Frame 224: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=37 EncodedBits=37344
Frame 225: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=37152
EOF of ROI_param_file & rewind
Frame 226: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=19912
Frame 227: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=14632
EOF of ROI_param_file & rewind
Frame 228: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=38 EncodedBits=22328
Frame 229: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=38 EncodedBits=44072
EOF of ROI_param_file & rewind
Frame 230: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=37 EncodedBits=43792
Frame 231: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=35752
EOF of ROI_param_file & rewind
Frame 232: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=18504
Frame 233: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=15208
EOF of ROI_param_file & rewind
Frame 234: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=24528
Frame 235: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=37 EncodedBits=38488
EOF of ROI_param_file & rewind
Frame 236: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=27080
Frame 237: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=42528
EOF of ROI_param_file & rewind
Frame 238: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=28408
Frame 239: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=28224
EOF of ROI_param_file & rewind
Frame 240: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=27696
Frame 241: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=29984
EOF of ROI_param_file & rewind
Frame 242: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=37408
Frame 243: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=28256
EOF of ROI_param_file & rewind
Frame 244: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=49120
Frame 245: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=29248
EOF of ROI_param_file & rewind
Frame 246: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=42648
Frame 247: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=36 EncodedBits=50792
EOF of ROI_param_file & rewind
Frame 248: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=39624
Frame 249: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=20160
EOF of ROI_param_file & rewind
Frame 250: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=19592
Frame 251: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=28896
EOF of ROI_param_file & rewind
Frame 252: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=38 EncodedBits=38472
Frame 253: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=38 EncodedBits=30552
EOF of ROI_param_file & rewind
Frame 254: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=31240
Frame 255: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=36864
EOF of ROI_param_file & rewind
Frame 256: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=22944
Frame 257: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=29944
EOF of ROI_param_file & rewind
Frame 258: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=30128
Frame 259: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=38064
EOF of ROI_param_file & rewind
Frame 260: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=44752
Frame 261: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=40400
EOF of ROI_param_file & rewind
Frame 262: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=25120
Frame 263: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=28160
EOF of ROI_param_file & rewind
Frame 264: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=18656
Frame 265: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=38 EncodedBits=28720
EOF of ROI_param_file & rewind
Frame 266: isKeyFrame=0 AvgQP=35 MinQP=35 MaxQP=38 EncodedBits=33664
Frame 267: isKeyFrame=0 AvgQP=35 MinQP=34 MaxQP=36 EncodedBits=33120
EOF of ROI_param_file & rewind
Frame 268: isKeyFrame=0 AvgQP=35 MinQP=34 MaxQP=36 EncodedBits=33136
Frame 269: isKeyFrame=0 AvgQP=35 MinQP=33 MaxQP=36 EncodedBits=30896
EOF of ROI_param_file & rewind
Frame 270: isKeyFrame=0 AvgQP=35 MinQP=34 MaxQP=36 EncodedBits=41664
Frame 271: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=34568
EOF of ROI_param_file & rewind
Frame 272: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=42744
Frame 273: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=36 EncodedBits=33848
EOF of ROI_param_file & rewind
Frame 274: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=38464
Frame 275: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=38824
EOF of ROI_param_file & rewind
Frame 276: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=33160
Frame 277: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=26656
EOF of ROI_param_file & rewind
Frame 278: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=23064
Frame 279: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=38 EncodedBits=30232
EOF of ROI_param_file & rewind
Frame 280: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=38 EncodedBits=59136
Frame 281: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=45728
EOF of ROI_param_file & rewind
Frame 282: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=19360
Frame 283: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=23824
EOF of ROI_param_file & rewind
Frame 284: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=23808
Frame 285: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=27184
EOF of ROI_param_file & rewind
Frame 286: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=38 EncodedBits=36728
Frame 287: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=38312
EOF of ROI_param_file & rewind
Frame 288: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=53304
Frame 289: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=21968
EOF of ROI_param_file & rewind
Could not read complete frame from input file
Frame 290: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=25568
File read complete.
Frame 291: isKeyFrame=0 AvgQP=38 MinQP=38 MaxQP=38 EncodedBits=32600
Frame 292: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=38 EncodedBits=28216
Frame 293: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=49944
Frame 294: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=35680
Frame 295: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=29408
Frame 296: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=37520
Frame 297: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=27320
Frame 298: isKeyFrame=0 AvgQP=37 MinQP=37 MaxQP=37 EncodedBits=38224
Frame 299: isKeyFrame=0 AvgQP=36 MinQP=36 MaxQP=37 EncodedBits=60080
Got 0 size buffer in capture
App run was successful

And I see the same behavior i.e. the ROI region does not update. If I reduce ifi, it will update that region but every i-frame. So, a couple of questions:

  • Why isn’t the encoder using a higher QP value for the rest of the frame (why use around 37) if the issue really is that the bitrate is not high enough for it to encode the ROI properly?

  • Is there a way to force the background i.e. non-ROI region to use the maximum QP possible and have the ROI use the resulting QP based on QPDelta?

Thank you!

Hi,
For further clarification, we would need your help to provide a software that can show QP value of the blocks and confirm it is not updated per user setting. We have checked internally and confirmed the user setting has been applied. A bit strange you don’t see it take effect. If you can provide a tool that shows the issue, we can follow the steps to replicate the issue and check with our teams.