ffmpeg 检测到 dshow Dante Via 虚拟音频设备的音频选项不正确

ffmpeg 检测到 dshow Dante Via 虚拟音频设备的音频选项不正确

我使用 Dante Via 虚拟音频设备,它在自己的 Dante 音频网络中运行。我使用的是 WDM 音频接口而不是 ASIO,因为目前 ffmpeg 不支持它。默认情况下,Dante 应在 24 位和 48000 Hz 模式下运行。Windows CP 正确显示此信息: 在此处输入图片描述

问题

ffmpeg 识别出错误的音频设备参数并仅显示最大通道=2 位=16 速率= 44100

ffmpeg -f dshow -list_options true -i audio="Dante Via Receive (Dante Via)"

输出:

ffmpeg version 2021-03-16-git-9383885c0d-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 68.100 / 56. 68.100
  libavcodec     58.132.100 / 58.132.100
  libavformat    58. 74.100 / 58. 74.100
  libavdevice    58. 12.100 / 58. 12.100
  libavfilter     7.109.100 /  7.109.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[dshow @ 000002503e5daa40] DirectShow audio only device options (from audio devices)
[dshow @ 000002503e5daa40]  Pin "Capture" (alternative pin name "Capture")
[dshow @ 000002503e5daa40]   min ch=1 bits=8 rate= 11025 max ch=2 bits=16 rate= 44100
    Last message repeated 22 times
audio=Dante Via Receive (Dante Via): Immediate exit requested

因此,如果我尝试使用 ffmpeg 提供的默认设置进行录制:

ffmpeg.exe -f dshow -i audio="Dante Via Receive (Dante Via)" D:\test.mp3

我的录音开始出现越来越多的爆音,变得失真,18 分钟后就静音了。看起来这种行为表明 ffmpeg 试图以 44100 Hz 录制,而 dshow 真正输出的是 48000 Hz。

尝试过

编辑: 下面尝试使用 -ar 选项的选项根据定义是不正确的,因为 -ar 不是 dshow 输入设备的选项: http://ffmpeg.org/ffmpeg-devices.html#dshow

如果我手动将输入采样率更改为 48000 Hz:

ffmpeg_rc.exe -f dshow -ar 48000 -i audio="Dante Via Receive (Dante Via)" D:\test.mp3

给出错误:

[dshow @ 0000021fe4c0e540] Could not set audio only options
[dshow @ 0000021fe4c0e540] Searching for audio device within video devices for Dante Via Receive (Dante Via)
[dshow @ 0000021fe4c0e540] Could not enumerate audio only devices (or none found).
audio=Dante Via Receive (Dante Via): I/O error

如果我手动将输入采样率更改为 11025 Hz:

ffmpeg_rc.exe -f dshow -ar 11025 -i audio="Dante Via Receive (Dante Via)" D:\test.mp3

音频质量明显下降,但爆音和失真开始出现,并且表现相同。

如果我尝试转换输出的采样率:

ffmpeg_rc.exe -f dshow -i audio="Dante Via Receive (Dante Via)" -ar 48000 D:\test.mp3

问题依旧。看起来 ffdshow 无法正确理解 Dante Via 提供的采样率。

我尝试了几种不同的构建。

这是某种错误、限制还是我不了解如何使用此工具?

答案1

这个问题已经修复。几天后,您应该会在 Git master FFmpeg 的版本中看到它。

ffmpeg -f dshow -list_options true -i audio="DVS Receive  1-2 (Dante Virtual Soundcard)"
ffmpeg version git-2021-11-03-25e34ef Copyright (c) 2000-2021 the FFmpeg developers
  built with Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30136 for x64
  configuration: --prefix=./../../installed --toolchain=msvc --arch=x86_64 --enable-x86asm --enable-asm --disable-shared --enable-static --enable-gpl --enable-debug=3 --extra-ldflags='-LIBPATH:./../../installed/lib/' --extra-cflags='-I./../../installed/include/ -DDSHOWDEBUG -DDEBUG -DTRACE'
  libavutil      57.  7.100 / 57.  7.100
  libavcodec     59. 12.100 / 59. 12.100
  libavformat    59.  8.100 / 59.  8.100
  libavdevice    59.  0.101 / 59.  0.101
  libavfilter     8. 16.101 /  8. 16.101
  libswscale      6.  1.100 /  6.  1.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
[dshow @ 000002637D32FBC0] DirectShow audio only device options (from audio devices)
[dshow @ 000002637D32FBC0]  Pin "Capture" (alternative pin name "Capture")
[dshow @ 000002637D32FBC0]   ch= 2, bits=16, rate= 44100
    Last message repeated 1 times
[dshow @ 000002637D32FBC0]   ch= 1, bits=16, rate= 44100
[dshow @ 000002637D32FBC0]   ch= 2, bits=16, rate= 32000
[dshow @ 000002637D32FBC0]   ch= 1, bits=16, rate= 32000
[dshow @ 000002637D32FBC0]   ch= 2, bits=16, rate= 22050
[dshow @ 000002637D32FBC0]   ch= 1, bits=16, rate= 22050
[dshow @ 000002637D32FBC0]   ch= 2, bits=16, rate= 11025
[dshow @ 000002637D32FBC0]   ch= 1, bits=16, rate= 11025
[dshow @ 000002637D32FBC0]   ch= 2, bits=16, rate=  8000
[dshow @ 000002637D32FBC0]   ch= 1, bits=16, rate=  8000
[dshow @ 000002637D32FBC0]   ch= 2, bits= 8, rate= 44100
[dshow @ 000002637D32FBC0]   ch= 1, bits= 8, rate= 44100
[dshow @ 000002637D32FBC0]   ch= 2, bits= 8, rate= 22050
[dshow @ 000002637D32FBC0]   ch= 1, bits= 8, rate= 22050
[dshow @ 000002637D32FBC0]   ch= 2, bits= 8, rate= 11025
[dshow @ 000002637D32FBC0]   ch= 1, bits= 8, rate= 11025
[dshow @ 000002637D32FBC0]   ch= 2, bits= 8, rate=  8000
[dshow @ 000002637D32FBC0]   ch= 1, bits= 8, rate=  8000
[dshow @ 000002637D32FBC0]   ch= 2, bits=16, rate= 48000
[dshow @ 000002637D32FBC0]   ch= 1, bits=16, rate= 48000
[dshow @ 000002637D32FBC0]   ch= 2, bits=16, rate= 96000
[dshow @ 000002637D32FBC0]   ch= 1, bits=16, rate= 96000
audio=DVS Receive  1-2 (Dante Virtual Soundcard): Immediate exit requested

也可以看看:

答案2

我看到现在支持更高的采样率,但有没有针对 24 位支持的修复?对于我的 Dante (DVS) 设备,我仍然没有在 dshow 中看到 24 位。

相关内容