Omxh264enc not work, when profile set to main or high, and number-B-Frames set to 1 or 2

Hi All
In r32.2, I found a problem I want to use omxh264enc enable B frame, when I set omxh264enc profile=(main or high) number-B-Frames=2 , pipeline can’t work, but when I set omxh264enc profile=baseline number-B-Frames=2, it can work. if I change jetpack version to r28, omxh264enc profile=main/high number-B-Frames=2 can work

There is error information

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 100, Level = 40
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Caught SIGSEGV
#0 0x0000007f7bf01048 in __GI___poll (fds=0x558ed3efa0, nfds=547541283248, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:41
#1 0x0000007f7c00ed80 in () at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#2 0x000000558ecaf2d0 in ()
Spinning. Please run 'gdb gst-launch-1.0 8057' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

High and main profile can support B frame

https://en.wikipedia.org/wiki/Advanced_Video_Coding#Profiles

Can you tell me why I can not use number-B-Frames on Main and high profile?

Hi,
PLease try nvv4l2h264enc

$ gst-launch-1.0 videotestsrc num-buffers=100 ! video/x-raw,width=1920,height=1080 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvv4l2h264enc cabac-entropy-coding=1 num-B-Frames=1 ! 'video/x-h264,profile=high,stream-format=byte-stream' ! h264parse ! qtmux ! filesink location=a.mp4

There is a known issue about setting num-B-Frames=2. Please check the post.

Hi DaneLLL
When I use nvv4l2h264enc element, CABAC and B frame can work. thanks for your help.

But now I found a new problem, I cann’t use CAVLC in high or main profile on nvv4l2h264enc element

gst-launch-1.0 videotestsrc num-buffers=100 ! "video/x-raw,width=1920, height=1080" ! nvvidconv ! "video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=NV12" ! nvv4l2h264enc num-B-Frames=1 bitrate=8000000 preset-level=4 profile=2 insert-sps-pps=true cabac-entropy-coding=0 ! "video/x-h264, stream-format=byte-stream" ! h264parse ! qtmux ! filesink location=main_test.mp4
gst-launch-1.0 videotestsrc num-buffers=100 ! "video/x-raw,width=1920, height=1080" ! nvvidconv ! "video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=NV12" ! nvv4l2h264enc num-B-Frames=1 bitrate=8000000 preset-level=4 profile=4 insert-sps-pps=true cabac-entropy-coding=0 ! "video/x-h264, stream-format=byte-stream" ! h264parse ! qtmux ! filesink location=high_test.mp4

I use gst-rtsp-server to send stream, then use wireshark to get pps value, and found always enable CABAC. please check it.

Hi,
It seems not expected. We will check and update.

Hi, please try the attachment.
r32_2_TEST_libtegrav4l2.zip (76.3 KB)