Code Monkey home page Code Monkey logo

Comments (6)

arrufat avatar arrufat commented on June 16, 2024 1

Yes, it works, thank you!

from dlib.

pfeatherstone avatar pfeatherstone commented on June 16, 2024 1

If you had compiled your example with DLIB_ASSERT statements enabled it would have thrown "frame doesn't have correct format". This is a good example of why we should discourage users to use ffmpeg::frame instances directly, and instead use dlib image container types. The documentation should be clear on how to use them and convert to and from dlib objects. However, you can still make mistakes. If you use the API to read directly into matrix<rgb_pixel> objects for example (or array2d<bgr_pixel> or whatever) then it should always do the right thing. I have use-cases for using ffmpeg::frame directly as i need to use the untampered YUV frames coming straight out the codec. But those use-cases are rare.

from dlib.

pfeatherstone avatar pfeatherstone commented on June 16, 2024

Yep will check when I get to work

from dlib.

pfeatherstone avatar pfeatherstone commented on June 16, 2024

Yep. It's not a bug with the implementation details or ffmpeg version, it's the example. When reading "ffmpeg::frame" instances, we're not asking it to convert pixel format to RGB. They are coming out as YUV. The easiest thing is to use the simpler API and read directly into array2d<rgb_pixel>. I'll submit PR.

from dlib.

pfeatherstone avatar pfeatherstone commented on June 16, 2024

I have a PR. Let me know if that fixes it on your end. Cheers

from dlib.

davisking avatar davisking commented on June 16, 2024

We can also use DLIB_CASSERT which is always activated for key functions. Like where we think it doesn't have a meaningful performance impact in any use case and would catch what's likely to be a common user error.

from dlib.

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.