lit-robotics / libcamera-rs

Experimental Rust bindings for libcamera
Apache License 2.0
46 stars 15 forks source link

Video Recording / Streaming #1

Closed Maufeat closed 1 year ago

Maufeat commented 1 year ago

First off, thanks for creating this binding.

Is there any example on how I can start recording? I use the ArduCam 64MP Hawk-Eye. MJPEG is natively not supported. Just NV12, RGB888, XRGB8888

Thanks for any help :)

chemicstry commented 1 year ago

Hey,

The jpeg_capture example forces MJPEG format so that frame data could be saved directly into .jpeg file without any encoding. If you removed this assert, camera would probably generate a configuration with one of the supported formats. It is up to you, however, to save the raw data in an appropriate format that can be used somewhere else. libcamera is quite a "low level" library after all. If you looked at libcamera-apps they have a lot of code dedicated to encoding.

Regarding streaming/recording, you just requeue capture requests when they are completed to produce a continuous stream of frames.

chemicstry commented 1 year ago

There is now a recording example with #5