How can I efficiently cut out part of a video?

Try this and tell us if it is faster (if it can, it will extract the video directly using ffmpeg, without decoding and reencoding):

from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
ffmpeg_extract_subclip("video1.mp4", start_time, end_time, targetname="test.mp4")

If that doesn’t help, have a look at the code

Leave a Comment