Skip to main content

README

Citation

If you use this software, please include the following statement in acknowledgments

"The image archiving program is provided by the CAM2 (Continuous Analysis of Many CAMeras) project at Purdue University."

What is this repository for?

In particular, "You agree not to use the Platform to determine the identity of any specific individuals contained in any video or video stream."

  • Software licensed under Apache license. See LICENSE.txt for details.

  • The lead investigator is Dr. Yung-Hsiang Lu, yunglu@purdue.edu. Please send your questions, comments, or suggestions to him.

Motivation

Thousands of network cameras are connected to the Internet and provide real-time visual data (image or video). Many network cameras require no password and anyone connected to the Internet can retrieve the data,i.e., the data is publicly available. This program considers only publicly available camera data.

Even though the data is publicly available to anyone interested seeing, there are several problems. First, there is no central repository where network cameras must register. Thus, significant efforts must be taken to find various sources of data. Second, different brands of network cameras need different methods to retrieve the data. The cameas may also provide different data formats: some provide individual JPEG images; some provide motion JPEG (MJPEG) video; some others provide H.264 video.

Many organizations (such as departments of transportation) aggregate streams of multiple cameras and put these streams on web sites. However, these web sites have different formats and styles. Some web sites use simple HTML; some use CSS; some use Javascript. Some web sites have fixed URLs for different cameras. Some web site have dynamically generated URLs reflecting the time (thus, the URLs are always changing).

To solve these problems, researchers at Purdue University are developing the software to retrieve data from heterogeneous sources.

Documentation

Full documentation can be found at https://purduecam2project.github.io/CAM2ImageArchiver/index.html

Installation

 pip install CAM2ImageArchiver
  • To install from source, download this repository and run:
python setup.py install

Files

  • CAM2ImageArchiver.py is the main Python module. It archives images from a single camera.
  • camera.py provides classes to communicate with different types of cameras: IP cameras, non-IP cameras, and stream cameras.
  • StreamParser.py is used by camera.py to parse JPEG and MJPEG streams.
  • error.py contains custom Python Exceptions.
  • CamerHandler.py splits the retrieval job into threads for parallel processing.

Usage

We recommend using the CAM2 Image Archiver with the CAM2 Camera Database Python Client.

The CAM2 Image Archiver accepts Camera objects directly from the CAM2 Camera Client users can also create their own camera object on the fly as shown below. The archive() method expects a list of dictionary objects with camera_type, cameraID, and snapshot_url fields.

[{'camera_type': 'non_ip', 'cameraID':'1', 'snapshot_url':'<The URL to the Camera Image Data>'}]

Below is an example of how to archive the image data from one camera. More example usage can be found in the documentation.

from CAM2ImageArchiver import CAM2ImageArchiver
cams = [{'camera_type': 'non_ip', 'cameraID':'1', 'snapshot_url':'http://example.com/camera1'}]
cam2 = CAM2ImageArchiver(num_processes=3)
cam2.archive(cams, duration=<duration(sec) to archive data>, interval=<interval(sec) to archive data>)	

Metadata

Release files for CAM2ImageArchiver 2.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CAM2ImageArchiver 2.0.4
File Size Uploaded
CAM2ImageArchiver-2.0.4.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CAM2ImageArchiver 2.0.4
File Interpreter ABI Platform
CAM2ImageArchiver-2.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 28.0 kB

Release files / CAM2ImageArchiver-2.0.4.tar.gz

Download URL CAM2ImageArchiver-2.0.4.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3ddc93be60d61ee08aae8321346598c7a597335ed82c5bb649ee2219e9df21b5
BLAKE2b-256 checksum
How to use checksums
221c18357fc578f5f6f34866a214d80b96c4723d8cee8f90e564650b7c348564
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / CAM2ImageArchiver-2.0.4-py3-none-any.whl

Download URL CAM2ImageArchiver-2.0.4-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3904afc23f6f471e72a1020a8df43158e5d2c1ffce1db6c3ea9f0ac6178c48a3
BLAKE2b-256 checksum
How to use checksums
744a69363c0668d1f43b8d6e7a0cf6ef723b5cc1c60c7afcffdf091f8daf37f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

2.0.4 This release

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.0

2 release files

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page