Split video file into chunks using FFMPEG and exact number of frames

I am trying to split a video video.avi (with N being the total number of frames) into contiguous chunks according to a fixed number of frames (say M = 100).
Specifically this process should yield:

  1. video_0.avi: Frames 0 to M-1
  2. video_1.avi: Frames M to 2M-1
  3. video_2.avi: Frames 2M to 3M-1

It is important that each chunk video_*.avi has exactly M frames. Therefore, the last chunk can be discarded if N is not divisible by M.

I found related issues (e.g. Split video file into pieces with ffmpeg) but find myself struggling to replace the specification in seconds with the number of frames.

Read more here: Source link