From 67bc656801411eeced33e1bced8f44a1c30fcd0c Mon Sep 17 00:00:00 2001 From: Alan Rager Date: Sat, 29 Jun 2019 07:21:26 -0700 Subject: [PATCH] use ffmpeg instead of streamer for checking camera --- debian/control | 2 +- debian/preinst | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 2b4262b..9f65b8d 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Vcs-Git: https://github.com/boltgolt/howdy Package: howdy Homepage: https://github.com/boltgolt/howdy Architecture: all -Depends: ${misc:Depends}, curl|wget, python3, python3-pip, python3-dev, python3-setuptools, libpam-python, fswebcam, libopencv-dev, cmake, streamer +Depends: ${misc:Depends}, curl|wget, python3, python3-pip, python3-dev, python3-setuptools, libpam-python, fswebcam, libopencv-dev, cmake, ffmpeg Recommends: libatlas-base-dev | libopenblas-dev | liblapack-dev Suggests: nvidia-cuda-dev (>= 7.5) Description: Howdy: Windows Hello style authentication for Linux. diff --git a/debian/preinst b/debian/preinst index e355a15..3a5ce2c 100755 --- a/debian/preinst +++ b/debian/preinst @@ -73,7 +73,12 @@ for dev in devices: print("Trying " + device_name) # Let fswebcam keep the camera open in the background - sub = subprocess.Popen(["streamer -t 1:0:0 -c /dev/v4l/by-path/" + dev + " -b 16 -f rgb24 -o /dev/null 1>/dev/null 2>/dev/null"], shell=True, preexec_fn=os.setsid) + sub = subprocess.Popen( + "ffmpeg -f v4l2 -framerate 25 -video_size 640_480 -i /dev/v4l/by-path/%s -f null -loglevel -8 /dev/null" % dev, + shell=True, + preexec_fn=os.setsid, + stdout=subprocess.PIPE, + stdin=subprocess.PIPE) try: # Ask the user if this is the right one