emarsden / dash-mpd-rs

Rust library for parsing, serializing and downloading media content from a DASH MPD manifest.
MIT License
70 stars 22 forks source link

Event content and Binary content are base64 encoded #23

Closed sbuzzard closed 1 year ago

sbuzzard commented 1 year ago

Fixed a bug where Binary content was Vec<u8> but blows up because it needs to be converted from base64. Also the content of Event itself if present, is also base64 - it's currently encoded/decoded as a String. Or I could just make Binary an Option of String if you'd prefer. Either change is not backward compat but to at least fix the parser from blowing up, we could just change the Binary content to be an Option of String. Let me know.

emarsden commented 1 year ago

Thanks for this. I've included it in a more ambitious attempt to define the various elements used for the DASH encoding of SCTE-35. However, I'm seeing base64 decoding errors such as "Encoded text cannot have a 6-bit remainder" for manifests such as

https://refplayer-dev.cloud.digitaluk.co.uk/dynamic/stl-dashads-dartest.mpd

There seem to be very few public manifests using this vocabulary; I understand dynamic ad insertion is probably mostly used server-side. I'll have limited time to try to understand this over the next week, but if you can figure out this problem with base64 decoding that would be great. If you know of other publicly available DASH manifests using the SCTE-35 vocabulary, or perhaps are able to release some examples for our test suite, that would also be helpful (ideally under the MIT licence, like the code, and they could be parse-only tests without accessible media content).

As a general comment, our errors from quick-xml are really not very helpful; there's no information on the location of the error.

sbuzzard commented 1 year ago

that's sort of why i backed off and just made the Binary content a string here (like the content of Event already is). Not sure what's up with attempting to convert base64 to bytes. The online base64 encode utility site validates them all as proper base64, the ones I've tried from work.

This site has an example that looks like some of ours.

sbuzzard commented 1 year ago

I may try outthis. Perhaps will have better luck with this than serde_as