The camera I am recording video with occasionally drops frames, so I need to reinsert frames into the video to keep the timing precise.
I already have a script to identify exactly when those frames were dropped, so I have an index of every frame that needs to be inserted and where.
For example, in a 100 s video at 100 FPS, I should have 10,000 frames. However, 4 frames were dropped at frame 399, 1205, 4299, and 7891. So, I want to either insert a black frame at the same resolution at those spots, or hold the previous frame for exactly one frame (e.g. hold frame 398 for an extra frame, or 0.01 s).
Is there a way to do this iteratively in FFMPEG? I am currently writing the video into its constituent frames, adding in my blank images, then re-concatenating the video from the frames, which is a very inefficient process.