Python slices video files into small segments of specified length
As shown in the code, create a folder in the same folder, divide the MP4 file into several small segments at 10-minute intervals, and adapt the video length. from moviepy.editor import VideoFileClip import pathlib video_file = pathlib.Path(r’/Users/frank/Downloads/数据大爆炸无加密版本.mp4′) save_directory = video_file.parent / video_file.stem save_directory.mkdir(parents=True, exist_ok=True) duration_time = 30 full_video = video_file.as_posix() current_duration = VideoFileClip(full_video).duration divide_into_count = […]