Comments (5)
Interesting - I don't get the exception at the end when I try it on my Pi, but I am able to replicate the issue with the filename generation under Python 2.
Under Python 3 it functions correctly, and it also functions correctly under Python 2 when the continuous()
method is fed a unicode
string, but when it's fed a bytes
string it fails (because continuous()
is explicity checking for str
which I've aliased to unicode
for compatibility with Python 2). So ... simple work-around on Python 2 for now is to make your filename template a unicode
string:
for i, filename in enumerate(camera.continuous(u'image{counter:02d}.jpg')):
print(filename)
...
For the next release, I'll make sure both unicode
and bytes
strings work with continuous()
on Python 2. On Python 3 I should warn that bytes
strings fed to the method will continue to fail as bytes
doesn't support the format()
method in Python 3 (it does in Python 2 though).
Many thanks for the well written bug report!
from picamera.
That's quick ;-)
You're spot on. Changing the filename string to unicode fixes the problem. I'm using python 2.7.3 as you already guessed.
BTW how many fps do you get with continuous capture?
Thanks
Marcel
On 15 okt. 2013, at 22:22, Dave Jones [email protected] wrote:
Interesting - I don't get the exception at the end when I try it on my Pi, but I am able to replicate the issue with the filename generation under Python 2.
Under Python 3 it functions correctly, and it also functions correctly under Python 2 when the continuous() method is fed a unicode string, but when it's fed a bytes string it fails (because continuous() is explicity checking for str which I've aliased to unicode for compatibility with Python 2). So ... simple work-around on Python 2 for now is to make your filename template a unicode string:
for i, filename in enumerate(camera.continuous(u'image{counter:02d}.jpg')):
print(filename)
...For the next release, I'll make sure both unicode and bytes strings work with continuous() on Python 2. On Python 3 I should warn that bytes strings fed to the method will continue to fail as bytes doesn't support the format() method in Python 3 (it does in Python 2 though).
Many thanks for the well written bug report!
—
Reply to this email directly or view it on GitHub.
from picamera.
The fps seems to depend on several things including the resolution of the capture, the amount of ambient light, and even the overclocking of the Pi. The maximum I've managed so far is 4fps, but I'm hopeful of increasing this. There was a fascinating thread on the forums the other day where someone was experimenting with setting the video port of the camera to JPEG format (I had no idea this was possible!). I was hoping to have some time experiment with this at the weekend, but other things got in the way; it's logged as issue #2 though and I'm hoping to get some experiments with it done before the next release this weekend.
from picamera.
I should add that's 4fps at 720p, and was without the preview running (running the preview definitely slows things down, but also prevents any frames coming back blank which does happen otherwise unless you're careful with pauses between captures).
from picamera.
OK, I should get my hopes up then ;-)
Marcel
On 15 okt. 2013, at 23:03, Dave Jones [email protected] wrote:
The fps seems to depend on several things including the resolution of the capture, the amount of ambient light, and even the overclocking of the Pi. The maximum I've managed so far is 4fps, but I'm hopeful of increasing this. There was a fascinating thread on the forums the other day where someone was experimenting with setting the video port of the camera to JPEG format (I had no idea this was possible!). I was hoping to have some time experiment with this at the weekend, but other things got in the way; it's logged as issue #2 though and I'm hoping to get some experiments with it done before the next release this weekend.
—
Reply to this email directly or view it on GitHub.
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.