Replace video frames with png image using ffmpeg

I have a folder with list of png images named as following format {frameno}.png

Example: 1.png, 42.png, 618.png, etc.

I need to replace only these frames in original video while keeping the video intact, how can I achieve this with ffmpeg utility?


Follow on question: Is it possible to accept a txt/csv/json file that can tell how many times a png needs to be repeated as frame?

If this requires some coding, I would appreciate some snippet in python.


PS: If that matters, I have these png with OCR text as boundary box, that I need to overlay on the original video along with some profanity check.

Read more here: Source link