waveform80 / picamera

A pure Python interface to the Raspberry Pi camera module
https://picamera.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.57k stars 355 forks source link

Easy way to tap off frames pre-encoding #707

Open rossGardiner opened 3 years ago

rossGardiner commented 3 years ago

Hello,

My application requires an encoded h264 stream and a raw RGB/RGBA stream for further processing. Currently this is implemented by starting two streams from different split ports. This solution often throttles the encoder and causes frame skips, similar to https://github.com/waveform80/picamera/issues/668#issue-777159555 (especially since I execute on a RPi Zero w).

Is there an easy-ish way to tap off raw frames from the h264 encoder before encoding? (may involve writing a custom encoder). It is not clear from the library whether I could expect this solution to perform better than the double stream I have implemented.

Advice appreciated. Thanks, Ross