admin管理员组

文章数量:1616424

问题:直接使用cmd的 copy / b *.st output.mp4会因为读取的顺序不同导致产出的视频错序

问题二:上述命令合成出的视频质量不太好,跳放可能卡顿

解决办法:ffmpeg

大佬的博客
ffmpeg打开文件错误 Unsafe file name
夸克的视频缓存中可能会有.part文件导致程序出错,在使用前请把.part后缀删去

import os 
path=os.getcwd()
for root,dirs,file in os.walk(path):
    pass
del file[0]

fore=file[0][0:16]#我的夸克缓存编号前十六位是统一编号
#例如Y2hlbmppbmdjb25n0,取Y2hlbmppbmdjb25n
#具体情况自己调整
print(file[0],fore)

with open('name.txt','w') as f :
    for i in range(len(file)):
        os.rename(fore+str(i),fore+str(i)+'.st')#重命名方便删除
        f.write(r'file '+fore+str(i)+'.st\n')
f.close()

cmd=r'ffmpeg -f concat -safe 0 -i name.txt -c copy output.mkv'
os.system(cmd)
cmd=r'del *.st'
os.system(cmd)

本文标签: 夸克缓存浏览器简单视频