Skip to main content

Pynopticon

Project description

Panopticon

Pynopticon

Pynopticon is a video recording utility that saves the last n frames before an interesting event to disk. This is useful if you just want to record the frames leading up to an interesting event.

import time
from pynopticon import Pynopticon

p = Pynopticon(record_frames=100)
p.start()
time.sleep(10)
p.save()

Optionally, you can upload the video to YouTube. This requires a client_secrets.json file, see instructions here.

import time
from pynopticon import Pynopticon, get_authenticated_service

youtube = get_authenticated_service(client_secrets_file="./client_secrets.json")
p = Pynopticon(record_frames=100, youtube=youtube)
p.start()
time.sleep(10)
p.save(upload=True, title="My Video", description="My Description")

There is also a server that exposes an http api, in case if you want to run Pynopticon on an external device.

# without upload:
python -m pynopticon

# with upload:
CLIENT_SECRETS_FILE="client_secrets.json" python -m pynopticon

api:

  • /: visit in browser for live streaming
  • POST /start: same as p.start() (after stop, server auto starts pynopticon instance)
  • POST /save: same as p.save(). Set ?upload=true to upload to YouTube. Only works if CLIENT_SECRETS_FILE is set.
  • POST /stop: same as p.stop()

config:

  • RECORD_FRAMES: number of frames to record before an event. Default: 100
  • CLIENT_SECRETS_FILE: path to client_secrets.json file. Default: None
  • PORT: port to run server on. Default: 4004
  • HOST: host to run server on. Default: 0.0.0.0
  • CAM: camera index. Default: 0

https://en.wikipedia.org/wiki/Panopticon

Installation

Requires OpenCV!

  • from pip
pip install pynopticon
  • from source
git clone https://github.com/rickwierenga/pynopticon

Developed for the Sculpting Evolution Group at the MIT Media Lab

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Pynopticon-0.0.5.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

Pynopticon-0.0.5-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file Pynopticon-0.0.5.tar.gz.

File metadata

  • Download URL: Pynopticon-0.0.5.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for Pynopticon-0.0.5.tar.gz
Algorithm Hash digest
SHA256 b398a9f85272fecd41f8d66a54c30e9e4f3ae1a2dd9b43b07e7f8141c8870bc0
MD5 2b74ef20aa67508be2cc0e8828f5e00b
BLAKE2b-256 d13d101b83f19b4fc65eb6d9d3172f94fe96f6b5abedccd1b820066bc9f1f7ac

See more details on using hashes here.

File details

Details for the file Pynopticon-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: Pynopticon-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for Pynopticon-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 acbbc2f0cf57a25a0d38057f483ca9415f99dabe7a7a20d44af3fba2a77a6551
MD5 e5646e50626922d539983debfea785df
BLAKE2b-256 77eb31eb6456631ab81819ccb50d4a37afb1d4bceef83c35415ebfe8a215a0e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page