Repository: opencv
Issue: Match Camera Index and Name on MacOS
Labels: feature,platform: ios/osx

### Describe the feature and motivation

I have a builtin camera and a USB webcam connected to my MacOS.

Here is a result of `system_profiler SPCameraDataType -xml` command:
```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
    <dict>
        <key>_SPCommandLineArguments</key>
        <array>
            <string>/usr/sbin/system_profiler</string>
            <string>-nospawn</string>
            <string>-xml</string>
            <string>SPCameraDataType</string>
            <string>-detailLevel</string>
            <string>full</string>
        </array>
        <key>_SPCompletionInterval</key>
        <real>1.1997909545898438</real>
        <key>_SPResponseTime</key>
        <real>1.2810090780258179</real>
        <key>_dataType</key>
        <string>SPCameraDataType</string>
        <key>_detailLevel</key>
        <integer>-1</integer>
        <key>_items</key>
        <array>
            <dict>
                <key>_name</key>
                <string>USB Camera</string>
                <key>spcamera_model-id</key>
                <string>UVC Camera VendorID_3141 ProductID_25453</string>
                <key>spcamera_unique-id</key>
                <string>0x11000000c45636d</string>
            </dict>
            <dict>
                <key>_name</key>
                <string>FaceTime HD Camera</string>
                <key>spcamera_model-id</key>
                <string>FaceTime HD Camera</string>
                <key>spcamera_unique-id</key>
                <string>EAB7A68F-EC2B-4487-AADF-D8A91C1CB782</string>
            </dict>
        </array>
        <key>_parentDataType</key>
        <string>SPHardwareDataType</string>
        <key>_properties</key>
        <dict>
            <key>_name</key>
            <dict>
                <key>_isColumn</key>
                <string>NO</string>
                <key>_isOutlineColumn</key>
                <string>NO</string>
                <key>_order</key>
                <string>0</string>
            </dict>
            <key>spcamera</key>
            <dict>
                <key>_order</key>
                <string>10</string>
            </dict>
            <key>spcamera_model-id</key>
            <dict>
                <key>_order</key>
                <string>30</string>
            </dict>
            <key>spcamera_unique-id</key>
            <dict>
                <key>_order</key>
                <string>40</string>
            </dict>
            <key>volumes</key>
            <dict>
                <key>_detailLevel</key>
                <string>0</string>
            </dict>
        </dict>
        <key>_timeStamp</key>
        <date>2024-11-29T21:57:28Z</date>
        <key>_versionInfo</key>
        <dict>
            <key>com.apple.SystemProfiler.SPCameraReporter</key>
            <string>1.2.0</string>
        </dict>
    </dict>
</array>
</plist>
```
As you can see, I have a couple of video input devices: `USB Camera` & `FaceTime HD Camera`

The problem is that when I use `cap = cv2.VideoCapture(0)`, it uses the `FaceTime HD Camera`.

Can we match the camera index in OpenCV with the camera names?

P.S. I tried *ffmpeg**, but it returned similar result:
![image](https://github.com/user-attachments/assets/fc1ecdb1-2cef-4898-b59b-3d38360d932b)

`ioreg | grep -i cam` result:
![image](https://github.com/user-attachments/assets/1471101f-2d3b-4809-862f-9c10e9cbe417)






### Additional context

_No response_