Nvv4l2h264enc emit I frames

Hello,
On the nvv4l2h264enc gstreamer plugin, is there a way for the gstreamer plugin/pipeline to emit a signal when an I frame is generated by the encoder. I looked thru the properties exposed by this plugin and nothing seems to correlate to this.

Failing this, is there some way to setup the encoder so that the size of the frames would correlate (strongly) with an I frame

Thanks
Victor

Hi,

the nvv4l2h264enc itself does not emit any signal for NAL units, so you can evaluate the NAL units into the GStreamer application or creating a custom GStreamer Element that triggers a signal for each I frame.

You can control IDR interval using iframeinterval property into nvv4l2h264enc (See below validation).

Regards
Angel

gst-launch-1.0 videotestsrc num-buffers=100 !  nvvideoconvert ! nvv4l2h264enc iframeinterval=3  ! h264parse ! fakesink --gst-debug=*h264parse*:8
0:00:00.216927702  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 7 SPS, size 9
0:00:00.217294702  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 8 PPS, size 4
0:00:00.217605866  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 5 Slice IDR, size 8371
0:00:00.219581188  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 1 Slice, size 7161
0:00:00.220241435  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 1 Slice, size 7184
0:00:00.220906473  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 5 Slice IDR, size 9532
0:00:00.221505518  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 1 Slice, size 7566
0:00:00.223057171  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 1 Slice, size 7607
0:00:00.224524495  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 5 Slice IDR, size 9512
0:00:00.226403770  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 1 Slice, size 7466
0:00:00.228368051  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 1 Slice, size 7536
0:00:00.230416763  1442   0x558fa95230 DEBUG              h264parse gsth264parse.c:722:gst_h264_parse_process_nal:<h264parse0> processing nal of type 5 Slice IDR, size 9558