python

Cut a portion of a video using moviepy

# pip install moviepy
# pip install imageio-ffmpeg

from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip

ffmpeg_extract_subclip("path/to/full/video.mp4", 30, 100, targetname="path/to/final/video.mp4")
# 30 - start second
# 100 - end second

To get a portion of the video in python, you can use moviepy package of python. To install the requirements run below commands

pip install moviepy
pip install imageio-ffmpeg

Now you can use moviepy function ffmpeg_extract_subclip to cut the clip and save to a location.

Was this helpful?