Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support writing MKV #11

Open
the-hotmann opened this issue Jun 6, 2023 · 1 comment
Open

Support writing MKV #11

the-hotmann opened this issue Jun 6, 2023 · 1 comment

Comments

@the-hotmann
Copy link

I just programmed an app which ready all audios from a MKV, formats it and writes it back, But it does have a lot of dependencies.
Since this programm does have non, I wanted to ask, if this is also able to write back (title/lable) to a MKV file and if so, how to do so - an example would be awesome!

Thanks in advance!

@remko
Copy link
Owner

remko commented Jun 10, 2023

Adding a streaming writer should be very easy. The API of such a writer would be a direct one-to-one dual mapping of Handler.

The question is whether such a low-level writer is enough for you. Once you start modifying data, your index will likely change, so you would be responsible for making sure it is up to date. This would probably mean you need to track all offsets while processing your file, and then either

  • Seeking to the index positions and overwriting the entries (assuming the entries are big enough, and nulling out excess bytes)
  • Writing the entire file in a second pass with the correct indexes
  • Writing a new index at the end of the file, and updating/nulling all entries in the rest of the file
  • ...

Either way, a low-level writer would probably still be a useful building block for any high-level writer/processor.

@remko remko changed the title [Question] Does this also write back to the MKV? Support writing MKV Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants