import subprocess command = ["ffmpeg", "-list_devices", "true", "-f", "dshow", "-i", ""] print(command) ffmpeg_devices = subprocess.run(command, text=True, stderr=subprocess.PIPE, encoding="utf-8") print(ffmpeg_devices)