Giter Club home page Giter Club logo

Comments (6)

0xC0000054 avatar 0xC0000054 commented on June 12, 2024

...you have to wait for the initial save operation to complete.

That is correct.
AOM does not currently provide a progress reporting API for the encoder, so the progress reporting / cancellation step occurs before sending the encoded frame back to Paint.NET.

I am not sure why AOM does not have a progress reporting API, WebP is also a Google-backed project and it has one.
Hopefully one will be added in a future release, but it does not look like there are any issues in the AOM bug tracker for an encoder progress reporting API.

from pdn-avif.

rickbrew avatar rickbrew commented on June 12, 2024

Does it do all of the compression in-memory? There's no way to hook it in any way?

For some codecs, throwing an exception from Stream::Write() can do the trick.

So unless you can provide some kind of callback, your best shot is to host it out-of-process and terminate it when cancellation is needed. (don't terminate threads!) And that can be a lot of work.

from pdn-avif.

0xC0000054 avatar 0xC0000054 commented on June 12, 2024

Does it do all of the compression in-memory?

I believe so.

There's no way to hook it in any way?

Not any easy ones.
It would require changes to the AV1 encoder and the public AOM encoder API.
I am considering opening an issue on the AOM bug tracker, the people there would be able to provide better information on if an encoder progress reporting API is feasible to implement.

So unless you can provide some kind of callback, your best shot is to host it out-of-process and terminate it when cancellation is needed. (don't terminate threads!) And that can be a lot of work.

That would be a lot of work.
I have no idea how I would implement the IPC required for hosting the encoder out-of-process.

from pdn-avif.

rickbrew avatar rickbrew commented on June 12, 2024

IPC in this case is probably done with a combination of ...

  • Hoist the encoder into a command-line EXE that takes parameters
  • One of the parameters is a HANDLE for a shared memory section and maybe another for some kind of event signal handle. See SingleInstanceManager for an example of shared memory, and UpdateMonitor for an example of passing a HANDLE to an external process (and be sure to inspect the code that "calls" it!). It's certainly ugly, but not a hack.

But I wouldn't rat-hole on this too much unless your dopamine compass is strongly pulling you in this direction. PDN should really host all FileTypes out-of-process. Some day ...

edit: fixed a typo. should be SingleInstanceManager, not SingleUseCriticalSection

from pdn-avif.

rickbrew avatar rickbrew commented on June 12, 2024

Although for the IPC you'd probably want to use a pipe.

Still a big huge ball of crazy that's nice to be avoided if possible.

from pdn-avif.

0xC0000054 avatar 0xC0000054 commented on June 12, 2024

I opened a feature request for a progress reporting / cancellation API on the AOM issue tracker.
https://bugs.chromium.org/p/aomedia/issues/detail?id=2837

from pdn-avif.

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.