如何在Windows上使用youtube-dl提取音频 [英] How to extract audio with youtube-dl on Windows

查看:471
本文介绍了如何在Windows上使用youtube-dl提取音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Windows上用youtube-dl下载的视频中提取音频.我的youtube-dl工作正常,但无法提取音频.由于未安装正确的音频代码而导致此问题.

I want to extract audio from a video downloaded with youtube-dl on Windows. I got youtube-dl working, but am unable to extract the audio. This problem is caused due to not having the correct audio codes installed.

当我尝试提取音频时,它会告诉我以下内容:

When I try to extract audio it tells me the following:

WARNING: unable to obtain file audio codes with ffprobe

youtube-dl手册说:

The youtube-dl manual says:

-x -extract-audio    convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe)

如何安装ffprobe或ffmpeg?我要在Windows上安装它,还是将其作为Python扩展程序安装?

How do I install ffprobe or ffmpeg? Do I install this on Windows, or do I install this as a Python extension?

我的操作系统是Windows 7.

My OS is Windows 7.

推荐答案

ffmpeg不是Python模块.看一下FFmpegExtractAudioPP类中的youtube-dl代码.

ffmpeg is not a Python module. Take a look at the code of youtube-dl in the FFmpegExtractAudioPP class.

它使用此调用来确定可执行文件是否存在.它会检查您当前的路径:

It uses this call to figure out if the executable exists or not. It checks in your current path:

subprocess.Popen([exe, '-version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()

您需要下载 Windows构建的ffmpeg 并将其放在当前版本中路径,可能要确保其名称末尾没有.exe.

这篇关于如何在Windows上使用youtube-dl提取音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆