plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[video_player_videohole]Ability to change video quality of DASH video format [proposal]

Open IhabMks opened this issue 2 years ago • 10 comments

IhabMks avatar Jul 13 '23 15:07 IhabMks

Hello, @IhabMks

According to the document, video quality can be changed by setting 'ADAPTIVE_INFO'.

...
var bitRateString = 'BITRATES=5000~10000|STARTBITRATE=HIGHEST|SKIPBITRATE=LOWEST';

webapis.avplay.setStreamingProperty('ADAPTIVE_INFO', bitRateString);
...
webapis.avplay.prepare();

You can splice the adaptive info after the video url, For example: https://dash.akamaized.net/dash264/TestCasesUHD/2b/11/MultiRate.mpd|STARTBITRATE=HIGHEST

hyue7 avatar Jul 17 '23 09:07 hyue7

@hyue7 Thanks for your answer, I've tested and it works fine, but this is is upon initialization only, ain't it ? Consider a startbitrate for example "AVERAGE", and say maybe we want to select another quality like 720p in the middle of the video, what would be the changed ?

Among the allowed parameters, there is bitrate, would we want to reinitialize the player with the parameter "/BITRATES=1000000" ? or instead we could change it on the same instantiation, knowing that videohole doesn't have the ability to do so? we could overload it maybe ?

Here's an example of the manifest :

<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" type="dynamic" mediaPresentationDuration="PT0H2M35.976S" minBufferTime="PT1.500S" profiles="urn:mpeg:dash:profile:isoff-live:2011">
  <Period>
    <AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" maxWidth="1280" maxHeight="720" maxFrameRate="30/1">
      <Representation id="video_240p" bandwidth="250000" width="426" height="240" frameRate="30/1">
        <BaseURL>video_240p/</BaseURL>
        <SegmentBase indexRange="134-250">
          <Initialization range="0-133" />
        </SegmentBase>
      </Representation>
      <Representation id="video_480p" bandwidth="500000" width="854" height="480" frameRate="30/1">
        <BaseURL>video_480p/</BaseURL>
        <SegmentBase indexRange="134-250">
          <Initialization range="0-133" />
        </SegmentBase>
      </Representation>
      <Representation id="video_720p" bandwidth="1000000" width="1280" height="720" frameRate="30/1">
        <BaseURL>video_720p/</BaseURL>
        <SegmentBase indexRange="134-250">
          <Initialization range="0-133" />
        </SegmentBase>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>

IhabMks avatar Jul 17 '23 12:07 IhabMks

Hi, @IhabMks This way only support set video bitrate before the video starts playback. If you want to change bitrate during playing, it will need a new dart Api to get and set bitrate, like setBitRate. I will submit a PR to support change video quality next week.

hyue7 avatar Jul 20 '23 03:07 hyue7

Hi, @hyue7 Thank you for your support and will look forward to it then. Other matter; when adding functionnalties such as this on the video_player_videohole, do we add them directly on the same plugin? and do we actually have access to all the methods, like for example :

void setSelectTrack(AVPlayStreamType trackType, long trackIndex); 
AVPlayStreamInfo[] getCurrentStreamInfo(); 
AVPlayStreamInfo[] getTotalTrackInfo(); 
void setStreamingProperty(AVPlayStreamingPropertyType;
void restore(optional DOMString? URL, optional unsigned long? resumeTime, optional boolean? bPrepare); voidrestoreAsync(optional DOMString? URL, optional unsigned long? resumeTime, optional boolean? bPrepare, optional
...

IhabMks avatar Jul 20 '23 07:07 IhabMks

@hyue7 I've done some other test with different video format. The DASH videos protected by widevine works fine when using the adaptive info on the url, but the ones protected with playready, returns an error : XMLSyntaxError Start tag expected, '<' not found

IhabMks avatar Jul 20 '23 17:07 IhabMks

Other matter; when adding functionnalties such as this on the video_player_videohole, do we add them directly on the same plugin?

Yes, it will update on video_player_videohole plugin.

and do we actually have access to all the methods, like for example :

Do you mean you want to access all the interfaces in AVPlayer?

hyue7 avatar Jul 21 '23 05:07 hyue7

@hyue7 Yes the AVPlayer interfaces too

IhabMks avatar Jul 21 '23 05:07 IhabMks

@hyue7 Hello, I've tested Live playready dash videos like this one "source...mpd/Manifest?start=LIVE&end=END&device=dash_pr", and noticed that the adaptive info parameters doesn't work on those, also returning: XMLSyntaxError Start tag expected, '<' not found

Could be because they have a different manifest structure and hence not supported ? what do you reckon ? Have you tried them ?

IhabMks avatar Jul 25 '23 07:07 IhabMks

Could be because they have a different manifest structure and hence not supported ? what do you reckon ? Have you tried them ?

Sorry for late, smoothstream not support appending string. It is different from dash. Maybe you have to wait for the setBitRate Api, if you want to change quality of SS.

hyue7 avatar Jul 25 '23 09:07 hyue7

@hyue7 Alright, will do.

In the meantime, i don't think i have a smoothstream here, as it normally should be ".ism" whereas i have a ".mpd/manifest.."

IhabMks avatar Jul 25 '23 12:07 IhabMks