#!/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)
python剪切視頻
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.