Comments (4)
Okay, I've figured this one out now. The problem isn't so much split_recording, but split_recording after a video-port still capture has been taken. Eliminate the video-port still capture and split_recording works fine. In 1.1, some code was introduced that causes the encoder classes to explicitly stop the camera from capturing once a frame has been received (this change was partly made to fix some issues with raw captures returning much more data than they should). However, this also means that as the video recording and video-port based captures share a camera port, the capture method is stopping the camera port that the continuing video recording is relying on.
A simple workaround for anyone desperate for one is to delete (or comment out) lines 328-331 in encoders.py
(which will be in /usr/share/pyshared/picamera
, or /usr/local/lib/python2.7/picamera
depending on how you installed):
mmal_check(
mmal.mmal_port_parameter_set_boolean(
self.camera_port, mmal.MMAL_PARAMETER_CAPTURE, mmal.MMAL_FALSE),
prefix="Failed to stop capture")
This will fix taking video-port based captures and then using split_recording, but will also reintroduce the issue with raw captures mentioned above. I'll try and figure out something which will fix both problems tonight/this weekend and get out a new release ASAP.
from picamera.
Using the current picamera, in particular camera.record_sequence(), I am sometimes seeing this error 'Timed out waiting for an SPS header' as mentioned here: http://www.raspberrypi.org/forums/viewtopic.php?f=43&t=56478&start=225#p543593
it seems to happen more often at low framerates, like fps = 5, and with VBR. I did not see it with fixed bitrate at fps = 25.
from picamera.
Interesting - at the moment, picamera has a hard-coded limit of 10 seconds (which I picked arbitrarily) before it'll give up waiting for an SPS header (which indicates a valid split point). I added the limit after experiencing a few hangs with split_recording in testing (various configurations, like VBR, fail to produce SPS headers with the current firmware so this was simply added to ensure my test suite would actually finish most of the time!). 10 seconds seemed reasonable for 30fps (and above) but I didn't consider recording with slower speeds. The timeout should really be based on the camera's configured framerate and the intra_period (as SPS headers always precede an I-frame as far as I can tell). I'll open a ticket for this as it shouldn't be too hard to add. In the meantime, try experimenting with the intra_period parameter as that should be able to provide a work-around (albeit at the cost of more I-frames and therefore less compression).
from picamera.
Thanks for looking into it. I thought the code would wait for a certain fixed number of frames, rather than a certain number of wall-clock seconds. But if you know what the encoder's intra-period is, I guess that is the real limit.
from picamera.
Related Issues (20)
- Easy way to tap off frames pre-encoding
- python3-picamera package depends on python3-numpy
- What is the default intra-frame period? HOT 2
- Limited running time HOT 1
- Not supported in bullseye Raspberry Pi OS version HOT 3
- Jumping exposure time on Raspberry Pi HQ camera HOT 1
- [Docmentation] How to find out the Bayer pattern from the CFA layout HOT 2
- Can one access both frames from the OPQV-dual stream and output the difference in real time? HOT 2
- libmmal.so: cannot open shared object file: No such file or directory HOT 6
- Frame freezes whilst try display/save high resolution frame HOT 1
- shutter_speed TypeError HOT 12
- Cannot install on development machine
- No such file or directory HOT 1
- PiCamera start_preview blocks indefinitely
- Realtime Motion Detection Latency
- Camera eposure time doubled from shutter speed?
- Is the `PiBayerArray.flush` method unpacking data correctly?
- 4.16. Raw Bayer data captures - Example Code - Assertion Error
- mjk
- stereo mode: how to switch camera sides HOT 2
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 picamera.