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?
Similar Posts
- Join two videos using moviepy in Python
- Install dependencies using pip from requirement.txt file in Python
- [Python] Using comprehension expression to convert list of dictionaries to nested dictionary
- [Python] Create a list of objects using class names
- [Python] Get nodeid, module, function name using Pytest request built-in fixture
- [Python] Using inspect.stack() to get module name, path, function name
- How to install packages using pip according to the requirements.txt file from a local directory?