Instead of looping using this call
cap = cv2.VideoCapture(index)
if not cap.read()[0]:
I wish there is alternative approach to list cameras on the USB just like in linux base architecture where I could use the attached bash script to return list of camera on the USBs.
#python !/bin/bash
if [[ $# -eq 0 ]]
then
for device in /sys/class/video4Linux/*
do
declare devpath="dev/$(basename $device)"
read name <$device/name
echo "$devpath => $name"
done
exit 0
fi
I search and so far I am yet to get any useful approach to use dos in windows.
Does anyone know of a link or approach in handling this?