Métriques du dépôt
- Stars
- (1 958 étoiles)
- Métriques de merge PR
- (Métriques PR en attente)
Description
Av1an's functionality outside of a command-line interface is very valuable and should be refactored such that it can be leveraged as a dependency in other projects. This does not mean Av1an should not be a command-line utility, rather it should be split into a library and a command-line interface and can both be developed in the same repository. The distinction between av1an and av1an-core is already an indication that this was a considered possibility in the future but the current structure makes it difficult to do something like call a single function to encode a specific chunk and get realtime progress programmatically.
Without specifying every single possibility, I'll instead offer this workflow scenario to exemplify how this refactor would work:
- Detect scenes of video.mkv. Subscribe to a channel that reports progress. Returns a list of scenes.
- Iterate through every scene: Perform Target Quality in advance. Each probe also has a channel that reports progress or the parent function can report aggregate progress of the entire chunk. Returns the probing results.
- Iterate through every scene: Encode and report progress in a channel. Returns the encoded chunk path.
- Iterate through every scene: Measure quality and report progress in a channel. Returns the quality results.
- Generate a report and quality plot from the results.
- Demux the audio, subtitles, chapters, attachments, etc. from video.mkv. Allow addressing specific tracks with custom arguments.
- Mux the encoded chunks and processed audio, subtitles, chapters, attachments, etc. into a single video.
Another scenario:
- Connect to server.
- Submit encoding task for every scene.
- Perform encoding tasks along with N other clients. Retrieve task, encode and report progress in websocket, upload encoded chunk to server, repeat.
- Wait for completion from all N clients.
- Download the encoded chunks from the server.
- Multiplex the encoded chunks.
Most of these tasks can be performed with the commandline interface but with limitations and issues like being unable to programmatically read progress (#366) or perform Target Quality separately from encoding can all be resolved by refactoring these atomic tasks into their respective functions. Distributed encoding is one of the next major goals for Av1an and this refactor is a necessary step to making that possible. The same can be said for implementing a graphical user interface - something I have personally implemented but with many limitations and unsightly hacks.
Additionally, the readme refers to cargo.io (should be updated to crates.io) and will need to be updated on Av1an's next release. Av1an can remain a command-line interface and be published the same way, but the av1an-core could also be published to do all of the aforementioned.
Thank you, - Boats M.