java - 用于提取 Representation 标签属性的 DashManifest 解析器
问题描述
我试图通过引用https://github.com/google/ExoPlayer/issues/8577width="3200"
中的示例代码来提取和height="180"
提取。但是,对于'image/jpeg'却没有成功。<Representation>
清单(https://dash.akamaized.net/akamai/bbb_30fps/bbb_with_tiled_thumbnails.mpd):
<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>
我为“图像/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;
}
“图像/JPEG”的结果:
2021-09-28 17:34:23.146 25820-25820/com.example.exoplayerdemo D/format.width: -1
2021-09-28 17:34:23.146 25820-25820/com.example.exoplayerdemo D/sprite_uri: https://dash.akamaized.net/akamai/bbb_30fps/thumbnails_320x180/tile_1.jpg
2021-09-28 17:34:23.147 25820-25820/com.example.exoplayerdemo D/sprite_uri: https://dash.akamaized.net/akamai/bbb_30fps/thumbnails_320x180/tile_2.jpg
2021-09-28 17:34:23.147 25820-25820/com.example.exoplayerdemo D/sprite_uri: https://dash.akamaized.net/akamai/bbb_30fps/thumbnails_320x180/tile_3.jpg
2021-09-28 17:34:23.147 25820-25820/com.example.exoplayerdemo D/sprite_uri: https://dash.akamaized.net/akamai/bbb_30fps/thumbnails_320x180/tile_4.jpg
2021-09-28 17:34:23.147 25820-25820/com.example.exoplayerdemo D/sprite_uri: https://dash.akamaized.net/akamai/bbb_30fps/thumbnails_320x180/tile_5.jpg
2021-09-28 17:34:23.149 25820-25820/com.example.exoplayerdemo D/sprite_uri: https://dash.akamaized.net/akamai/bbb_30fps/thumbnails_320x180/tile_6.jpg
我为“视频/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));
for(int l = 1; l < multiSegmentRepresentation.getSegmentCount(periodDurationUs); l++){}
return;
}
“视频/mp4”的结果:
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
它适用于“视频/mp4”。“图像/JPEG”的任何解决方案?
解决方案
推荐阅读
- macos - 使用 osascript 脚本打开终端并运行 npm 命令
- ruby-on-rails - 如何使用 Rails 5.2 form_with 触发特定动作?
- oauth - Coldfusion 10 支持
标签与否? - saml-2.0 - RelayStateQuery 中没有键
- tensorflow - 如何定义 prob_threshold 以避免在对象检测期间重复计数?
- html - 当用户想要打印页面时,有没有办法隐藏图像但显示文本?
- reactjs - 有没有办法在重定向后将响应发送回获取?
- regex - 类似于 Lua 中的正则表达式组?
- git - 大量的 GitHub 问题如何高效审核和更新?
- sql - 如何根据现有表生成 SQL 数据?