Gstreamer: H264 Encoder Bug: gstv4l2h264enc.h: -num-B-Frames is set to boolean instead int

There is a bug on gstv4l2h264enc.h (Sha1: aad4feb4d2a497ebdc8472ac1638af44fc830b3b, Mar 10 2019)

Line 48: gboolean nBFrames;

nBFrames is declared as boolean rather than a numeric type, disallowing to setup B Frames into the v412h264enc element

We will fix the typo. gst-v4l2 is open source code. You may fix it and rebuild to revive the property.

Thanks, Dane,

I did rebuild it, and it worked.

Question: I saw that the source was under a directory called “public,” but this was available once I registered as a developer, I didn’t know nVidia considered this code as OpenSource; In this the case, where we can submit our patches? What is the contact of the moderator(s)? Or I’m allowed to fork this project in GitHub?

The code is public but we maintain commit history internally. If you find issues or want to make feature request, please make a post. You may also share us your patches along with the post.

I will Dane.

Attached is the patched files to correct the option -num-B-Frames on gstv4l2h264enc

gstv4l2h264enc_(option -num-B-Frames_fixed).zip (5.93 KB)

The setting of num-B frames is working, however there is a problem on the timestamps. It appears that the encoder is setting the display timestamps the same as the decoder timestamps.

A strict player will show the lack of proper order of each frame i.e. IPbbPbbPbb… instead of IbbPbbPbb… (Other players will skip one of the b frames and it might looks like if the video is 18fps )

This issue is not happening on the 02_video_encoder sample.

Do you want me to create a new post?


Yes. Please make a new post to share steps of reproducing the issue. Thanks.