diff options
author | coderick14 | 2017-07-04 18:48:35 +0530 |
---|---|---|
committer | coderick14 | 2017-07-04 18:48:35 +0530 |
commit | a0754b1f610c9889c837390de10625c50f116b81 (patch) | |
tree | 668d848606e1e8717e358719bc738a12f1b7f884 /sbhs_server/tables/models.py | |
parent | ab8f81a702a33eee9c1873233f25e818f16386fe (diff) | |
download | SBHS-2018-Rpi-a0754b1f610c9889c837390de10625c50f116b81.tar.gz SBHS-2018-Rpi-a0754b1f610c9889c837390de10625c50f116b81.tar.bz2 SBHS-2018-Rpi-a0754b1f610c9889c837390de10625c50f116b81.zip |
Add model Webcam to capture live webcam feeds
Diffstat (limited to 'sbhs_server/tables/models.py')
-rw-r--r-- | sbhs_server/tables/models.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sbhs_server/tables/models.py b/sbhs_server/tables/models.py index 7500c68..813e6cc 100644 --- a/sbhs_server/tables/models.py +++ b/sbhs_server/tables/models.py @@ -258,3 +258,18 @@ class Experiment(TrashableMixin): created_at = models.DateTimeField(auto_now_add=True, editable=False) updated_at = models.DateTimeField(auto_now=True, editable=False) + +class Webcam(): + """ + Utility function to capture webcam feeds using streamer + """ + def __init__(self): + pass + + @classmethod + def load_image(className,mid): + + if int(mid) : + command = "timeout 2s streamer -q -f jpeg -c /dev/video" + str(mid) + command += " -o " + settings.WEBCAM_DIR + "image" + str(mid) + ".jpeg" + os.system(command)
\ No newline at end of file |