Dash.js: Too time to parse manifest on smartphone

Created on 3 Jul 2017  Â·  2Comments  Â·  Source: Dash-Industry-Forum/dash.js

Hi, Im trying to play a content using dash player. The player opened on a broswer, parses the manifest in 1.5 seconds, but when I open the player from a android app, ( ionic hybrid ), it takes too time to parse de manifest.

I have never seen this behaviour with other widevine DRM contents..

The manifest is: https://fng-vod-qp.akamaized.net/ss/vol2/s/FNG_CP/contentvideoi97734i150808contentvideoi97734i150808ssprtdashwv4m4000720t250/2017-01-24-23-11-57/output_ss.ism/index.mpd

Here are the logs:

[61] EME detected on this user agent! (ProtectionModel_21Jan2015)
dash.all.debug.js:2783 [66] [dash.js 2.3.0] MediaPlayer has been initialized
dash.all.debug.js:2783 [71] Playback Initialized
dash.all.debug.js:2783 [108677] Parsing complete: ( xml2json: 9.77e+4ms, objectiron: 1.03e+4ms, total: 108s)
dash.all.debug.js:2783 [108698] Manifest has been refreshed at Mon Jul 03 2017 16:48:19 GMT-0300 (UYT)[1499111299.955]
dash.all.debug.js:2783 [108756] SegmentTimeline detected using calculated Live Edge Time
dash.all.debug.js:2783 [108917] MediaSource attached to element. Waiting on open...
dash.all.debug.js:2783 [109536] MediaSource is open!
dash.all.debug.js:2783 [109540] Duration successfully set to: 6473.551
dash.all.debug.js:2783 [109557] Added 0 inline events
dash.all.debug.js:2783 [109567] video codec: video/mp4;codecs="avc1.4D401E"
dash.all.debug.js:2783 [109753] Schedule controller stopping for video
dash.all.debug.js:2783 [109896] audio codec: audio/mp4;codecs="mp4a.40.2"
dash.all.debug.js:2783 [109899] audio codec: audio/mp4;codecs="mp4a.40.2"
dash.all.debug.js:2783 [109900] audio codec: audio/mp4;codecs="mp4a.40.2"
dash.all.debug.js:2783 [109902] audio codec: audio/mp4;codecs="mp4a.40.2"
dash.all.debug.js:2783 [109931] Schedule controller stopping for audio
dash.all.debug.js:2783 [109942] No text data.
dash.all.debug.js:2783 [109960] Schedule controller stopping for fragmentedText
dash.all.debug.js:2783 [109977] No embeddedText data.
dash.all.debug.js:2783 [109978] No muxed data.
dash.all.debug.js:2783 [110135] Start Event Controller
dash.all.debug.js:2783 [110166] Schedule controller starting for video
dash.all.debug.js:2783 [110175] Schedule controller starting for audio
dash.all.debug.js:2783 [110184] Schedule controller starting for fragmentedText
dash.all.debug.js:2783 [110296] Init fragment finished loading saving to video's init cache
dash.all.debug.js:2783 [110319] Init fragment finished loading saving to fragmentedText's init cache
dash.all.debug.js:2783 [110453] Init fragment finished loading saving to audio's init cache
dash.all.debug.js:2783 [110494] Getting the request for fragmentedText time : 0
dash.all.debug.js:2783 [110505] SegmentTimeline: 0 / 6473.551
dash.all.debug.js:2783 [110533] DRM: onNeedKey
dash.all.debug.js:2783 [110538] DRM: initData: ��Ã’pssh����šðy˜@B†«’æ[àˆ_•��²²����¨<�W�R�M�H�E�A�D�E�R� �x�m�l�n�s�=�"�h�t�t�p�:�/�/�s�c�h�e�m�a�s�.�m�i�c�r�o�s�o�f�t�.�c�o�m�/�D�R�M�/�2�0�0�7�/�0�3�/�P�l�a�y�R�e�a�d�y�H�e�a�d�e�r�"� �v�e�r�s�i�o�n�=�"�4�.�0�.�0�.�0�"�>�<�D�A�T�A�>�<�P�R�O�T�E�C�T�I�N�F�O�>�<�K�E�Y�L�E�N�>�1�6�<�/�K�E�Y�L�E�N�>�<�A�L�G�I�D�>�A�E�S�C�T�R�<�/�A�L�G�I�D�>�<�/�P�R�O�T�E�C�T�I�N�F�O�>�<�K�I�D�>�E�+�3�l�R�I�v�l�d�0�m�Z�E�D�Y�8�i�T�4�2�r�Q�=�=�<�/�K�I�D�>�<�C�H�E�C�K�S�U�M�>�Z�d�f�E�k�B�0�h�s�U�4�=�<�/�C�H�E�C�K�S�U�M�>�<�L�A�_�U�R�L�>�h�t�t�p�s�:�/�/�s�d�p�-�f�n�g�-�w�e�b�s�e�r�v�i�c�e�s�.�q�u�i�c�k�p�l�a�y�.�c�o�m�/�p�r�p�/�g�e�t�l�i�c�e�n�s�e�?�b�=�6�1�6�3�7�4�6�9�6�F�6�E�3�D�3�6�3�0�3�2�7�C�7�C�6�3�6�9�6�4�3�D�6�3�6�9�6�4�3�A�2�3�3�4�3�4�4�5�3�5�4�5�4�4�3�1�3�3�2�D�4�5�3�5�3�8�4�2�2�D�3�4�3�9�3�7�3�7�2�D�3�9�3�9�3�1�3�0�2�D�3�3�3�6�3�3�4�3�3�8�3�9�3�3�4�5�3�3�3�6�4�1�4�4�4�0�7�4�6�5�7�3�7�4�2�E�6�4�6�F�6�D�6�1�6�9�6�E�<�/�L�A�_�U�R�L�>�<�/�D�A�T�A�>�<�/�W�R�M�H�E�A�D�E�R�>����\pssh����íyÖJΣÈ'ÜÕ!��<Dåíå‹Iw™6<‰>6­usp-cenc"ROXtE+WLSXeZEDY8iT42rQ==�2�
dash.all.debug.js:28563 It is recommended that a robustness level be specified. Not specifying the robustness level could result in unexpected behavior in the future, potentially including failure to play.
dash.all.debug.js:2783 [111270] Getting the request for video time : 0
dash.all.debug.js:2783 [111273] SegmentTimeline: 0 / 6473.551
dash.all.debug.js:2783 [111408] Buffered Range for type: fragmentedText : 0 - 60
dash.all.debug.js:2783 [111414] Got enough buffer to start.
dash.all.debug.js:2783 [111439] DRM: KeySystem Access Granted (com.widevine.alpha)! Selecting key system...
dash.all.debug.js:2783 [111444] DRM: onNeedKey
dash.all.debug.js:2783 [111449] DRM: initData: ��Ã’pssh����šðy˜@B†«’æ[àˆ_•��²²����¨<�W�R�M�H�E�A�D�E�R� �x�m�l�n�s�=�"�h�t�t�p�:�/�/�s�c�h�e�m�a�s�.�m�i�c�r�o�s�o�f�t�.�c�o�m�/�D�R�M�/�2�0�0�7�/�0�3�/�P�l�a�y�R�e�a�d�y�H�e�a�d�e�r�"� �v�e�r�s�i�o�n�=�"�4�.�0�.�0�.�0�"�>�<�D�A�T�A�>�<�P�R�O�T�E�C�T�I�N�F�O�>�<�K�E�Y�L�E�N�>�1�6�<�/�K�E�Y�L�E�N�>�<�A�L�G�I�D�>�A�E�S�C�T�R�<�/�A�L�G�I�D�>�<�/�P�R�O�T�E�C�T�I�N�F�O�>�<�K�I�D�>�E�+�3�l�R�I�v�l�d�0�m�Z�E�D�Y�8�i�T�4�2�r�Q�=�=�<�/�K�I�D�>�<�C�H�E�C�K�S�U�M�>�Z�d�f�E�k�B�0�h�s�U�4�=�<�/�C�H�E�C�K�S�U�M�>�<�L�A�_�U�R�L�>�h�t�t�p�s�:�/�/�s�d�p�-�f�n�g�-�w�e�b�s�e�r�v�i�c�e�s�.�q�u�i�c�k�p�l�a�y�.�c�o�m�/�p�r�p�/�g�e�t�l�i�c�e�n�s�e�?�b�=�6�1�6�3�7�4�6�9�6�F�6�E�3�D�3�6�3�0�3�2�7�C�7�C�6�3�6�9�6�4�3�D�6�3�6�9�6�4�3�A�2�3�3�4�3�4�4�5�3�5�4�5�4�4�3�1�3�3�2�D�4�5�3�5�3�8�4�2�2�D�3�4�3�9�3�7�3�7�2�D�3�9�3�9�3�1�3�0�2�D�3�3�3�6�3�3�4�3�3�8�3�9�3�3�4�5�3�3�3�6�4�1�4�4�4�0�7�4�6�5�7�3�7�4�2�E�6�4�6�F�6�D�6�1�6�9�6�E�<�/�L�A�_�U�R�L�>�<�/�D�A�T�A�>�<�/�W�R�M�H�E�A�D�E�R�>����\pssh����íyÖJΣÈ'ÜÕ!��<Dåíå‹Iw™6<‰>6­usp-cenc"ROXtE+WLSXeZEDY8iT42rQ==
�2�
dash.all.debug.js:2783 [111462] Getting the request for audio time : 0
dash.all.debug.js:2783 [111465] SegmentTimeline: 0 / 6473.551
dash.all.debug.js:2783 [111511] Buffered Range for type: video : 0 - 1.251
dash.all.debug.js:2783 [111515] Got enough buffer to start.
dash.all.debug.js:2783 [111522] ThroughputRule requesting switch to index: 5 type: video Priority: Default Average throughput 19606 kbps
dash.all.debug.js:2783 [111565] Buffered Range for type: audio : 0 - 2.005333
dash.all.debug.js:2783 [111567] Got enough buffer to start.
dash.all.debug.js:2783 [111573] Init fragment finished loading saving to video's init cache
dash.all.debug.js:2783 [111576] Buffered Range for type: video : 0 - 1.251
dash.all.debug.js:2783 [111579] DRM: onNeedKey
dash.all.debug.js:2783 [111581] DRM: initData: ��Ã’pssh����šðy˜@B†«’æ[àˆ_•��²²����¨<�W�R�M�H�E�A�D�E�R� �x�m�l�n�s�=�"�h�t�t�p�:�/�/�s�c�h�e�m�a�s�.�m�i�c�r�o�s�o�f�t�.�c�o�m�/�D�R�M�/�2�0�0�7�/�0�3�/�P�l�a�y�R�e�a�d�y�H�e�a�d�e�r�"� �v�e�r�s�i�o�n�=�"�4�.�0�.�0�.�0�"�>�<�D�A�T�A�>�<�P�R�O�T�E�C�T�I�N�F�O�>�<�K�E�Y�L�E�N�>�1�6�<�/�K�E�Y�L�E�N�>�<�A�L�G�I�D�>�A�E�S�C�T�R�<�/�A�L�G�I�D�>�<�/�P�R�O�T�E�C�T�I�N�F�O�>�<�K�I�D�>�E�+�3�l�R�I�v�l�d�0�m�Z�E�D�Y�8�i�T�4�2�r�Q�=�=�<�/�K�I�D�>�<�C�H�E�C�K�S�U�M�>�Z�d�f�E�k�B�0�h�s�U�4�=�<�/�C�H�E�C�K�S�U�M�>�<�L�A�_�U�R�L�>�h�t�t�p�s�:�/�/�s�d�p�-�f�n�g�-�w�e�b�s�e�r�v�i�c�e�s�.�q�u�i�c�k�p�l�a�y�.�c�o�m�/�p�r�p�/�g�e�t�l�i�c�e�n�s�e�?�b�=�6�1�6�3�7�4�6�9�6�F�6�E�3�D�3�6�3�0�3�2�7�C�7�C�6�3�6�9�6�4�3�D�6�3�6�9�6�4�3�A�2�3�3�4�3�4�4�5�3�5�4�5�4�4�3�1�3�3�2�D�4�5�3�5�3�8�4�2�2�D�3�4�3�9�3�7�3�7�2�D�3�9�3�9�3�1�3�0�2�D�3�3�3�6�3�3�4�3�3�8�3�9�3�3�4�5�3�3�3�6�4�1�4�4�4�0�7�4�6�5�7�3�7�4�2�E�6�4�6�F�6�D�6�1�6�9�6�E�<�/�L�A�_�U�R�L�>�<�/�D�A�T�A�>�<�/�W�R�M�H�E�A�D�E�R�>����\pssh����íyÖJΣÈ'ÜÕ!��<Dåíå‹Iw™6<‰>6­usp-cenc"ROXtE+WLSXeZEDY8iT42rQ==*�2�
dash.all.debug.js:2783 [111586] Getting the request for video time : 1.252
dash.all.debug.js:2783 [111588] SegmentTimeline: 0 / 6473.551
dash.all.debug.js:2783 [111593] Getting the next request at index: 1
dash.all.debug.js:2783 [111595] SegmentTimeline: 1.252 / 6473.551
dash.all.debug.js:2783 [111701] DRM: Ignoring initData because we have already seen it!
dash.all.debug.js:2783 [111705] DRM: Ignoring initData because we have already seen it!
dash.all.debug.js:2783 [111737] Native video element event: loadedmetadata
dash.all.debug.js:2783 [111789] Native video element event: play
dash.all.debug.js:2783 [111797] Native video element event: playing
dash.all.debug.js:2783 [111838] DRM: Session created. SessionID = sid372
dash.all.debug.js:2783 [111845] DRM: onKeyMessage
dash.all.debug.js:2783 [111956] Buffered Range for type: video : 0 - 2.67
dash.all.debug.js:2783 [112035] Getting the request for video time : 2.67
dash.all.debug.js:2783 [112046] Index for video time 2.67 is 1
dash.all.debug.js:2783 [112049] SegmentTimeline: 1.252 / 6473.551
dash.all.debug.js:2783 [112056] Getting the next request at index: 2
dash.all.debug.js:2783 [112058] SegmentTimeline: 2.67 / 6473.551
dash.all.debug.js:26977 POST https://sdp-fng-webservices.quickplay.com/wvp/getlicense?service=foxplay&ve…wiZXhwaXJ5VGltZSI6MTQ5OTExMTI0NDk3MiwiY3JlYXRlZFRpbWUiOjE0OTkxMTExODQ5NzJ9 400 (Bad Request)onKeyMessage @ dash.all.debug.js:26977(anonymous function) @ dash.all.debug.js:2904trigger @ dash.all.debug.js:2903handleEvent @ dash.all.debug.js:28639
dash.all.debug.js:2783 [112964] DRM: com.widevine.alpha update, XHR status is "Bad Request" (400), expected to be 200. readyState is 4. Response is {"code":"InvalidPTokenError","message":"Invalid PToken: Token has expired: 1499111244972 < 1499111298235."}

Most helpful comment

I don't think there is a lot you can do to speed up the XML parsing- we have already sped it up (https://github.com/Dash-Industry-Forum/dash.js/issues/1267) once before. I imagine it is always going to take a big chunk of time to parse 400kb of XML on a constrained device,

Assuming you control the content, I think it would be fairly easy to get the MPD down to a sensible size:

  • Sort out the video encoding so the segment length is fixed.
  • Pick an audio segment duration that is a multiple of the access unit length (21.3333ms) - straightforward as long as your encoder can support non-integer segment lengths.

These will allow you to use a very concise single-entry SegmentTemplate with $Number$ instead of $Time$.

Failing that, you could investigate an alternative XML parser to xml2json.

All 2 comments

I don't think there is a lot you can do to speed up the XML parsing- we have already sped it up (https://github.com/Dash-Industry-Forum/dash.js/issues/1267) once before. I imagine it is always going to take a big chunk of time to parse 400kb of XML on a constrained device,

Assuming you control the content, I think it would be fairly easy to get the MPD down to a sensible size:

  • Sort out the video encoding so the segment length is fixed.
  • Pick an audio segment duration that is a multiple of the access unit length (21.3333ms) - straightforward as long as your encoder can support non-integer segment lengths.

These will allow you to use a very concise single-entry SegmentTemplate with $Number$ instead of $Time$.

Failing that, you could investigate an alternative XML parser to xml2json.

Closing this issue as there is no action planned from dash.js side regarding this. As @bbcrddave, I think this is more a problem with parsing such huge manifest file in a constrained device than something wrong in dash.js.

@djmaxisauce, please, feel free to reopen this in case you get the way of reducing your manifest files and you still have parsing perf issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qchroman picture qchroman  Â·  4Comments

yogevNisim picture yogevNisim  Â·  3Comments

fvalleeHbbTV picture fvalleeHbbTV  Â·  3Comments

tony1377 picture tony1377  Â·  3Comments

mihaiav picture mihaiav  Â·  5Comments