Trim a video with ffmpeg and moviepy

With this script you can easily trim a video.

from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
import glob


# Get the second you do not want in the movie
files = glob.glob("*.mp4")
print([(n, f) for n, f in enumerate(files)])
filenumber = int(input("File number: "))
start = int(input("Start: "))
end = int(input("End: "))
ffmpeg_extract_subclip(
    files[filenumber], start, end, targetname="output_selected.mp4")

Subscribe to the newsletter for updates
Tkinter templates
Avatar My youtube channel

Twitter: @pythonprogrammi - python_pygame

Videos

Speech recognition game

Pygame's Platform Game

Other Pygame's posts

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.