Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.48k stars 1.56k forks source link

is it possible to replace a single frame in the middle of a video? #1636

Open verbose-void opened 3 years ago

verbose-void commented 3 years ago

let's say i have a video that is 1920x1080 consisting of 10,000 frames all of which have only white pixel values compressed with mpeg-4 (this file size will be tiny).

is it possible to fill in frames randomly with moviepy? for example, maybe i want to set frame 1,000 to be a real image.

is this sort of thing even possible with video compressors?

T-Bacon1 commented 3 years ago

Just as an idea, you can use subclip(), extract a video with a length of (duration/fps) to get one frame, then set that subclip to the image you want, then concatenate the whole thing back together.

verbose-void commented 3 years ago

that's also what i was thinking -- was hoping to avoid that, but that would work