import ffmpy
import os
#源文件放置路径
path = "D:\学习资料\\vidio"
datanames = os.listdir(path)
list = []
for i in datanames:
list.append(i)
for i in list:
source_file = "D:\学习资料\\video\\" + i[0:-4] + ".flv"
# 转换成功后的视频文件,文件夹真实存在,不会自动创建
sink_file = "D:\学习资料\\video2\\"+i[0:-4]+".mp4"
ff = ffmpy.FFmpeg(
inputs={source_file: None},
outputs={sink_file: None})
ff.run()