Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tracked by #620
IhabMks opened this issue Jul 13, 2023 · 10 comments

Comments

@IhabMks
Copy link

IhabMks commented Jul 13, 2023

No description provided.

@IhabMks IhabMks changed the title Ability to change video quality of DASH video format Ability to change video quality of DASH video format [proposal] Jul 13, 2023
@hyue7
Copy link
Collaborator

hyue7 commented Jul 17, 2023

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

@IhabMks
Copy link
Author

IhabMks commented Jul 17, 2023

@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>

@hyue7
Copy link
Collaborator

hyue7 commented Jul 20, 2023

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.

@IhabMks
Copy link
Author

IhabMks commented Jul 20, 2023

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
Copy link
Author

IhabMks commented Jul 20, 2023

@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

@hyue7
Copy link
Collaborator

hyue7 commented Jul 21, 2023

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?

@IhabMks
Copy link
Author

IhabMks commented Jul 21, 2023

@hyue7
Yes the AVPlayer interfaces too

@IhabMks
Copy link
Author

IhabMks commented Jul 25, 2023

@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 ?

@hyue7
Copy link
Collaborator

hyue7 commented Jul 25, 2023

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.

@IhabMks
Copy link
Author

IhabMks commented Jul 25, 2023

@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.."

@xiaowei-guan xiaowei-guan changed the title Ability to change video quality of DASH video format [proposal] [video_player_videohole]Ability to change video quality of DASH video format [proposal] Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants