New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
H.264 encoder: SIGFPE in intel_mfc_brc_postpack_vbr #215
Comments
From #6, i assumed you were running MediaSDK with open source VAAPI driver. by now they do not work together. Please contact MediaSDK team and ask the help. |
What? No, I'm not using Media SDK. |
This is a bit odd - it looks like you've somehow ended up in VBR mode with a target bitrate of zero (hence integer divide by zero -> SIGFPE). Can you print the content of mfc_context->brc after the exception there? It would also be interesting to know what happened before that point - is this the first frame? |
Aha, I think I see the problem. Have you told the rate controller that you aren't going to use any B-frames (ip_period == 1), but then are encoding a B-frame? The rate controller will have allocated zero bits to B-frames, which then gives the divide by zero here. |
FWIW, I run with constant quantizer (so target bitrate shouldn't matter). My ip_period is 3, and I should communicate this down. My code is based on the H.264 encoder example; you can see it here: IIRC it's complaining about wrong frame order at the very start, but so did the example. :-) I can get the debugging information you requested later today; not at the right machine right now. |
@sesse Aha, sorry. i mixed it. :( The inpu RC mode is CQP and the call stack show it run into the VBR mode. i can not open the link. it show the error. |
I edit the comment to fix the links; please try again. |
Do you set the rc_mode with value -1 defaultly? if so, the VBR mode will be assigned. 881 if (attrib[VAConfigAttribRateControl].value != VA_ATTRIB_NOT_SUPPORTED) { |
Look at lines 889–891; it goes through the list of available modes (where CQP has first priority in the array) and assigns the first one that works. So the rc_mode should be CQP, unless VA-API stops advertising it (which I haven't checked). |
@sesse 1.7.3 doesn't support VBR so CQP has first priority, but 1.8.0+ supports VBR, so VBR has first priority now, you should provide right VBR related parameters or change the array. |
Ah. I should just hard-code CQP, but that explains it. I'll keep the bug open until I can verify it fixes the issue. |
You're right, hard-coding CQP works. Thanks for the investigation! |
@sesse, I'd like to avoid SIGFPE for VBR in the driver. I see bitrate, intra_period, ip_period and target_percentage are all set in your code, it seems it is impossible that mfc_context->brc.target_frame_size[0][slice_type] is 0. I also tried the H.264 encoder example and it works fine for me. Could you help to debug why mfc_context->brc.target_frame_size[0][slice_type] is 0 in your case? |
@xhaihao Most likely the SIGFPE is because I never set a bitrate, yet asked for VBR by accident. It's an invalid configuration, which I've fixed on my side (since I never wanted to use VBR in the first place). So this bug can be closed. |
I saw you set bitrate in the following code, did I misread something?
|
Hm, well, that's odd, yes. I'm unfortunately a bit busy with other things this week, but I can try to answer your question next week? If not, you can download and compile Nageru yourself; 1.6.0 and older should show the issue. |
the reporter has fixed the invalid configuration. In addition, intel_mfc_brc_postpack_vbr is not used for new media kernels. |
Forwarding a bug report from @sesse we received in the Debian BTS #866512:
This crash occurs with 1.8.2 and 1.8.3.
The text was updated successfully, but these errors were encountered: