def determineVideoDevice():
global video_device_searched
if video_device != None:
video_device_searched = video_device
print("Selected \"{}\" as video device...".format(video_device_searched))
return
path = "/dev/"
files = []
for i in os.listdir(path):
f = os.path.join(path, i)
if "/dev/video" in f:
files.append(f)
if len(files) > 0:
video_device_searched = files[0]
print("Selected \"{}\" as video device...".format(video_device_searched))
else:
video_device_searched = None
print("No video device found!")
os.abort()
评论列表
文章目录