Skip to main content

communicate with a lewei camera module

Project description

plutocam

Python package to communicate with a Pluto's camera module.

Pluto Camera Live Stream Setup Guide

Prerequisites

Before setting up the Pluto camera live stream, ensure you have the following prerequisites installed on your system:

  • Python (if not installed already)
  • FFmpeg (for your operating system)

Installation Steps

Step 1: Download FFmpeg

Download FFmpeg from one of the following sources:

Step 2: Install FFmpeg

Follow the installation instructions based on your operating system:

Step 3: Install Python

If Python is not installed on your system, download and install it from the official Python website.

Step 4: Install pylwdrone

Install the plutocam library using pip:

pip install plutocam

Streaming Setup

Step 5: Connect to Pluto Camera

Ensure you are connected to the Pluto camera before proceeding.

Step 6: Start the Stream

Open a terminal and run the following command:

plutocam stream start --out-file - | ffplay -i -fflags nobuffer -flags low_delay -probesize 32 -sync ext -

This command initiates the live stream from the Pluto camera using pylwdrone and FFmpeg.

Additional Resources

For more information refer pluto projects with Python.

Now, you are ready to enjoy live streaming from your Pluto camera!

Example Command-line Usage

Stream live video

$ plutocam stream start --out-file - | ffplay -i -fflags nobuffer -flags low_delay -probesize 32 -sync ext -

Record live video then replay later

$ plutocam rec start
$ plutocam rec stop
$ plutocam rec list
index  start              duration  path
[  0]  20200604_04:01:27        95  /mnt/Video/20200604-040126.mp4
[  1]  20200604_04:10:40        20  /mnt/Video/20200604-041040.mp4
success
$ plutocam rec play 0 --out-file - | ffplay -i -

Example Module Usage

Creating the object

>>> import plutocam
>>> drone = plutocam.LWDrone()

Stream live video

>>> for frame in drone.start_video_stream():
>>>     sys.stdout.buffer.write(frame.frame_bytes)

Get a file

>>> with open('video.mp4', 'wb') as fp:
>>>     drone.get_file('/mnt/Video/20200604-041040.mp4', fp)

Take a picture

>>> with open('picture.jpg', 'wb') as fp:
>>>     fp.write(drone.take_picture().data)

Start and stop recording

>>> drone.set_record_plan()
>>> drone.set_record_plan(RecordPlan(active=False))

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plutocam-0.1.0-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file plutocam-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: plutocam-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.0

File hashes

Hashes for plutocam-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 043b28a56db429dedf95360d0eaada3c31e585c02d8b559af97efbde775fa864
MD5 640bf77309b5b6bc8cd814ba4f368f53
BLAKE2b-256 f3766896e7d99724050050906ccb1b164c1b626d269ff022b4cf74a9a7fb018d

See more details on using hashes here.

Supported by

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