# -*- coding: utf-8 -*-
import os
listdirs = os.listdir("./")
for i in listdirs:
if i.endswith(".flv"):
#print(i)
#a = i[:-4]
#b = a + ".mp4"
#print(b)
#cmd = u'D:\\Desktop\\配置\\ffmpeg.exe -i "' + i + '" -c copy "' +b+ '"'
#os.system(cmd)
"""
with open("1.txt","a",encoding="utf-8") as f:
f.write("file '")
f.write(i)
f.write("'\n")
"""
pass
cmd = u'D:\\Desktop\\配置\\ffmpeg.exe -f concat -safe 0 -i 1.txt -c copy last.mp4'
os.system(cmd)
由于网络问题,一段视频被下载成无数段,突然想到了python可以解决。