-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
window上处理MP3 #54
Comments
非常感谢您的分享,会帮助到其他使用windows的朋友。我会开一个FAQ存放此类问题。 |
请问具体怎么操作? |
工作目录具体指什么?怎样加上CMD? |
ffmpeg的bin文件夹在系统环境变量路径之中就可以了 |
确实如此,之前我把ffmpeg放在中文目录下,导致python的os.environ.get("PATH")下ffmpeg的路径乱码,所以失败。 |
可以老哥,路径需要全英文 |
运行时出现这个,请问怎么解决 |
File "E:\learn\sadtalker\inference.py", line 93, in main animate_from_coeff.generate(data, save_dir, enhancer=args.enhancer, original_size=original_size) File "E:\learn\sadtalker\src\facerender\animate.py", line 165, in generate sound = AudioSegment.from_mp3(audio_path) File "E:\venv\sadtalker\lib\site-packages\pydub\audio_segment.py", line 796, in from_mp3 return cls.from_file(file, 'mp3', parameters=parameters) File "E:\venv\sadtalker\lib\site-packages\pydub\audio_segment.py", line 728, in from_file info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit) File "E:\venv\sadtalker\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE) File "E:\Python310\pyenv-win\versions\3.8.3\lib\subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "E:\Python310\pyenv-win\versions\3.8.3\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] 系统找不到指定的文件。
原因:pyhub的AudioSegment.from_file方法使用的时Popen去执行命令行
['ffprobe' ,'-of' ,'json', '-v' ,'info' ,'-show_format', '-show_streams', 'D:\\audio\\m.mp3']
来加载音频详细信息。linux、mac下是没有问题的,但是windows下需要把ffmpeg、ffprobe等执行文件放在工作目录下才能执行,想要使用环境变量PATH下的ffprobe需要加上 ['cmd' ,'/c'] 。The text was updated successfully, but these errors were encountered: