【发布时间】:2015-08-14 07:41:50
【问题描述】:
我不确定这是否是一个严格的编程问题,只要我 不介意使用其他软件来解决问题,只要它保持可编写脚本或命令行(这是:非 GUI 解决方案)。无论如何,我在SuperUser 发布了另一个(有点不同)问题。顺便说一句,如果我在那里得到答案,我会在这里更新。
我的 Windows 程序(只是一个 shell 脚本)调用 VLC 命令行以便从声卡录制音频并将其流式传输出来,例如:
vlc dshow:// :dshow-vdev=none :dshow-adev="SoundMAX HD Audio I" :std{mux=ts,access=http,dst=:8080} :sout-keep [rest of the cmdline not relevant]
只要计算机上可能有多个音频设备(网络摄像头、多个声卡、蓝牙设备...等),我需要以编程方式获取名称 其中。
到目前为止,我一直在使用 FFMPEG:
ffmpeg -list_devices true -f dshow -i dummy
...但有时不能正常工作,例如:
d:\Utils\FFMPEG\bin>ffmpeg -list_devices true -f dshow -i dummy
ffmpeg version N-72460-g11aa050 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
ble-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 26.100 / 54. 26.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 34.100 / 56. 34.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[dshow @ 0000000000363520] DirectShow video devices (some may be both video and
audio devices)
[dshow @ 0000000000363520] Could not enumerate video devices (or none found).
[dshow @ 0000000000363520] DirectShow audio devices
[dshow @ 0000000000363520] Could not enumerate audio only devices (or none found
).
dummy: Immediate exit requested
命令行工具SystemInfo 都不起作用:
C:\>systeminfo | find "audio" /i
C:\>
在regedit 内部搜索没有发现关于我的声卡示例 (SoundMAX HD Audio I)。
没有其他更可靠的方式以编程方式获取声音设备名称吗?
如果可能,我希望同时获得 Windows XP 和 Vista 或更高版本的答案。
执行了额外的测试:
- 安装最新的 MicroSoft .NET FrameWork v4.5.2 并重新启动。
- 已测试旧版本的 FFMPEG:v4.8 (2014) 和 v4.7 (2013)。
- 经过测试的 UAC 提升提示。
【问题讨论】:
-
我从来没有让 FFmpeg 无法列出 Directshow 设备。我可能会建议切换 FFmpeg 版本。您可能缺少图书馆或其他东西。此外,您可能会在 SuperUser.com 上找到更好的答案。
-
一个奇怪的结果,@Brad:v4.8.2 和 v4.7.3(测试共享和静态)在 Windows 7 SP1 Ultimate 上具有相同的行为。但是 v4.7.3 解决了 Windows XP SP3 上的问题。摘自此处:stackoverflow.com/questions/17650354/…
-
MSVCRT.DLL....您是否尝试过重新安装 Visual C++ 运行时?此外,您可以尝试从其他地方获取您的 FFmpeg 版本。
-
好吧,@Brad,这是我为 FFMPEG 下载的位置(似乎是官方的):ffmpeg.zeranoe.com/builds/win64
-
相同结果:32 位产量也无法枚举音频设备。经过测试的 v4.7.3 (2013) 和最新版本。
标签: windows shell audio device