How to encode only IDR Frame with nvv4l2h264enc?

I would like to encode H264 file with only IDR Frame.and I set the pipeline like this:

appsrc name=appsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! nvvideoconvert ! video/x-raw(memory:NVMM), format=NV12, width=1920, height=1080,framerate=(fraction)30/1 ! nvv4l2h264enc control-rate=constant_bitrate bitrate=24000000 iframeinterval=0 profile=0  maxperf-enable=true  insert-sps-pps=true insert-vui=true ! appsink name=appsink

but it seem not enough. I can not found the option idrinterval.
And my nvv4l2h264enc version is 1.14,how can I use:

Element Actions:
  "force-IDR" :  void user_function (GstElement* object);
1 Like

The option is demonstrated in 01_video_encode:

        --alliframes          Enable all I-frame encoding [Default = disabled]

It is not in nvv4l2h264enc plugin. You may refer to 01_video_encode, apply it to source of gst-v4l2, and rebuild/replace:


All source code are in
Jetson Linux | NVIDIA Developer
[L4T Driver Package (BSP) Sources]

If you use previous release, please go to
L4T Archive | NVIDIA Developer

Thanks for your reply.I can not found the alliframes option from 01_video_encode. Can you send me a link to download the sample? Is 01_video_encode the nvv4l2 sample?

Please check if you see the sample in


If not, please install the samples through SDKManager