How to specify the number of IDR interval with GStreamer?


#1

I want to control the IDR interval in order to improve the random accessibility of the output H.264 stream.

However, it can not be controlled with gop_size etc. It seems that IDR is always inserted every 708 frames.
How to specify the number of IDR interval with GStreamer?


#2

I assume you refer to hardware encoding via v4l2. Today IDR customization does not offer interface (v4l2-ctrls) and is therefore statically configured. If this is something you need now, I suggest you to edit the driver (drivers/media/platform/qcom/venus/venc.c : venc_set_properties()). You will need to change the idrp.idr_period variable with one of the following values:

n = 0 - only the first I-frame is IDR frame
n = 1 - all I-frames will be IDR frames
n > 1 - every n-th I-frame will be IDR frame


#3

I am always grateful for your help.
I see and I found the point I should change the code.
I’d like to try it.