python+ffmpeg提取音频

  开发

import os

for name in os.listdir():
filename = os.path.splitext(name)[0]
suffixname = os.path.splitext(name)[-1]
if(suffixname == '.mp4'):
    os.system('ffmpeg -i ' + '"' + name + '"' + ' -f mp3 -ab 192000 -vn ' + '"' + filename +'.mp3' + '"')

LEAVE A COMMENT

Captcha Code