google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

Support xlinks in DASH manifests #1574

Open berti opened 8 years ago

berti commented 8 years ago

I was experiencing errors while trying to play the examples in http://dash.edgesuite.net/dash264/TestCases/5c/nomor/. After some debugging I realized that most of the MPD files in that location use xlinks to load parts of the content. However, the XML parser was not fetching these links. Therefore some periods were missing, and as a result the parsing was missing information.

Setting xmlParserFactory.setNamespaceAware(true); in the constructor of MediaPresentationDescriptionParser fixes this, i.e. the xlinks are fetched and the whole MPD is parsed properly.

However, this also leads to a failure in MediaPresentationDescriptionParserTest. This test parses an MPD file which has a yt:earliestMediaSequence attribute with no namespace declaration. I guess the correct namespace would be xmlns:yt="http://www.youtube.com/xml/schemas/2015" (the test passes with this), but I cannot be sure.

I'm using the latest from master (632a270).

To reproduce this problem, you can modify the Samples class of the ExoPlayer demo app to load one of the problematic files:

public static final Sample[] NEW_DASH = new Sample[] {
  new Sample("Big Buck Bunny - With xlinks", "http://dash.edgesuite.net/dash264/TestCases/5c/nomor/4_1a.mpd", Util.TYPE_DASH),
  new Sample("Big Buck Bunny - No xlinks", "http://dash.edgesuite.net/dash264/TestCases/5c/nomor/4_1f.mpd", Util.TYPE_DASH)
};

This is the error I got when playing the first video (with xlink attributes):

06-06 13:10:02.600 32404-32404/com.google.android.exoplayer.demo E/EventLogger: internalError [0.11, rendererInitError]
    com.google.android.exoplayer.ParserException: Unable to determine start of period 2
        at com.google.android.exoplayer.dash.mpd.MediaPresentationDescriptionParser.parseMediaPresentationDescription(MediaPresentationDescriptionParser.java:146)
        at com.google.android.exoplayer.dash.mpd.MediaPresentationDescriptionParser.parse(MediaPresentationDescriptionParser.java:102)
        at com.google.android.exoplayer.dash.mpd.MediaPresentationDescriptionParser.parse(MediaPresentationDescriptionParser.java:57)
        at com.google.android.exoplayer.upstream.UriLoadable.load(UriLoadable.java:93)
        at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:209)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
        at java.util.concurrent.FutureTask.run(FutureTask.java:234)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
        at java.lang.Thread.run(Thread.java:864)

That file has three Period elements. The second one is empty with a xlinks attribute. The third one (period 2) is the one that makes the parsing fail, due to the missing values in the previous period.

This error should be independent of the device. I've tried with a Nexus 5X with Android 6.0.1, and a HTC One with Android 4.2.2.

ojw28 commented 8 years ago

Setting xmlParserFactory.setNamespaceAware(true); in the constructor of MediaPresentationDescriptionParser fixes this, i.e. the xlinks are fetched and the whole MPD is parsed properly.

I don't think this is true. There's no logic anywhere in ExoPlayer for fetching xlinks; it's not functionality that we currently support.

berti commented 8 years ago

I'm sorry, you're absolutely right. I was testing with a local copy of the test case in which I had replaced the xlink with the proper contents, and I forgot I had changed that.

ojw28 commented 8 years ago

Cool :). I'm not sure whether we'll be implementing xlink support any time soon, by the way. It seems preferable that the server side should inline the proper content, rather than pushing (a) complexity, and (b) extra request round trips, onto the client.

kevleyski commented 6 years ago

Hi Olly, I’m planning to use xlinks for dynamic live dash ad replacement, can you please let me know where things are at vs period and representation substitution?

ojw28 commented 6 years ago

We do not support xlinks and have no immediate (i.e. 2018) plans to do so.

kevleyski commented 6 years ago

Ok no worries, plan B

On 5 Jul 2018, at 6:10 pm, ojw28 notifications@github.com wrote:

We do not support xlinks and have no immediate (i.e. 2018) plans to do so.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

manjusha221 commented 5 years ago

Hi Oliver, Does Exoplayer dev-v2-r2.10.3 have support for xlinks in Dash?

ojw28 commented 5 years ago

Does Exoplayer dev-v2-r2.10.3 have support for xlinks in Dash?

No. As an aside, the details of how xlinks work seems like a topic that's a source of confusion. The concept of loading part of the manifest from somewhere else seems simple enough, but when you look at the details there are quite a lot of weird cases, like this (@mediaPresentationDuration doesn't make sense with xlinks), this (id uniqueness unclear with xlinks) and this (manifest transformations when live events end unclear with xlinks).

ronak2121 commented 3 years ago

Hi @ojw28 and @kevleyski the recent DASH specifications also reference xlink in order to do dynamic ad pod resolution. Since I haven't heard anything on my above issue since March, is it fair to say Exoplayer will never support the latest DASH specifications? (i.e. we cannot expect Exoplayer to implement it in the next 2 years)

and if not....is there a way to build this support on top of Exoplayer ourselves, by overriding your parsers and networking components?

kevleyski commented 3 years ago

It's unlikely

Some other mainstream players such as Roku will also never support

ronak2121 commented 3 years ago

That’s fine for me. I only need support on ShakaPlayer and Exoplayer to field this for me (audio ads). Do you have any pointers on where to start to look into overriding the dash parsers, timing model and networking components to implement this ourselves?

is that what you’ve done as your plan B? @kevleyski?

ronak2121 commented 3 years ago

@kevleyski ?

kevleyski commented 3 years ago

Plan b was lots of presentation offset manipulation I've moved on from interstitial support for now so not looking at this right now, but it's likely to come back on my plate :-) Anyhow nothing to add today

Gheri commented 2 years ago

Hey Team, Is MPD Chaining supported in exo player ?? Generally what we have been doing to implement Static Pre roll in exo player for DASH ?? Any examples / references ?? Thanks, Gheri.

ronak2121 commented 2 years ago

@tonihei is there any timeline on your end when this would be delivered? This is the first update in close to a year...if not, do you have any pointers on how we could implement it on our own and contribute it back to Exoplayer?

tonihei commented 2 years ago

No immediate plan to implement this I'm afraid. We were just reassigning issues.

ronak2121 commented 2 years ago

@tonihei Do you have any pointers on implementing this ourselves? I’ll be more than happy with contributing that support back to you guys.

ronak2121 commented 2 years ago

Getting off of IMA SDK is one of our main goals this year. It’s causing lots of issues.