#!/usr/bin/env python3
# encoding:utf-8
#*************************************
import sys
from moviepy.editor import *
from pydub import AudioSegment
def time_to_second(time):
h,m,s = time.split(':')
return 3600 * int(h) + 60 * int(m) + int(s)
if __name__ == "__main__":
if len(sys.argv) != "2":
print("%s xxx.mp4" % sys.argv[0])
sys.exit(0)
video = VideoFileClip(sys.argv[1])
start = str(input("输入起始时间点:"))
end = str(input("输入终止时间点:"))
filename = input("输入保存的文件名")
video = video.subclip(time_to_second(start),time_to_second(end))
video.to_videofile(filename)