这是一个潜在的‘陷阱’,我将在这里记录,以防其他人在它上面绊倒。我正在对可能是.wav或.mov格式的文件运行转换。测试看起来像这样:
if pic[0].audiodesc.path.lower().endswith('.wav'):
sound = AudioSegment.from_file(pic[0].audiodesc.path)
sound.export(mp3_filepath, format = 'mp3', bitrate = '64k')
elif pic[0].audiodesc.path.lower().endswith('.mov'):
sound = AudioSegment.from_file(pic[0].audiodesc.path, 'mov')
sound.export(mp3_filepath, format = 'mp3', bitrate = '64k')在AudioSegment.from_file(pic[0].audiodesc.path)中,如果我指定..,'wav'),则编码失败,并显示:
avconv version 9.20-6:9.20-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers built on Dec 7 2016 21:22:31 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
/tmp/tmpGhtAOn: Operation not permitted发布于 2017-09-04 18:25:15
删除'wav‘可以解决这个问题。
https://stackoverflow.com/questions/46035042
复制相似问题