question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dash thumbnail parsing error if SegmentTemplate duration is in Float

See original GitHub issue

ExoPlayer version: 2.16.1

It’s nice to see that ExoPlayer had released the thumbnail parsing in v2.16.0 against this issue https://github.com/google/ExoPlayer/issues/9500

But I am facing an issue where it is not able to parsing if the SegmentTemplate has the duration in float. I can see in the Unit test case of the commit in ExoPlayer, there also duration is integer not the float value. https://github.com/google/ExoPlayer/commit/585b0bddcc965e269ad9eb8810b6f8da2b062996

You can take this media which is open source in Dash-If player and here if you see Image AdaptationSet has duration in float and in this case, ExoPlayer demo app crashes.

{
   "name": "Dash Thumbnails",
   "uri": "https://dash.akamaized.net/akamai/bbb_30fps/bbb_with_4_tiles_thumbnails.mpd"
}

We already have a solution in our side where we do this parsing in our custom parser. https://github.com/kaltura/playkit-android/blob/9a50e17fd60fddd4452ee692f5d62efa6d738e5b/playkit/src/main/java/com/kaltura/android/exoplayer2/dashmanifestparser/CustomDashManifestParser.java#L1901 It will be nice to see this fix on ExoPlayer’s end.

Crash:

Playback error
      com.google.android.exoplayer2.ExoPlaybackException: Source error
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:628)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:165)
        at android.os.HandlerThread.run(HandlerThread.java:61)
     Caused by: com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected NumberFormatException: For input string: "158.642"
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:430)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:760)
     Caused by: java.lang.NumberFormatException: For input string: "158.642"
        at java.lang.Long.parseLong(Long.java:443)
        at java.lang.Long.parseLong(Long.java:485)
        at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parseLong(DashManifestParser.java:1825)
        at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parseSegmentTemplate(DashManifestParser.java:993)
        at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parseAdaptationSet(DashManifestParser.java:476)
        at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parsePeriod(DashManifestParser.java:308)
        at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parseMediaPresentationDescription(DashManifestParser.java:157)
        at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:106)
        at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:62)
        at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:176)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
        at java.lang.Thread.run(Thread.java:760) 

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ojw28commented, Feb 7, 2022

Without a compelling reason to need to fix this, I’m not convinced that we should do so. Replacing an obvious failure mode (e.g., a stack trace that makes it clear exactly what the issue is) with a more obscure one (e.g., playback works but silently discards the malformed part of the manifest) is likely to lead to confusion in the future as the problem that occurs will be more subtle.

We don’t have any evidence to suggest that streaming providers have deployed content that’s malformed in this way into production (currently all we have is one piece of demo content). And even if they have, we don’t have evidence that (a) it’s hard for them to fix their content, which they should do anyway to ensure compatibility with players, and (b) it’s hard for them to workaround the problem they’ve created for themselves client-side (it actually appears to be not too difficult). So I don’t think we have a compelling reason.

0reactions
GouravSnacommented, Feb 7, 2022

Hi @ojw28 , As this crash is only for the image tracks, we suggest that Exoplayer should at least play the media except the images. For Images, you can log the warning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NumberFormatException when parsing mpd file with ... - GitHub
Hi, I got a url to explore dash thumbnails Once I tried running it via the ... content type and SegmentTemplate duration is...
Read more >
duration Attribute in the SegmentTemplate - AWS Elemental ...
When AWS Elemental MediaPackage generates the DASH manifest, it adds the duration attribute to the SegmentTemplate object, as shown in the following example:....
Read more >
DASH-IF Interoperability: Guidelines for Implementations
Signalling the availability of the thumbnail tile adaptation set ... or inherit a SegmentTemplate with $Number$ or $Time$ Identifier.
Read more >
DASH-IF implementation guidelines: restricted timing model
Representations contain independent sample timelines that are mapped to the time span on the MPD timeline that belongs to the period.
Read more >
dashjs - UNPKG
src/dash/parser/matchers/BaseMatcher.js","webpack://dashjs/. ... src/offline/errors/OfflineErrors.js","webpack://dashjs/.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found