Closed tsuncp closed 8 years ago
Confirmed, I'm also seeing the same error.
Finally found some time to look into this - it's strange given that the test suite should have picked this up. Probably means there's some issue in my test setup...
Damn. Well, that was annoyingly easy. There was indeed an issue in the test setup: the box I thought was running the suite under Python 3 ... was running it under Python 2 (so I was just testing the library twice under Python 2); I'd switched to using two boxes for testing to speed things up a bit (given the test suite takes ages to run) but the 3 box had the old venv from the 2 box as well as its py3 venv, and the test config was still pointing at the old venv.
The actual bug itself is also annoyingly trivial ... here's the patch:
diff --git a/picamera/encoders.py b/picamera/encoders.py
index 73ff360..c4a69f9 100644
--- a/picamera/encoders.py
+++ b/picamera/encoders.py
@@ -531,7 +531,7 @@ class PiRawMixin(PiEncoder):
# port format is set (height is aligned too, simply for consistency
# with old picamera versions). Warn the user as they're not going to
# get the resolution they expect
- if not resize and format != 'yuv' and input_port.name.startswith('vc.ril.video_splitter'):
+ if not resize and format != 'yuv' and input_port.name.startswith(b'vc.ril.video_splitter'):
# Workaround: Expected frame size is rounded to 16x16 when splitter
# port with no resizer is used and format is not YUV
fwidth = mmal.VCOS_ALIGN_UP(width, 16)
Yup ... that's it. A missing "b". I'll push the fix in a mo, and this is probably serious enough to warrant a point release to fix it, but I'm not sure I've got time for that this weekend.
Nice, congrats on resolving the issue! For what it's worth, I would definitely agree that this is worth a point release to fix. Based on this post alone on PyImageSearch I get at least 1 comment and 2-3 emails per day asking about the error. Based on this, I can imagine there are multiple orders of magnitudes of people getting the error. Updating to 1.12 will at least ensure that a standard pip install will work on both Python 2.7 and Python 3.
Also, if you would like me to do a blog post announcing the fix in the latest version and document the bug (just in case 1.11 users run into it), just let me know. At the very least, that will resolve any Google searches related to the bug, and it will serve as a place to document how to resolve the error if you see it.
Okay - I'll try and find some time to get another release cranked out tomorrow. Hopefully, little enough will have changed from the last release that the packaging scripts still work (I swear, every time I go to build packages something changes to break my stuff - though last time it was PyPI instead of debuild!). Just finished a full run of the test suite under py3 and there's a couple more issues that look similar (bytes vs unicode things), so I'll patch those in a mo too.
Using RPI3; Kernel 4.4.14-v7+ #895, OpenCV 3.1.0, Python 3.4.2. The PiCamera isn't showing when running on script. I was attempting to do lane detection or speed detection using OpenCV 3.1.0. But it was working before for 5 months. But right now, it doesn't showing anything after I upgrading Kernel 4.4.14.
Here is error msg:
Image width in feet 77 at 76 from camera
Traceback (most recent call last):
File "/home/pi/opencv31_projects/speed_detector/speed_detector/speed_detector.py", line 131, in
Any hint u can help.
@supra2016 that sounds like this issue, which was corrected in picamera 1.12. Please check which version of picamera you're using (see the FAQ for details) - if it's 1.11 you need to upgrade to 1.12.
Incidentally, although 1.12 is in PyPI at the time of writing, it's still not hit the Raspbian repositories yet, so upgrading to 1.12 requires a "pip" install (I'll see if I can chase someone about getting "apt" up to date).
@waveform80 There are nothing with pi camerea. I been testing with https://www.raspberrypi.org/learning/getting-started-with-picamera/worksheet/ But if I used someone source codes, it will not work.
Unfortunately, I upgraded but doesn't work. I used sudo pip3 install picamera
Sudo pip3 install picamera --upgrade ? 「supra2016 notifications@github.com」在 2016年7月15日 週五,下午5:15 寫道:
@waveform80 https://github.com/waveform80 There are nothing with pi camerea. I been testing with https://www.raspberrypi.org/learning/getting-started-with-picamera/worksheet/ But if I used someone source codes, it will not work.
Unfortunately, I upgraded but doesn't work. I used sudo pip3 install picamera
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/waveform80/picamera/issues/297#issuecomment-232902470, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1XH0UJ2OecgDwXAuy8kpFJXUVDBXPEks5qV0--gaJpZM4I5ctB .
@tsuncp Thank you very much. New version picamera has been upgraded to 1.12
I am using the latest version 1.11 of picamera , 1.11.0 of numpy ,python 3.4 and virtualenv
I follow the code from document
But I have got TypeError : startswith first arg must be bytes or a tuple of bytes , not str
I also upgraded to the latest firmware.