[FFmpeg-user] Audio captured via AVFoundation is unusable
Gabriel Balaich
ffmpeg at ninbura.com
Sun Jun 15 23:28:27 EEST 2025
> Would whoever wrote that actually identify themselves in their email?
> That would be quite helpful (as well as courteous).
Apologies, I've updated the name attached to this email, and will sign all messages moving forward. I created a custom email with my domain for use with this mailing list.
Just now I clean installed macOS on my MacBook Pro w/ M3 Pro:
ninbura at ninburas-MacBook-Pro bin % stat -f "%SB" /Users/$(whoami)
Jun 15 12:59:58 2025
ninbura at ninburas-MacBook-Pro bin % ls -l /var/db/.AppleSetupDone
-r-------- 1 root wheel 0 Jun 15 13:00 /var/db/.AppleSetupDone
I then created an FFmpeg build that required no dependencies, played a song out on my studio monitors, and recorded audio using the mic built into the MacBook:
./ffmpeg -y \
-thread_queue_size 9999 \
-indexmem 9999 \
-f avfoundation \
-i ":MacBook Pro Microphone" \
-c:a pcm_f32le \
-ar 48000 \
-ac 2 \
-vn \
~/Movies/2025-06-15_static_clean-installed-macOS-avfoundation-test.wav
The result is the same, glitchy/crackling pitch shifted audio:
https://drive.proton.me/urls/T664MFK464#fYI0HqeRciQL
I used iMessage and a USB drive to transfer commands and files between my Mac Studio and MacBook Pro, without installing any additional software. I never connected a dock or even the charger, only a USB drive to transfer the binaries & output files. Seeing as I have now tested 2 unique systems, one of which has zero 3rd party modifications, and various FFmpeg builds; I believe I have adequately demonstrated that the issue is not caused by some component in my setup.
After I ran the initial test with said static build of FFmpeg, I once again installed FFmpeg via brew, and built a more comprehensive binary. I tested with all said builds on the clean system, the result is always the same.
Full output:
ffmpeg version N-119886-g52441bd4cd Copyright (c) 2000-2025 the FFmpeg developers
built with Apple clang version 17.0.0 (clang-1700.0.13.5)
configuration: --prefix=/Users/ninbura/ffmpeg/builds/ffmpeg-master-static-20250615-13-51-56 --cc=/usr/bin/clang --enable-static --disable-shared --disable-autodetect --enable-pthreads --enable-version3 --enable-gpl --disable-ffplay --disable-network --disable-protocols --enable-protocol=file --enable-protocol=pipe --enable-audiotoolbox --enable-videotoolbox --enable-avfoundation --enable-neon --disable-debug --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-xlib --disable-zlib --disable-bzlib --disable-lzma --disable-iconv --extra-cflags= --extra-ldflags='-Wl,-ld_classic'
libavutil 60. 3.100 / 60. 3.100
libavcodec 62. 3.101 / 62. 3.101
libavformat 62. 1.100 / 62. 1.100
libavdevice 62. 0.100 / 62. 0.100
libavfilter 11. 0.100 / 11. 0.100
libswscale 9. 0.100 / 9. 0.100
libswresample 6. 0.100 / 6. 0.100
2025-06-15 14:01:29.164 ffmpeg[17181:104662] WARNING: Add NSCameraUseContinuityCameraDeviceType to your Info.plist to use AVCaptureDeviceTypeContinuityCamera.
Input #0, avfoundation, from ':MacBook Pro Microphone':
Duration: N/A, start: 3830.523354, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_f32le, 48000 Hz, mono, flt, 1536 kb/s, Start 3830.523354
Stream mapping:
Stream #0:0 -> #0:0 (pcm_f32le (native) -> pcm_f32le (native))
Press [q] to stop, [?] for help
Output #0, wav, to '/Users/ninbura/Movies/2025-06-15_static_clean-installed-macOS-avfoundation-test.wav':
Metadata:
ISFT : Lavf62.1.100
Stream #0:0: Audio: pcm_f32le ([3][0][0][0] / 0x0003), 48000 Hz, stereo, flt, 3072 kb/s
Metadata:
encoder : Lavc62.3.101 pcm_f32le
[out#0/wav @ 0x600002ba0480] video:0KiB audio:15260KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.000589%
size= 15260KiB time=00:00:45.56 bitrate=2743.4kbits/s speed= 1x elapsed=0:00:45.57
Exiting normally, received signal 2.
Thanks, Gabriel.
More information about the ffmpeg-user
mailing list