Python Cutting/trim out a portion of video

Table of Content

Python Cutting/trim out a portion of video

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

start_time, end_time in second

Ex:

from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip

# Cut out from 02:25 to 04:32
ffmpeg_extract_subclip("TrienLam_HaNoi_2020.mp4", 145, 272, targetname="Thuyloi_BenTre.mp4")

Leave a Reply

Your email address will not be published.