GitBib / pymkv2

A Python wrapper for mkvmerge. It provides support for muxing, splitting, linking, chapters, tags, and attachments through the use of mkvmerge.
https://gitbib.github.io/pymkv2/
MIT License
6 stars 4 forks source link

mux function could support a way to output its progress #3

Open rvbg opened 5 months ago

rvbg commented 5 months ago

Is your enhancement request related to a problem? Please describe. When muxing something with mkvmerge it outputs the current progress in percent. The current implementation of mux does not seem to support that information, which would be great to have, especially when running async or when muxing large files.

Describe the solution you'd like Having an event function in the main object, which returns the progress, which is called when new progress information arrives.

Example:

mkv = MKVFile('/path/to/file.mkv')
mkv.remove_track(0)
mkv.mux('/path/to/output.mkv', gui.set_current_progress)

or

mkv = MKVFile('/path/to/file.mkv')
mkv.remove_track(0)
mkv.connect_event_new_progress(gui.set_current_progress)
mkv.mux('/path/to/output.mkv')

Implementation steps

Additional context I implemented something similar a few years ago, which still works, but the code is more a proof of concept, than a good implementation. It can be found here. That function is used in combination with a gui progress bar.

Let me know, if you want help implementing this and the enhancement request from yesterday.

GitBib commented 5 months ago

This is going to take more time. We need to figure out the best way to do it.

rvbg commented 3 days ago

Hi, I'm back to working on my project and will try to implement this. If I'm successful, I'll try to open a pull request. But I've now come across another serious problem and will open a new issue for it.