-
Notifications
You must be signed in to change notification settings - Fork 2
Archive Image
In CAM2ImageArchiver.py, there is a function named archive() and it is what user need to download images. The function takes in a list of camera objects, duration of entire parsing process, time interval to parse image, result path and a flag to remove result folder if parsing fail. For example, user has a list of camera objects that they want to parse image from.
camObj1 = {'camera_type': 'ip', 'is_active_image': True}
camObj2 = {...}
camObj3 = {...}
camList = [camObj1, camObj2, camObj3]
archiver = CAM2ImageArchiver()
archiver.archive(camList)
Above will generate a list of image folders if parse successfully.
What might went wrong if parse fail?
Wrong URL, Website down, Camera get migrated to other place
-
Transform each dictionary inside of camera list into Camera Instances. There are three main type of camera class such as IPCamera, NonIPCamera and StreamCamera. First step is to turn each camera dictionary into their camera class accordingly.
-
Then we create result directories to store images from each camera.
-
Start multithreading on downloading images => Camera Handler
-
Remove directory if downloading failed for that specific camera