emarsden / dash-mpd-rs

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

0.8 regression: namespace error : Namespace prefix xsi for schemaLocation on MPD is not defined #19

Closed gdesmott closed 1 year ago

gdesmott commented 1 year ago

0.8 introduced a regression with our DASH example in GStreamer.

$ xmllint -format dash_stream/manifest.mpd
dash_stream/manifest.mpd:2: namespace error : Namespace prefix xsi for schemaLocation on MPD is not defined
:mpeg:dash:profile:isoff-on-demand:2011" mediaPresentationDuration="PT1M23.333S"

With 0.7 the XML was

<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" type="dynamic" schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" availabilityStartTime="2023-04-26T13:35:15.546317603Z">

which changed to this with 0.8:

<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" type="dynamic" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" availabilityStartTime="2023-04-26T13:34:24.374770165Z">

The XML parser does not seem happy with prefixing schemaLocation with xsi:.

sdroege commented 1 year ago

Probably related: https://github.com/emarsden/dash-mpd-rs/commit/5a568d3dfed923dfa77c493b7ce178b71b672bc2

emarsden commented 1 year ago

I didn't realize the crate was used in a GStreamer example; that's cool!

Thanks for pointing this out. Indeed, if a namespace prefix is used in the XML manifest, it should be declared first. I've pushed a change which serializes default values for the namespaces that we potentially use; are you able to test HEAD?

(This change is not fully desirable because it serializes these namespace declarations whether we use them or not. I don't see how to avoid this with the existing serde-based serialization machinery, however.)

gdesmott commented 1 year ago

I didn't realize the crate was used in a GStreamer example; that's cool!

I started using it last week. ;)

are you able to test HEAD?

Yes, that solves it, thanks!

Any chance you could push a release with the fix?

emarsden commented 1 year ago

OK, v0.8.1 is released.