List all connected media devices in MacOS

0
5585
List all connected media devices in MacOS
List all connected media devices in MacOS

I will show you a tip to list all connected media devices in MacOS from terminal. We will use ffmpeg for the job.

If you don’t have ffmpeg, install it using Homebrew:

$ brew install ffmpeg

Then use the following command to list all connected media devices in MacOS:

$ ffmpeg -hide_banner -list_devices true -f avfoundation -i dummy
[AVFoundation indev @ 0x128e059b0] AVFoundation video devices:
[AVFoundation indev @ 0x128e059b0] [0] FaceTime HD Camera
[AVFoundation indev @ 0x128e059b0] [1] HD Pro Webcam C920
[AVFoundation indev @ 0x128e059b0] [2] Capture screen 0
[AVFoundation indev @ 0x128e059b0] [3] Capture screen 1
[AVFoundation indev @ 0x128e059b0] AVFoundation audio devices:
[AVFoundation indev @ 0x128e059b0] [0] Pete Houston’s AirPods
[AVFoundation indev @ 0x128e059b0] [1] External Microphone
[AVFoundation indev @ 0x128e059b0] [2] MacBook Pro Microphone
[AVFoundation indev @ 0x128e059b0] [3] CalDigit Thunderbolt 3 Audio
[AVFoundation indev @ 0x128e059b0] [4] HD Pro Webcam C920

Both video and audio devices are listed on the result. You can use their ID to perform such ffmpeg action such as play, stream, or screenshot…

Have fun!