List CoreAudio Input Devices Using FFmpeg on macOS
This guide provides a quick and direct method to list all available CoreAudio input devices—such as built-in microphones, external audio interfaces, and virtual sound cards—on macOS using the FFmpeg command-line utility.
Step 1: Open Terminal
To begin, open the Terminal application on your Mac. You can find it using Spotlight Search (Cmd + Space, then type “Terminal”) or under Applications > Utilities.
Step 2: Run the FFmpeg Command
On macOS, FFmpeg accesses system audio and video input devices via
the avfoundation framework. To query and list all available
input devices, run the following command:
ffmpeg -f avfoundation -list_devices true -i ""Step 3: Identify Your Audio Devices
After running the command, FFmpeg will output a list of available AVFoundation devices to the console. Look for the section labeled AVFoundation audio devices.
The output will look similar to this:
[AVFoundation indev @ 0x123456789] AVFoundation video devices:
[AVFoundation indev @ 0x123456789] [0] FaceTime HD Camera
[AVFoundation indev @ 0x123456789] AVFoundation audio devices:
[AVFoundation indev @ 0x123456789] [0] Built-in Microphone
[AVFoundation indev @ 0x123456789] [1] External Microphone
In the audio devices section, each device is prefixed by an index
number in brackets (e.g., [0] or [1]). You can
use either this index number or the precise device name to select the
input for recording.
Step 4: Record Audio Using the Device
Once you have identified the index of your desired CoreAudio device,
you can capture audio from it. For example, to record audio from the
“Built-in Microphone” (index 0) and save it as an MP3 file,
run:
ffmpeg -f avfoundation -i ":0" output.mp3(Note: The colon : before the index number tells
FFmpeg to look for an audio device rather than a video device).