Coder Social home page Coder Social logo

Comments (5)

waveform80 avatar waveform80 commented on April 28, 2024

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.

mjmare avatar mjmare commented on April 28, 2024

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.

waveform80 avatar waveform80 commented on April 28, 2024

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.

waveform80 avatar waveform80 commented on April 28, 2024

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.

mjmare avatar mjmare commented on April 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.