Skip to content

DASH: Parse MIME type, width and height into Format for image AdaptationSet #9500

Closed
@mekptang

Description

@mekptang

Hello guys, I want to extract the width, height, and value of the image from the following manifest.

<AdaptationSet id="3" mimeType="image/jpeg" contentType="image">
    <SegmentTemplate media="$RepresentationID$/tile_$Number$.jpg" duration="100" startNumber="1"/>
      <Representation bandwidth="12288" id="thumbnails_320x180" width="3200" height="180">
      <EssentialProperty schemeIdUri="http://dashif.org/thumbnail_tile" value="10x1"/>
    </Representation>
</AdaptationSet>

I have referred to #8577 as an example but it only works for mimeType="video/mp4".

code for image/jpeg:

if("image/jpeg".equals(mimeType)){
    Representation.MultiSegmentRepresentation multiSegmentRepresentation = (Representation.MultiSegmentRepresentation) representation;
    Log.d("format.width" , String.valueOf(multiSegmentRepresentation.format.width));
    for(int l = 1; l < multiSegmentRepresentation.getSegmentCount(periodDurationUs); l++) {
    Log.d("sprite_uri" , String.valueOf(multiSegmentRepresentation.getSegmentUrl(l).resolveUri(representation.baseUrls.get(0).url)));
    }
    return;
}

result:

2021-09-28 17:34:23.146 25820-25820/com.example.exoplayerdemo D/format.width: -1

code for video/mp4:

if("video/mp4".equals(mimeType)){
    Representation.MultiSegmentRepresentation multiSegmentRepresentation = (Representation.MultiSegmentRepresentation) representation;
    Log.d("format.width" , String.valueOf(multiSegmentRepresentation.format.width));
    Log.d("format.height" , String.valueOf(multiSegmentRepresentation.format.height));
    return;
}

result:

2021-09-28 17:52:07.574 23252-23252/com.example.exoplayerdemo D/format.width: 1024
2021-09-28 17:52:07.574 23252-23252/com.example.exoplayerdemo D/format.height: 576

Any suggestions to parse this thing in exoplayer?
here is the manifest URL: https://dash.akamaized.net/akamai/bbb_30fps/bbb_with_tiled_thumbnails.mpd

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions