Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
PiCameraCircularIO missing data due to invalid timestamps #357
I've been having problems with copy_to() writing out no data even when my circular buffer is quite large. After some digging, it appears the problem is this:
It's easy to see the issue:
I'm unfamiliar enough with the code to know exactly how this should be handled yet. Is buf.pts expected to be a c_long? I'll do a bit more research and then submit a PR, but I thought I'd document what I have so far here.
OK, so if I add these two lines to MMALBuffer._get_pts() in mmalobj.py:
This is not the result I would have expected, but I have no experience with Python's ctypes.
Wheee! Isn't debugging dynamically typed languages fun!
Last comment before I wait for more knowledgeable people to chime in:
If I modify the code in PiVideoEncoder._callback_write() to extract the ctypes 'value' field as follows:
... everything seems to work.
added a commit
Jan 9, 2017
@dbbnrl nice bit of debugging there! This has been on the list a while, but it's been repeatedly shoved to the bottom of the pile by new feature development (largely mmalobj). Your surmise is absolutely correct: it should be using
I'm just going to check if I can work around this a different way: by using a straight-forward Python int instead of a