Feature request: Custom variables
Hi,
Can you add an option to provide formats which are not present in the original mpd?
For example:
If for example, from <AdaptationSet id="1"> I want to download "$RepresentationID$" called VIDEO1 and from <AdaptationSet id="2"> I want to download "$RepresentationID$" called AUDIO1 which are not present in the MPD, would it be possible to override the variables in the mpd?
For example the MPD might offer a lower quality version of video and audio, but the server still has a higher quality version available which is hidden (due to geo locks) but still accessible.
I'm thinking of such an option:
dash-mpd-cli --override "AdaptationSet=1 RepresentationID=VIDEO1" --override "AdaptationSet=2 RepresentationID=AUDIO1" [url]
Thanks for the suggestion.
I will think about whether to implement something along the lines of what you suggest, which is quite a narrow functionality, or whether it would be better to implement a more general "MPD rewriting" functionality using rules for XML tree rewrites.
There is a preliminary implementation of an MPD rewriting functionality in the latest release. This uses XSLT stylesheets, which are very powerful though certainly less intuitive than the syntax you are proposing. There is a sample stylesheet that does some rewriting similar to what your example does at test/fixtures/rewrite-resolution.xslt.
https://github.com/emarsden/dash-mpd-cli/blob/main/tests/fixtures/rewrite-resolution.xslt
I hope that helps, but will leave this issue open to keep in mind the simpler (but not very general) API you proposed.