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:
video_0.avi
: Frames 0 toM-1
video_1.avi
: FramesM
to2M-1
video_2.avi
: Frames2M
to3M-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