coloradocube / balloonsat

COTS balloonsat mission to test the RPi 4 with a battery UPS, a quad camarray, a GPS module, a RockBLOCK module, and a small number of Qwiic sensors
0 stars 5 forks source link

Notes on RPi camera #5

Open ivogeorg opened 2 years ago

ivogeorg commented 2 years ago

Guide: https://projects.raspberrypi.org/en/projects/getting-started-with-picamera Vendor page: https://www.raspberrypi.com/products/camera-module-v2/

Investigate:

  1. Storage capacity. Calculate total for mission duration.
  2. Speed, bandwidth.
  3. Compression?
  4. Processor load.
ivogeorg commented 2 years ago

@mattbingaman says get a big SD card and partition for OS and storage. Perfect!

ivogeorg commented 2 years ago

1 TB SD card ordered for recording video. Need to partition, burn OS on one partition, and a file system for media files.

ivogeorg commented 2 years ago

Randy's is v1 with tele lens. @seanmd23 got it to work with RPi 3. Required updating to Rasbian 10 Buster.

I have a v2 along with a 512 SD card to stress-test the processor with and record.

ivogeorg commented 2 years ago

In the Raspberry forum there is a recommendation to store on USB-connected external storage instead of SD card.

ivogeorg commented 2 years ago

Setup

  1. RPi: 4
  2. Camera: v2 standard
  3. Software: PiCamera
  4. Resolution: Default for video at 1920x1080.

Results

  1. A 90 second video recording comes in at under 200 MiB.
  2. Higher sizes correspond to more complicated scenes. Take 250 MiB on the outside. In space, the scene will be simple.
  3. CPU usage didn't pass 8% (from Task Manager).

Projections

  1. The flight is estimated to last 1.5 hours.
  2. Take 2.5 hours on the outside. This is 150 minutes.
  3. If we shoot continuous video, throughout the flight, this will require 150 min x 60 sec/min x 0.6667 sec/sec x 250 MiB/sec = 1.43 TiB.
  4. For a 90 minute flight, the required storage is 0.86 TiB.
ivogeorg commented 2 years ago

Resizing partitions

  1. RPi Resize Flash Partitions.

@PaulAJanes

ivogeorg commented 2 years ago

Multiple cameras

  1. The RPi has only one MIPI CSI-2 camera.
  2. ArduCam has several multi-camera extensions which appear as one camera to the RPi, but they are only for still images (TODO: Verify)
ivogeorg commented 2 years ago

We are getting an Arducame Quadrascopic camera bundle kit. This might very well require a whole new sub-project with its own issues.

Christopher-Dauchter commented 2 years ago

In the Raspberry forum there is a recommendation to store on USB-connected external storage instead of SD card.

From my personal experience with the Pi's, this is typically a consideration for really long term use, or super high number of read write cycles on a cheap micro sd cards (See MicroCenter's budget cards). My RPI4 NAS has been running 24/7 for about a year on one 64 Gb SanDisk card without issue.

ivogeorg commented 2 years ago

@Christopher-Dauchter found this guide https://elinux.org/RPi-Cam-Web-Interface

ivogeorg commented 2 years ago

@PaulAJanes Latest update. This should be a self-contained Python application.

Functions:

  1. Configure sensors, whatever the number.
  2. Start/run/stop sensors.
  3. Store frames on SD card (partitioned into OS, telemetry, and imaging partitions).
  4. Log into camera log.
  5. Stream over WiFi when on ground and configured. (See #31)
  6. Rules for moments (of time during flight) of interest (e.g. to increase frame rate, etc.).
  7. Rules for storage management (check remaining storage, calculate fill rate, calibrate recording frame rate).
  8. Video should be recorded in episodes, so storage and power consumption can be checked regularly. We don't want to end up with a runaway recording that cannot be shut down gracefully.

image

ivogeorg commented 2 years ago

@bradmag Read through the issue and let's discuss.