Issues when testing 1.13 new features (The MMAL Tour in the doc)
See original GitHub issueHello all and well done for the work on picamera.
This library will be very useful on a project I am working on, especially the new features 1.13 version is adding. I’d like to add some information drawn over a record, so I’m triing to make the examples of “The MMAL Tour” working. The first samples are working well, but when it arrives to what I want, I have some problems to make them work.
For example, I tested the 16.1.11 Python Components example which can be summarized by :
from picamera import mmal, mmalobj as mo
from picamera import array
camera = mo.MMALCamera()
preview = mo.MMALRenderer()
class Crosshair(array.PiArrayTransform):
def transform(self, source, target):
with source as sdata, target as tdata:
tdata[...] = sdata
tdata[240, :, :] = 0xff
tdata[:, 320, :] = 0xff
return False
transform = Crosshair()
camera.outputs[0].framesize = (640, 480)
camera.outputs[0].framerate = 30
camera.outputs[0].commit()
transform.connect(camera.outputs[0])
preview.connect(transform)
transform.connection.enable()
preview.connection.enable()
transform.enable()
and this code doesn’t do anything. What am I doing wrong ? What do I forget ? I tried to eliminate some commands in the previous chapters to keep only the ones that should be necessary for the example …
16.1.9 example didn’t work either, but it seemed to be more complicated that this one.
By the way, I have pointed out some misprint in the doc, where can I spot them ?
Thanks for all 😃
Jean-Rodolphe Letertre
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Apologies I haven’t got time to work on this at the moment (it’s going to be at least another month before I get free time for picamera again). For anyone wanting to play with older versions:
Learn about virtualenvs. There’s the virtualenv user guide or pipenv guide or probably plenty of others. Anyway, learn it, get comfortable with it.
Once you’re in a venv you can pip install any version of picamera at all; I never delete old versions from PyPI so everything back to 0.3 (the first version released on PyPI) is still available. Just do
pip install picamera==1.12
(or whatever version you fancy).You can also
git clone
this repository and hack on the code yourself within a venv (there’s development instructions in the documentation).Sadly I haven’t got much time to look into this, but I can confirm the issue and the proposed workaround by @JimKnowler. Unfortunately that doesn’t help much: read the commit message and you’ll see that reverting that commit just breaks #311 again. There’s obviously something about MMAL’s output buffer handling that I’m not understanding (and hence which goes wrong when the Python-side of the mmalobj components are used). Unfortunately, the pure Python components in
mmalobj
are of extremely niche interest compared to havingcapture_continuous
work properly so until I/someone can come up with a “proper” fix things will have to stay as they are.That said, if you’re playing around with mmalobj, I expect you’re more than capable of reverting a commit so I don’t feel too guilty 😉