flowplayer / flowplayer-mpegdash

MIT License
8 stars 13 forks source link

dashQualities does not enable quality selection #18

Closed zerefel closed 7 years ago

zerefel commented 7 years ago

Hey there, when I enable the dashQualities: true flag, the quality selector is not displayed in the player menu. It seems like the plugin is unable to push the available bandwidths in the array, because the Adaptation Set does not have a maxFrameRate attribute https://github.com/flowplayer/flowplayer-mpegdash/blob/master/flowplayer.dashjs.js#L78-L94 If I comment out the if check, then it pushes the values.

Here is the full mpd file that I use. It was generated by Zencoder:

<?xml version="1.0"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:mas="urn:marlin:mas:1-0:services:schemas:mpd" xmlns:mspr="urn:microsoft:playready" xmlns:cenc="urn:mpeg:cenc:2013" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,urn:webm:dash:profile:webm-on-demand:2012" type="static" mediaPresentationDuration="PT5.035S" minBufferTime="PT1S">
  <Period>
    <AdaptationSet mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1" lang="und" group="0">
      <Representation audioSamplingRate="48000" bandwidth="304899" codecs="mp4a.40.2" id="audio/audio-und">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
        <BaseURL>audio/Bk8WkCSb-_audio-audio-und.mp4</BaseURL>
        <SegmentBase indexRange="619-686">
          <Initialization range="0-618"/>
        </SegmentBase>
      </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="video/webm" scanType="progressive" segmentAlignment="true" startWithSAP="1" group="0">
      <Representation xmlns="urn:mpeg:DASH:schema:MPD:2011" id="1080/0" bandwidth="2855188" codecs="vp9" width="1920" height="1080" frameRate="6171/200" scanType="progressive">
        <BaseURL>1080/Bk8WkCSb-_1080-video.webm</BaseURL>
        <SegmentBase indexRange="2339447-2339513">
          <Initialization range="0-441"/>
        </SegmentBase>
      </Representation>
      <Representation xmlns="urn:mpeg:DASH:schema:MPD:2011" id="720/0" bandwidth="1677469" codecs="vp9" width="1280" height="720" frameRate="6171/200" scanType="progressive">
        <BaseURL>720/Bk8WkCSb-_720-video.webm</BaseURL>
        <SegmentBase indexRange="1379577-1379643">
          <Initialization range="0-441"/>
        </SegmentBase>
      </Representation>
      <Representation xmlns="urn:mpeg:DASH:schema:MPD:2011" id="480/0" bandwidth="1017636" codecs="vp9" width="854" height="480" frameRate="6171/200" scanType="progressive">
        <BaseURL>480/Bk8WkCSb-_480-video.webm</BaseURL>
        <SegmentBase indexRange="833318-833384">
          <Initialization range="0-441"/>
        </SegmentBase>
      </Representation>
      <Representation xmlns="urn:mpeg:DASH:schema:MPD:2011" id="360/0" bandwidth="662513" codecs="vp9" width="640" height="360" frameRate="6171/200" scanType="progressive">
        <BaseURL>360/Bk8WkCSb-_360-video.webm</BaseURL>
        <SegmentBase indexRange="540100-540166">
          <Initialization range="0-441"/>
        </SegmentBase>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>

The MPEG-DASH stream plays fine, however it is stuck at the lowest quality setting, and I don't have the option to change the level or to at least set a starting level, like it's possible with the hlsjs plugin.

Let me know if you need me to provide additional info. Thanks!

phloxic commented 7 years ago

I'll look again into whether I can find a different criterion which identifies the adaptation set as video at that point.

On a more general level, and regarding your stream being stuck on the lowest level: I experience the same with WEBM-DASH and dash.js - please check your stream in the dash.js sample player: http://dashif.org/reference/players/javascript/v2.4.1/samples/dash-if-reference-player/

See also: https://github.com/flowplayer/flowplayer-mpegdash#stream-compatibility

phloxic commented 7 years ago

@zerefel - quality selection should now work with your stream. Please confirm.

zerefel commented 7 years ago

@blacktrash Yes, it does work now, thanks!

About feature requests, such as startLevel and smoothSwitching, can I request them and should I open new issues here on GitHub, or do you have them planned for the future?

phloxic commented 7 years ago

@zerefel - you can request them here, no prob.

Note however, that the client library works very differently compared to hls.js:

phloxic commented 7 years ago

@zerefel - you can now set initialVideoQuality in the dash configuration (default -1 for automatic/adaptive); it accepts an integer as value which references the 'startLevel'.

(documentation to follow)

zerefel commented 7 years ago

@blacktrash - setting initialVideoQuality in the dash configuration works as expected, I can confirm that. Thanks for your speedy response!