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

Issue in Live restart playback #4633

Open
kumarashu123 opened this issue Nov 27, 2024 · 12 comments
Open

Issue in Live restart playback #4633

kumarashu123 opened this issue Nov 27, 2024 · 12 comments
Labels

Comments

@kumarashu123
Copy link

Environment
  • Link to playable MPD file:
  • Dash.js version:
  • 4.7.2
  • Browser name/version:
  • OS name/version:
  • LGTV and Samsung V
Steps to reproduce
  1. Please provide clear steps to reproduce your problem
    *Restart linear/CDRV content
    *playback should start from beginning
  • Some times restart playback is working but playback start from 10 -12 sec.

Issue is not seen in dashjs version 3.1.0.

I am passing streamUrl and startPosition to restart playback from beginning.

this.dashPlayer.attachSource(
streamUrl,
0, //startPosition
);

  1. If the bug is intermittent, give a rough frequency if possible
    8/10 times
Observed behavior

Describe what the player is doing that is unexpected or undesired behaviour.
Player is not downloading segments only mpd keeps on downloading

Console output
Paste the contents of the browser console here.
You may need to enable debug logging in dash.js by calling player.updateSettings({ 'debug': { 'logLevel': dashjs.Debug.LOG_LEVEL_DEBUG }}) if you are using your own page.
Expected behavior

Describe what the player is expected to do

On restart playback playback should resume from beginning.

@kumarashu123
Copy link
Author

@dsilhavy Could you please let me know how to do linear restart?
Is there any known issue linear restart happens from 8 - 10 sec not 0?

@dsilhavy
Copy link
Collaborator

Simply calling player.attachSource(mpd) loads the MPD and starts the content from the beginning. If you are already playing the same content and would like to start from the beginning again, you can also use player.seek(0). Also make sure to use the latest released version of dash.js which is 4.7.4.

@kumarashu123
Copy link
Author

kumarashu123 commented Nov 28, 2024

@dsilhavy
Content is Linear calling player.attachSource(mpd) loads the MPD and starts video from live position.

Since i am doing linear restart calling player.attachSource(mpd, 0)
passing 0 i.e, playposition does not start playback from 0 in dash js 4.72, 4.7.4 and nightly build.
sometime playback getting stuck if i pass 0 to attachSource.

another approach i tried
this.dashPlayer.on(
DashJS.MediaPlayer.events.PLAYBACK_METADATA_LOADED, (event) => {
if (PlaybackType !== LINEAR) {
this.seek(0);
}
});
if i call seek in PLAYBACK_METADATA_LOADED playback is starting but starting from 8 -10 sec (8-10 sec content getting missed).

when i use dash.js 3.1.0 calling player.attachSource(mpd, 0) starts playback from 0.

@dsilhavy
Copy link
Collaborator

There is some documentation on how seek works in v5 (nightly build) here: https://dashif.org/dash.js/pages/advanced/timing-apis.html

I assume by "linear" content you mean live/dynamic content? In this case seeking to position 0 means seeking to the beginning of the DVR window. What might happen is that there are no segments signaled in the MPD anymore for that specific target time.

Did you also check if the behavior is similar on Desktop browsers?

@kumarashu123
Copy link
Author

Yes, linear i mean is live/dynamic content. Same content I checked with 3.1.0 version where seeking to position 0 plays from 0 sec. but in 4.7.2, 4.7.4 it does not play from beginning i.e, 0 sec.

I checked Desktop browsers behaviour is same.

@kumarashu123
Copy link
Author

@dsilhavy Issue is not seen in 3.1.0 version on seek(0) it plays from beginning. so I assume content does not have issue.
Is there any setting i need to include to work seek in 4.7.2, 4.7.4 for dynamic content?

@dsilhavy
Copy link
Collaborator

There is no specific setting. Please provide the URL to your stream to reproduce

@kumarashu123
Copy link
Author

@dsilhavy Thanks! I do not have clear content now, i have requested for clear content. Once i get i will share.

I was tracking back this issue, i found issue started from version 3.2.0. Less than 3.2.0 seek works from 0 position.

@kumarashu123 kumarashu123 changed the title Issue in Linear restart playback Issue in Live restart playback Dec 4, 2024
@kumarashu123
Copy link
Author

@dsilhavy when i do restart Live playback below is the .mpd response. does this mpd response will help to figure out issue?
<?xml version="1.0" encoding="UTF-8"?> <MPD minBufferTime="PT6.002S" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:mspr="urn:microsoft:playready" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" availabilityStartTime="2024-12-04T09:02:59.195Z" minimumUpdatePeriod="PT6.002S" publishTime="2024-12-04T09:41:08.812Z" suggestedPresentationDelay="PT10S" timeShiftBufferDepth="PT38M0.002S"> <Period id="1720347286" start="PT0S" duration="PT38M0.002S"> <BaseURL>segments/CH36/1720347286/</BaseURL> <AdaptationSet bitstreamSwitching="false" contentType="video" id="1" mimeType="video/mp4" segmentAlignment="true"> <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="MSPR 2.0" cenc:default_KID="11dda829-f35f-7688-23ed-10271dd41510"> <mspr:pro>XXXXX</mspr:pro> </ContentProtection> <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="11dda829-f35f-7688-23ed-10271dd41510" /> <SegmentTemplate initialization="repid/$RepresentationID$/pts/155997268167756/init.mp4" media="repid/$RepresentationID$/pts/$Time$.m4f" startNumber="176205775" timescale="90000" presentationTimeOffset="155997268167756"> <SegmentTimeline> <S d="540000" r="278" t="155997268167756" /> <S d="540257" t="155997418827756" /> <S d="540000" r="99" t="155997419368013" /> </SegmentTimeline> </SegmentTemplate> <Representation bandwidth="500000" height="360" width="640" codecs="avc1.42801e" id="100/2001--profile--0.5" frameRate="25000/1000"> <BaseURL>abreinfo/eyJzdHJtSW5mIjp7InYiOjEsInN0IjoidiIsInRJZCI6MTAwLCJjZGMiOiJhdmMxIiwicHBzIjpbImFNNDFJQT09Il0sInNwcyI6WyJaMEtBSHAyVUNnTC9sd0ZDQWdJQ2dBQUFBd0NBQUFBWmNCQUE5Q0FBQzNHSDRud1UiXX19/</BaseURL> </Representation> <Representation bandwidth="1800000" height="720" width="1280" codecs="avc1.4d4020" id="100/2002--profile--1.8" frameRate="25000/1000"> <BaseURL>abreinfo/eyJzdHJtSW5mIjp7InYiOjEsInN0IjoidiIsInRJZCI6MTAwLCJjZGMiOiJhdmMxIiwicHBzIjpbImFPOTFJQT09Il0sInNwcyI6WyJaMDFBSUo1U2dLQUxkZ0tFQkFRRkFBQURBQUVBQUFNQU11QmdBRzNkQUFGSmx2eFBnb0E9Il19fQ/</BaseURL> </Representation> <Representation bandwidth="3800000" height="720" width="1280" codecs="avc1.4d4020" id="100/2003--profile--3.8" frameRate="25000/1000"> <BaseURL>abreinfo/eyJzdHJtSW5mIjp7InYiOjEsInN0IjoidiIsInRJZCI6MTAwLCJjZGMiOiJhdmMxIiwicHBzIjpbImFPOTFJQT09Il0sInNwcyI6WyJaMDFBSUo1U2dLQUxkZ0tFQkFRRkFBQURBQUVBQUFNQU11Q0FBRG43d0FCVytiOFQ0S0E9Il19fQ/</BaseURL> </Representation> <Representation bandwidth="4300000" height="1080" width="1920" codecs="avc1.64002a" id="100/2043--profile--4.3" frameRate="50000/1000"> <BaseURL>abreinfo/eyJzdHJtSW5mIjp7InYiOjEsInN0IjoidiIsInRJZCI6MTAwLCJjZGMiOiJhdmMxIiwicHBzIjpbImFPOTFKUT09Il0sInNwcyI6WyJaMlFBS3F3OHBRSGdDSitYQVVJQ0FnS0FBQUFEQUlBQUFESnhRQUFRWnlBQU1UVmZpZkJRIl19fQ/</BaseURL> </Representation> </AdaptationSet> <AdaptationSet bitstreamSwitching="false" contentType="video" id="2" maxPlayoutRate="10" mimeType="video/mp4" segmentAlignment="true"> <EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="2" /> <SegmentTemplate initialization="repid/$RepresentationID$/pts/155997268167756/init.mp4" media="repid/$RepresentationID$/pts/$Time$.m4f" startNumber="176205775" timescale="90000" presentationTimeOffset="155997268167756"> <SegmentTimeline> <S d="540000" r="278" t="155997268167756" /> <S d="540257" t="155997418827756" /> <S d="540000" r="99" t="155997419368013" /> </SegmentTimeline> </SegmentTemplate> <Representation bandwidth="500000" height="360" width="640" codecs="avc1.42801e" id="100/i-frame/avc/2001--profile--0.5_i-frame"> <BaseURL>abreinfo/eyJzdHJtSW5mIjp7InYiOjEsInN0IjoiaSIsInRJZCI6MTAwfX0/</BaseURL> </Representation> </AdaptationSet> <AdaptationSet bitstreamSwitching="false" contentType="audio" id="3" lang="eng" mimeType="audio/mp4" segmentAlignment="true"> <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="MSPR 2.0" cenc:default_KID="11dda829-f35f-7688-23ed-10271dd41510"> <mspr:pro>XXXXX</mspr:pro> </ContentProtection> <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="11dda829-f35f-7688-23ed-10271dd41510" /> <SegmentTemplate initialization="repid/$RepresentationID$/pts/155997268167756/init.mp4" media="repid/$RepresentationID$/pts/$Time$.m4f" startNumber="176205775" timescale="90000" presentationTimeOffset="155997268167756"> <SegmentTimeline> <S d="540000" r="278" t="155997268167756" /> <S d="540257" t="155997418827756" /> <S d="540000" r="99" t="155997419368013" /> </SegmentTimeline> </SegmentTemplate> <Representation audioSamplingRate="48000" bandwidth="96000" codecs="mp4a.40.2" id="300/2043--profile--4.3"> <BaseURL>abreinfo/eyJzdHJtSW5mIjp7InYiOjEsInN0IjoiYSIsInRJZCI6M319/</BaseURL> </Representation> </AdaptationSet> </Period> </MPD>

@kumarashu123
Copy link
Author

Is timeShiftBufferDepth is required for restart content ?
I tried manipulating manifest, updated timeshiftBufferDepth to Infinity then restart playback starting from zero(0).

this.dashPlayer.on(
DashJS.MediaPlayer.events.MANIFEST_LOADED,
this.updateTimeShiftBufferDepth,
);

avPreviewParseResolution = (evt) => {
evt.data.timeshiftBufferDepth = Infinity;
}

@dsilhavy
Copy link
Collaborator

dsilhavy commented Dec 4, 2024

  • I will need the possibility to start the stream myself to check if there are any issues with dash.js. Unfortunately, a snapshot of the MPD is not enough. As you are using <SegmentTimeline> the MPD might be missing the reference to segments at the beginning of the DVR window. You can set the log level of dash.js to debug and then search for logs that contain because of gap in the manifest. This indicates that there is a problem with the manifest and the seek target is adjusted.
  • The timeShiftBufferDepth defines the size of the DVR window. There is a good explanation here: https://dashif.org/Guidelines-TimingModel/#timing-availability

@kumarashu123
Copy link
Author

@dsilhavy Could you please share email id to share stream url?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants