willsonlincake 发表于 2022-4-9 01:43:32

Python拆分视频

https://fosspost.org/clip-split-large-videos-python/
#!/usr/bin/env python

from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip

# Replace the filename below.
required_video_file = "filename.mp4"

with open("times.txt") as f:
times = f.readlines()

times =

for time in times:
starttime = int(time.split("-"))
endtime = int(time.split("-"))
ffmpeg_extract_subclip(required_video_file, starttime, endtime, targetname=str(times.index(time)+1)+".mp4")
页: [1]
查看完整版本: Python拆分视频