Coder Social home page Coder Social logo

Comments (4)

martinohanlon avatar martinohanlon commented on April 29, 2024

I was thinking something similar and grouping encoder_data together. I was actually thinking a static class with properties but a tuple would be a simpler implementation. I share your thoughts though that frame should probably be renamed.

from picamera.

waveform80 avatar waveform80 commented on April 29, 2024

FYI, a namedtuple (derived from tuple) basically is a static class with properties (its implementation in the collections module is a bit of a hack that involves eval() but to be honest I couldn't come up with a better way of designing it :). Still, that sounds like the way to go - and makes future expansion of the facility easy as I can just extend the namedtuple with more fields.

What source of encoder data were you hoping to combine with this? If they're equally easy to grab I'm more than happy to extend the ticket to include them.

from picamera.

martinohanlon avatar martinohanlon commented on April 29, 2024

I see, namedtuple does sound like the way to go. Other data that springs to mind, although it might not be easily accessible:

  • size, total size of the video
  • length
  • dropped frames

from picamera.

waveform80 avatar waveform80 commented on April 29, 2024

Size is certainly possible - I'll add properties for the size of the current frame and the total size of the video recorded so far (bytes). It should also be possible to add a property for the size of video since the last call to split_recording().

Isn't length (which I'm assuming is the duration of the video recorded so far) equivalent to PTS? I'll have to experiment with this a bit and see if the reading from the pts field in the buffer header starts to vary from the wall-clock.

Not sure about dropped frames - picamera itself has no facility for dropping frames in the case of over-run - it rather dumbly assumes that whatever stream the user gives it is capable of handling the throughput. As far as I'm aware there's no facility for asking MMAL if the encoder's dropped any frames either - but if you know of one I'm happy to look into it.

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.