Comments (11)
Hi @pietermarsman, thank you for the report. To start with, what sensor are you using, and what resolution still image capture are you looking for? Is it going to be full sensor resolution, or will something like 1080p (i.e. same as the video encode) be good enough? Because of the limited throughput of the VC4 ISP, we are unfortunately not able to pass through large (i.e. > 5Mpix) resolutions through the ISP at full video rates, so there will be certain limitations to work around.
Although libcamera apps can be bent to do what you want here, it might be better to look at picamera2 for such tasks. In fact, one of our examples does pretty much this! I'm sure @davidplowman can provide more details on this script if you need.
from libcamera.
Hi @naushir, thanks for the link to the picamera2 script. I'll try that and see if it does what we need it to do.
We are using the imx219 and imx477. Code is running on a compute module 4 (=raspberry pi 4). The still capture resolution should be 1080p or higher, with hq noise reduction. The video can be lower quality but should be faster than 20 fps. My expectation was and is indeed that those two requirements cannot be combined in one configuration, and hence my question about changing the configuration dynamically.
Currently we are using picamera based on mmal but it has some stability issues when recording videos for a long time. Also we integrate it into a golang code base, so its easier to use c/c++ directly.
Also good to know, we are integrating it into our product so I have plenty of development time. In fact, I reserved the entire month of December for this 😄
from libcamera.
Any dynamic re-configuration is going to cause interruptions in the video stream, this is unavoidable. We can look to ways of minimising this if needed. However to start with, I would look at the picamera2 script, setup a video/capture resolution of 1920x1080, and evaluate the quality to see if it is acceptable.
from libcamera.
I'll definitely do that. Thanks for the help so far!
from libcamera.
I've checked out the script. I think it works like this:
- The
picam2.create_video_configuration
configures the camera for high framerate. E.g. it uses fast denoising. - The original capture from the camera is half its sensor resolution, this is probably fast because it can use 2x2 binning.
- The video is recorded in 640x480. The image is captured in half the sensor resolution.
I can see that this works, and why it works. The camera is configured with just one configuration with multiple streams.
Since the overall framerate is determined by the slowest stream this does not fit my usecase. I want to run the video at high framerates 99% of the time. And very occasionally capture a high-quality image. E.g. an image that would have been captured with the picam2.create_still_configuration
settings. I'm still wondering what the best way to do this is. And what you would recommend in this scenario.
(Thanks for your help so-far, I'm still reading through the docs and trying things out 😄 )
from libcamera.
The picam2.switch_mode_and_capture_file
looks pretty interesting to me. From what I can see that switches to another mode and captures a high-quality image in about 1 second. So also 1 second of frame drop.
from libcamera.
Yes, unfortunately with the hardware we have there really is no way round this. You can have 12MP, but you will max out at 10fps. Or you can have 30fps but that will max out at 3MP. And switching between camera modes involves stopping the sensor, re-programming and re-starting it which is relatively slow.
from libcamera.
As @davidplowman noted, the solution comes down to a choice of either:
- A lower resolution stills capture to avoid any glitches in the video stream.
- A high resolution stills capture if approx. 1s of glitches in the video stream are acceptable.
from libcamera.
There is another option (3) that perhaps you might want to consider:
- Use the camera v2 instead of the HQ camera. This allows you to use a 8MPix 20fps mode. Based on some quick calculations, it ought to be possible for the ISP to achieve the 8*20 = 160 MPix/s. Then you might get a glitch-free video encode stream, and a 8Mpix still capture periodically. You may have to try this out and tuning framerates and output resolutions to see what exactly is achievable.
from libcamera.
Is there anything more to look at here? If not, I'll close this issue down.
from libcamera.
Closing now. Feel free to re-open if you still require more information.
from libcamera.
Related Issues (20)
- Specific reason for using shared_library over library? HOT 2
- [HOW-TO] Run AutoFocus only on a specific range of lenses HOT 3
- [BUG] libcamera fail with IMX 219 with both latest version linux and 6.1.65 version linux HOT 6
- Libcamera problems on RPi4 Ubuntu HOT 1
- Bugged Lines HOT 2
- Missleading Build Instructions HOT 2
- Unable to build libcamera with Python bindings HOT 4
- IMX519 on bookworm
- RPI4B OV5647 Camera black screen! HOT 7
- libcamerasrc doesn't work with CM4 RPI Cam V2 and V3 HOT 5
- Can't start gstreamer pipeline after update HOT 4
- Raspberry Pi Camera Module 3 not available on RPi 5/bookworm HOT 2
- False colours from global shutter camera on RPi5 HOT 3
- Enabling sensor HDR for Camera Module v3 HOT 2
- RPI5 - Omnivision 9281 8 Bit Mode HOT 6
- No json for imx290 HOT 1
- libcamerify causes motion daemon to create zombie processes HOT 26
- "libqt5widgets" doesn't exist did you mean "libqt5widgets5" in your readme? HOT 2
- libcamerify causes motion daemon to create zombie processes
- `
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libcamera.