Here’s the code to grab some seconds from an mp4 video and save them as a new file with Python. This could be a start to work on a video and grab only the best part of it. You need to install the free software ffmpeg. Check in my posts to see how. Python just asks you to input the file and the seconds of the start and the end.
import os, glob from tkinter import filedialog import tkinter as tk root = tk.Tk() root.filename = filedialog.askopenfilename(initialdir=".", title="Select file", filetypes=(("jpeg files", "*.mp4"), ("all files", "*.*"))) if root.filename == "": root.destroy() print(root.filename) name = root.filename print("Tell me where to start and end...") start = input("Start (seconds):") end = input("End (seconds):") # os.system(f"ffmpeg -i \"{name}\" -ss {start} -t {end} start_of_output.mp4") # alternative command os.system(f"ffmpeg -i {name} -ss {start} -t {end} -c copy start_of_output.mp4")
The video that shows how it works