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

Interface to MPD XML-rewriting filters/plugins #36

Open
emarsden opened this issue Oct 23, 2023 · 0 comments
Open

Interface to MPD XML-rewriting filters/plugins #36

emarsden opened this issue Oct 23, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@emarsden
Copy link
Owner

emarsden commented Oct 23, 2023

It can be useful to allow the user to read and modify the MPD manifest before downloading media segments from it. Use cases:

  • print additional diagnostics concerning the manifest
  • delete some Periods that the user is not interested in (based for example on their duration)
  • delete Representations that use undesired codecs
  • modify the BaseURL to include another CDN
  • delete all subtitle languages and formats except for the one the user is interested in (as a complement to the prefer_language functionality)
  • delete audio Representations whose language the user is not interested in
  • drop an audio AdaptationSet if the user only is interested in video (though this functionality is already built in to the library)

As of 2023-10-22 we have implemented support for XSLT stylesheets via xsltproc, which allows XML rewriting. This is a standards-based and easy to implement solution to filtering/rewriting, but xsltproc only supports XSLT v1.0 (v3.0 is more flexible and for example includes functions for manipulating xs:duration attributes) and XSLT is not the most widely adopted language.

Possible alternatives:

  • Saxon-HE, free Java software (MPL v2) which implements XSLT 3.0
  • A generic filter interface implemented as a pipe
  • A command API that takes two filename arguments
  • A WebAssembly-based interface that could be implemented in any programming language that can generate WASM bytecode

I will be thinking about implementing some of these in the next few months.

@emarsden emarsden added the enhancement New feature or request label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant