Comments (6)
...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.
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.
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.
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, andUpdateMonitor
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 FileType
s out-of-process. Some day ...
edit: fixed a typo. should be SingleInstanceManager
, not SingleUseCriticalSection
from pdn-avif.
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.
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)
- Saving at 100% quality produces corrupted colors (in some other apps) HOT 8
- Label for Quality is in the wrong place
- Access Violation in CompressImage() (v1.0.5.0) HOT 7
- Error when saving file with 4:4:4 Chrome Subsampling, 4:2:2 went OK. pdn-avif v1.1.0
- Any chance you could create a nuget package just for loading and saving avif images? HOT 1
- ARM64 build of native dll? HOT 3
- Crash / failure with latest version bundled with PDN 4.2.15
- Very large AVIF saving is unresponsive HOT 2
- Investigate changing the compression quality behavior to match libavif and libheif
- Paint.net 5 - preview of the file size for avif file - wrong calculation (preview e.g. 170 KB - saved file 189 KB) HOT 1
- AVIF file - incompatible with Android 12 or newer HOT 1
- Created AVIF files don't display in Firefox HOT 3
- Saving takes an amazingly huge amount of memory HOT 20
- AvifNative DLLs are enormous HOT 8
- Should FileType's name be "AVIF" or "AV1" ? HOT 1
- Update readme after bundling HOT 2
- Use IAvifFileTypeString for loading strings
- Add Forum Discussion and GitHub links to the UI
- Consider changing default compression speed to 'Fast' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdn-avif.