Encoding interval and initial frame for i-frames and IDR

I’m using jetson multimedia jetpack with example “01 encoder”.
there are 2 optional properties:
-ifi I-frame Interval [Default = 30]|
-idri IDR Interval [Default = 256]|

We want to set initial frame from which the interval will start.
for example somehow to set:
-ifi 30 -idri 300 -initial-i-frame 15 -initial-idr 120
frames: 15,45,75… will be I-frames.

I also tried to use -rpc “f20,i1;f35,i1”
it indeed added i-frames (maybe IDR - not sure) at some frames (N-4 for some reason).
but when using -ifi the interval started from the first frame and not from the one I set with -rpc.

  1. Is there a way to determine which frame will be the initial frame for i-frame and IDR?
  2. does -rpc set i-frame or IDR?


For setting -ifi 30 -idri 300, IDR frames are at 0th, 300th, 600th, … and I frames are at 30th, 60th, 90th, …

You can set -rpc to re-start the IDR interval. If you see IDR frame re-starts at 146th, IDR frames will be at 446th, 746th, … and I frames will be at 476th, 506th, …
IDR/I frame interval still follows initial setting.

Thanks for the quick reply.

It seems that -ifi and -idri always start their interval from the first frame.
When adding -rpc “fxx,i1” it does adds another IDR frame at xx position, but the interval still refers to the first frame.
I expect 446 746, but get 300 600 900 + 146 (set by the -rpc)
In addition the xx frame is not the IDR frame, for some reason it xx-4, so if I set -rpc 146, it makes frame 142 IDR.

  1. is the last part a bug or on purpose?
  2. is there a way to set “initial frame” for I-frame?
  3. is there a way to make IDR initial frame and following interval IDR frames work as you described?


ctx->enc->forceIDR() is called but may not take effect in specified frame number. It is possible to have shift.

Looks like you need IDR at 0, 300, 600,… and I frames at 15, 45, 75,… The case is not supported.

We don’t give correct behavior in previous comment. Will fix it. Sorry for making confusion. So this case is not supported. You can insert IDR frames at some time but the initial setting still takes effect.