Skip to main content

Python "API" for interacting with rusty-engine

Project description

upgraded-engineer

Code style: black PyPI

upgraded-engineer is a Python library for interacting with rusty-engine.

Installation

pip install upgraded-engineer

Dependencies

  • GStreamer (base and bad plugins required for upgraded-engineer, more required by rusty-engine)
  • Open CV (known working with >= 4.0.0, must be compiled with GStreamer support)

Usage

Importing is simple:

import engine

To simply start a new rusty-engine process, create an instance of the engine.Engine class. You will have to figure out how to write frames into the shared memory yourself. (Note that rusty-engine is expecting I420 color, and cannot determine what is being written for itself.)

Alternatively, using engine.EngineWriters provide the write_frame method to write "normal" Open CV BGR color frames into shared memory for streaming.

import engine
# see also: engine.GStreamerEngineWriter for a GStreamer-only impl
ew = engine.OpenCVEngineWriter()
# alternately, if we wanted smaller video
ew = engine.OpenCVEngineWriter(video_size=(426, 240, 30)) # width, height, framerate

Now, writing frames into shared memory is simple.

def on_new_frame_whenever_that_is_for_you(frame):
    ew.write_frame(frame) # ew.write_frame handles the BGR to I420 conversion automagically

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

upgraded-engineer-0.2.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

upgraded_engineer-0.2.1-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

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