Search code examples
videolive-streamingmpeg-dash

How to test ABR streaming?


I'm testing ABR on local network, Could i ask some help to confirm that this MPD is write correct for two adaption sets thats works in live streaming? Cause at the moment im unable to simulate lower bandwidth: i tried with chrome/console/performance but without result, this is what i read from chrome console:

[3945283] AbrController (video) stay on 1/1 (buffer: 24.141)

1/1 make me think that is not work properly.

this is MPD file generated:

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.7.2-DEV-rev370-gf3b5c45-master  at 2018-01-31T19:27:36.330Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT4.000S" type="dynamic" publishTime="2018-01-31T19:27:36Z" availabilityStartTime="2018-01-31T18:58:43.505Z" timeShiftBufferDepth="PT0H0M24.000S" minimumUpdatePeriod="PT0H4M0.000S" maxSegmentDuration="PT0H0M12.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash264">
 <ProgramInformation moreInformationURL="http://gpac.io">
  <Title>manifest.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period id="DID1" start="PT0H0M0.000S">
  <AdaptationSet segmentAlignment="true" bitstreamSwitching="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="16:9" lang="und">
   <SegmentTemplate initialization="manifest_set1_init.mp4"/>
   <Representation id="1" mimeType="video/mp4" codecs="avc3.4D4028" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="7758">
    <SegmentTemplate media="format-1080_dash_track1_$Number$.m4s" timescale="12288" startNumber="1" duration="98304"/>
   </Representation>
   <Representation id="2" mimeType="video/mp4" codecs="avc3.4D401E" width="640" height="360" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1314">
    <SegmentTemplate media="format-360_dash_track1_$Number$.m4s" timescale="12288" startNumber="1" duration="98304"/>
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" bitstreamSwitching="true" lang="eng">
   <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
   <SegmentTemplate initialization="manifest_set2_init.mp4"/>
   <Representation id="3" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="261">
    <SegmentTemplate media="format-1080_dash_track2_$Number$.m4s" timescale="48000" startNumber="1" duration="384000"/>
   </Representation>
   <Representation id="4" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="135">
    <SegmentTemplate media="format-360_dash_track2_$Number$.m4s" timescale="48000" startNumber="1" duration="384000"/>
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>

by the following MP4Box command:

MP4Box -dash-live 8000 -subdur 8000 -profile dashavc264:live -mpd-refresh 240.0 -time-shift 24 -min-buffer 4000 -insert-utc -no-cache -out manifest.mpd format-1080.mp4#video format-360.mp4#video format-1080.mp4#audio format-360.mp4#audio

May i ask also which is the right way to test if the browser change representation if there is not enough bandwidth?

Thanks a lot!


Solution

  • For testing you can either:

    • use a test player and manually select the bitrate you want use with the player controls.
    • use a test player and a network tester to inject traffic into your local network or your network adaptor to simulate a busy network, and check the logs of the test player to see it change streams.
    • modify an open source test player, such as ExoPlayer of Dash.js to add your own controls or tests.

    For example, the DASH Industry Forum reference player will allow you manually switch between bit rates, using the on screen controls for your video:

    enter image description here

    The player is here at the time of writing bit it worth searching to check you have the latest version: http://reference.dashif.org/dash.js/v2.5.0/samples/dash-if-reference-player/index.html

    There are a number of online DASH manifest validators also - I can't comment on the merits of one above the other, but this one does appear to provide results and does highlight some errors in your manifest:

    It is worth being aware that the above validator seems to be stricter than some implementations - I have seen examples of manifests which play media in live sites but which don't pass this validation. However, it should help you identify issues - you will see for your manifest above it provides a note:

    If more than one Media Segment is present the duration attribute or SegmentTimeline element shall be present