VideoFrameSource that pulls frames from a camera via TinyCamera (https://github.com/pschatzmann/TinyCamera) - so it works on every platform TinyCamera supports (ESP32 via esp32-camera, ESP32-P4 MIPI-CSI via ESP_Video, RP2040, STM32, desktop). nextFrame() returns the buffer of a freshly captured frame, returning the previous one to the driver first; as with any VideoFrameSource, the returned pointer is only valid until the next nextFrame() call.
More...
#include <CameraFrameSourceTinyCamera.h>
|
| | CameraFrameSourceTinyCamera ()=default |
| |
| bool | begin (const camera_config_t &config, float fps) |
| |
| tiny_camera::TinyCamera & | camera () |
| | Access to the camera, e.g. for sensor tuning (camera().sensor()).
|
| |
| void | end () |
| | Returns the last captured frame (if any) and releases the camera.
|
| |
| const uint8_t * | nextFrame (size_t &len) override |
| |
| VideoInfo | videoInfo () override |
| | Width/height/format determined by begin(), and the fps given to it.
|
| |
| bool | writeTo (Print &out) |
| | Write the frame to the indicated destination.
|
| |
VideoFrameSource that pulls frames from a camera via TinyCamera (https://github.com/pschatzmann/TinyCamera) - so it works on every platform TinyCamera supports (ESP32 via esp32-camera, ESP32-P4 MIPI-CSI via ESP_Video, RP2040, STM32, desktop). nextFrame() returns the buffer of a freshly captured frame, returning the previous one to the driver first; as with any VideoFrameSource, the returned pointer is only valid until the next nextFrame() call.
begin() captures one probe frame to determine width/height/format, so videoInfo() is complete right after it (as VideoMuxer::begin() requires) without any frame_size lookup table. Only the frame rate has to be given, since a camera has no fixed one: use the rate you actually want to capture (and encode) at.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ CameraFrameSourceTinyCamera()
◆ begin()
| bool begin |
( |
const camera_config_t & |
config, |
|
|
float |
fps |
|
) |
| |
|
inline |
Initializes the camera and captures a probe frame to determine width/height/format - see the class comment.
- Parameters
-
◆ camera()
| tiny_camera::TinyCamera & camera |
( |
| ) |
|
|
inline |
Access to the camera, e.g. for sensor tuning (camera().sensor()).
◆ end()
Returns the last captured frame (if any) and releases the camera.
◆ nextFrame()
| const uint8_t * nextFrame |
( |
size_t & |
len | ) |
|
|
inlineoverridevirtual |
Returns the previous frame (if still held), captures a new one and returns its buffer - nullptr (len 0) if the capture failed.
Implements VideoFrameSource.
◆ toVideoFormat()
◆ videoInfo()
◆ writeTo()
| bool writeTo |
( |
Print & |
out | ) |
|
|
inlineinherited |
Write the frame to the indicated destination.
◆ camera_
| tiny_camera::TinyCamera camera_ |
|
protected |
◆ frame_
| tiny_camera::TinyCameraFrame frame_ |
|
protected |
◆ info
The documentation for this class was generated from the following file: