New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capture_continuous returning empty frames #55

Closed
fsphil opened this Issue Feb 23, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@fsphil

fsphil commented Feb 23, 2014

I've got a very simple program written which should capture 20 low resolution YUV frames. All the files are empty (0 bytes long) except for the very first one:

#!/usr/bin/python

import picamera

# Open the camera
c = picamera.PiCamera()
c.resolution = (48, 40)
c.framerate = (25, 2)

count = 0

for foo in c.capture_continuous('/tmp/frame{counter:02d}.yuv', 'yuv', True):
        print "Got frame"
        count += 1
        if count == 20:
                break

I'm I misunderstanding the API or have I hit a hardware issue with the odd resolution?

@waveform80 waveform80 added the bug label Feb 26, 2014

@waveform80 waveform80 added this to the 1.3 milestone Feb 26, 2014

@waveform80 waveform80 self-assigned this Feb 26, 2014

@waveform80

This comment has been minimized.

Owner

waveform80 commented Feb 26, 2014

Interesting. I can definitely reproduce the issue, but I'm not sure what's going on yet. I don't think it's down to the odd resolution as I get exactly the same result at "normal" resolutions, and furthermore if it can do one successful capture there's no reason it shouldn't do more. This feels more like the encoder is failing to re-activate the still port (but I don't think it's that either or we should be seeing an error in the encoder's start() method). Anyway, it's definitely a bug so I'll look into getting it fixed for the next release (though I don't have a date planned for that yet - and I'm probably not going to have time to look at this again until the weekend as I'm a bit swamped prepping for the Raspberry Jamboree this week!)

@waveform80

This comment has been minimized.

Owner

waveform80 commented Feb 26, 2014

Aha! I've figured it out - it's down to the fix for over-length raw captures that went in in 1.0. It breaks both capture_continuous and capture_sequence for raw captures (which is also missing from the tests). The counter that determines when to stop outputting never gets reset after it reaches zero unless the encoder is recreated, which it isn't with these methods.

Anyway, I'll get a fix in for the next release. Thanks for the well written bug report!

@fsphil

This comment has been minimized.

fsphil commented Feb 26, 2014

Thanks for looking at this!
I'll work around this for now by using jpeg, and let you know how it goes after the next release.

@waveform80 waveform80 closed this in 8e33eb4 Mar 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment