If you interested in the IDR, I suggest that you use unit test to test encoder first, you can set the -g to set gopsize, if the result is what you need, then you can change your own source code according to the unit test encoder source code.
refer to the vpu api linux RM, you can set gopsize,gopSize is the GOP size where 0 = only first picture is I, 1 = all I pictures, 2 = IPIP, 3 = IPPIPP, and so on. The maximum
value is 32,767, but in practice, a smaller value should be chosen by the application for proper error concealment. This value is ignored for STD_MJPG.
Retrieving data ...