Hello,
I’m new to python and so I assume I’d doing something wrong here. I’m using macOS 13.6 with python3.
I’m trying to understand why in terminal and python I get different results for the following command:
ffmpeg -f avfoundation -list_devices true -i “”
When in terminal I perform the following command I get:
[AVFoundation indev @ 0x7fbe79804500] AVFoundation video devices:
[AVFoundation indev @ 0x7fbe79804500] [0] PureThermal (fw:v1.3.0)
[AVFoundation indev @ 0x7fbe79804500] [1] FaceTime HD Camera (Built-in)
[AVFoundation indev @ 0x7fbe79804500] [2] OBS Virtual Camera
[AVFoundation indev @ 0x7fbe79804500] [3] Capture screen 0
[AVFoundation indev @ 0x7fbe79804500] [4] Capture screen 1
[AVFoundation indev @ 0x7fbe79804500] AVFoundation audio devices:
[AVFoundation indev @ 0x7fbe79804500] [0] MacBook Pro Microphone
When running the following in a python script:
command = ['ffmpeg','-f', 'avfoundation','-list_devices','true','-i','""']
result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True)
for item in result.stderr.splitlines():
print (item)
I get:
[AVFoundation indev @ 0x7fbf43804540] AVFoundation video devices:
[AVFoundation indev @ 0x7fbf43804540] [0] FaceTime HD Camera (Built-in)
[AVFoundation indev @ 0x7fbf43804540] [1] OBS Virtual Camera
[AVFoundation indev @ 0x7fbf43804540] [2] PureThermal (fw:v1.3.0)
[AVFoundation indev @ 0x7fbf43804540] [3] Capture screen 0
[AVFoundation indev @ 0x7fbf43804540] [4] Capture screen 1
[AVFoundation indev @ 0x7fbf43804540] AVFoundation audio devices:
[AVFoundation indev @ 0x7fbf43804540] [0] MacBook Pro Microphone
As you can see the camera indexes are mixed up Am I doing something wrong above? Thanks!