#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
getvirtualvideo.py
|
|
|
|
Pick 1st virtual video port
|
|
|
|
History:
|
|
--------
|
|
09.05.20/KQ Initial version
|
|
27.05.20/KQ Variable naming corrected
|
|
"""
|
|
|
|
import sys
|
|
|
|
# Some argument scanning for start
|
|
if len(sys.argv) > 1:
|
|
basename = sys.argv[1]
|
|
else:
|
|
basename = "videolist"
|
|
|
|
with open(basename + "1.txt") as l1:
|
|
r1 = l1.read()
|
|
|
|
with open(basename + "2.txt") as l1:
|
|
r2 = l1.read()
|
|
|
|
r3 = r2.replace(r1, "") # Skip previously existing entries ...
|
|
if len(r3) > 10:
|
|
r4 = r3[0:11] # /dev/video? (Att.: Single digit cam# only!)
|
|
print(r4) # Use output '/dev/video?'
|
|
else: # Will (& shall) fail
|
|
print("/dev/videoUnknown")
|