import subprocess
out = open('./tmp/sss.mp4','rb').read()
p = subprocess.Popen(["./ffmpeg","-i","-","-ac","1","-ar", "8000","-f","wav","-"] , stdin=subprocess.PIPE,stdout=subprocess.PIPE)
voice = p.communicate(input = out)[0]
转载于:https://www.cnblogs.com/sherlockhomles/p/7793118.html