Dash.js: Live streaming delay increases after initial start

Created on 8 Mar 2017  Â·  16Comments  Â·  Source: Dash-Industry-Forum/dash.js

I am dashing live stream from a camera using GPAC and streaming with gpac-dash.js using the following options:

-segment-marker eods -chunk-media-segments -cors -no-marker-write

Each of my segments are 1s long with 200ms fragments.

In player (dash.js) settings, I used liveDelayFragmentCount = 1;

What I have noticed is, it starts well with a delay of about 4 sec. However, after a while which may vary anywhere between few sec to few minutes, it goes through a brief pause and the delay increases to around 10 sec and stays there. What might be the reason for this behavior? What can be done to keep the delay under 4 sec (max)?

stale

Most helpful comment

I am also facing the same issue. Latency in live streaming starts from 8 seconds initially and increases to 30 seconds over a period of time. Issue is persistent in chrome and firefox.

All 16 comments

When the player experiences a “brief pause”, what do the browser console network settings show? Was there a delay in retrieving one of the segments just prior to the pause? Is the player buffer empty when the pause occurs?

-Will

From: caruofc notifications@github.com
Reply-To: "Dash-Industry-Forum/dash.js" reply@reply.github.com
Date: Wednesday, March 8, 2017 at 11:26 AM
To: "Dash-Industry-Forum/dash.js" dash.js@noreply.github.com
Cc: Subscribed subscribed@noreply.github.com
Subject: [Dash-Industry-Forum/dash.js] Live streaming delay increases after initial start (#1820)

I am dashing live stream from a camera using GPAC and streaming with gpac-dash.js using the following options:

-segment-marker eods -chunk-media-segments -cors -no-marker-write

Each of my segments are 1s long with 200ms fragments.

In player (dash.js) settings, I used liveDelayFragmentCount = 1;

What I have noticed is, it starts well with a delay of about 4 sec. However, after a while which may vary anywhere between few sec to few minutes, it goes through a brief pause and the delay increases to around 10 sec and stays there. What might be the reason for this behavior? What can be done to keep the delay under 4 sec (max)?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Dash-2DIndustry-2DForum_dash.js_issues_1820&d=DwMCaQ&c=96ZbZZcaMF4w0F4jpN6LZg&r=KkevKJerDHRF9WRs8nW8Ew&m=4s6TEPDKSLffJl4b7eZ3N6dKFGQ4MNOEj1kCqu2xq40&s=EqgoTgDkk4VAqkBA0-y6i-638hXIfSJp2jJ_lFECVvg&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AComCmyNW-5FJEHqNreTPT6L0zew4y2fyPks5rjwDZgaJpZM4MXM1a&d=DwMCaQ&c=96ZbZZcaMF4w0F4jpN6LZg&r=KkevKJerDHRF9WRs8nW8Ew&m=4s6TEPDKSLffJl4b7eZ3N6dKFGQ4MNOEj1kCqu2xq40&s=94qev7y67bNIF6XByGZYvODi8ATakL1PNx18veqLw8I&e=.

Okay... following is a snap from chrome console. It seems the buffer got empty (see the bold texts). and then it stops for a while, build the buffer again and then resumes playback. Is there anyway to reduce the required buffer size under 5 sec to resume playback. It seems the current setting is close to 10 sec.

Debug.js:108 [31480] AbrController (video) stay on 0/0 (buffer: 0.285)
Debug.js:108 [31480] Getting the request for video time : 9954
Debug.js:108 [31481] Index for video time 9954 is 9953
Debug.js:108 [31481] SegmentTemplate: 9953 / Infinity
Debug.js:108 [31481] Getting the next request at index: 9954
Debug.js:108 [31885] Parsing complete: ( xml2json: 0.685ms, objectiron: 0.0700ms, total: 0.000755s)
Debug.js:108 [31885] Matching default timing source protocol to manifest protocol: http://time.akamai.com/?iso
Debug.js:108 [31886] Manifest has been refreshed at Wed Mar 08 2017 12:54:25 GMT-0700 (Mountain Standard Time)[1489002865.69]
Debug.js:108 [31886] Refresh manifest in 1 seconds.
Debug.js:108 [31973] Local time: Wed Mar 08 2017 12:54:25 GMT-0700 (Mountain Standard Time)
Debug.js:108 [31973] Server time: Wed Mar 08 2017 12:54:27 GMT-0700 (Mountain Standard Time)
Debug.js:108 [31973] Difference (ms): 1222
Debug.js:108 [31973] Manifest updated... updating data system wide.
Debug.js:108 [31974] Added 0 inline events
Debug.js:108 [31974] Schedule controller stopping for video
Debug.js:108 [31975] Requesting seek to time: 9944.339
Debug.js:108 [31976] Schedule controller starting for video
Debug.js:108 [31976] Seeking to: 9944.339
Debug.js:108 [31979] ThroughputRule requesting switch to index: 0 type: video Average throughput 866440 kbps
Debug.js:108 [31980] AbrController (video) stay on 0/0 (buffer: 0)
Debug.js:108 [31980] Getting the request for video time : 9944.339
Debug.js:108 [32481] ThroughputRule requesting switch to index: 0 type: video Average throughput 866440 kbps
Debug.js:108 [32482] AbrController (video) stay on 0/0 (buffer: 0)
Debug.js:108 [32482] Getting the request for video time : 9954
Debug.js:108 [32482] Index for video time 9954 is 9953
Debug.js:108 [32482] SegmentTemplate: 9953 / Infinity
Debug.js:108 [32482] Getting the next request at index: 9954
Debug.js:108 [32483] SegmentTemplate: 9954 / Infinity
Debug.js:108 [32498] Buffered Range for type: video : 9919.385 - 9944.286
Debug.js:108 [32498] Buffered Range for type: video : 9944.65 - 9954.256
Debug.js:108 [32501] ThroughputRule requesting switch to index: 0 type: video Average throughput 799080 kbps
Debug.js:108 [32501] AbrController (video) stay on 0/0 (buffer: 0)
Debug.js:108 [32501] Getting the request for video time : 9955
Debug.js:108 [32502] Index for video time 9955 is 9954
Debug.js:108 [32502] SegmentTemplate: 9954 / Infinity
Debug.js:108 [32503] Getting the next request at index: 9955
Debug.js:108 [32904] Parsing complete: ( xml2json: 1.68ms, objectiron: 0.0850ms, total: 0.00176s)
Debug.js:108 [32904] Matching default timing source protocol to manifest protocol: http://time.akamai.com/?iso
Debug.js:108 [32905] Manifest has been refreshed at Wed Mar 08 2017 12:54:26 GMT-0700 (Mountain Standard Time)[1489002866.709]
Debug.js:108 [32906] Refresh manifest in 1 seconds.
Debug.js:108 [32995] Local time: Wed Mar 08 2017 12:54:26 GMT-0700 (Mountain Standard Time)
Debug.js:108 [32996] Server time: Wed Mar 08 2017 12:54:28 GMT-0700 (Mountain Standard Time)
Debug.js:108 [32996] Difference (ms): 1200
Debug.js:108 [32996] Manifest updated... updating data system wide.
Debug.js:108 [32996] Added 0 inline events
Debug.js:108 [32997] Schedule controller stopping for video
Debug.js:108 [32997] Requesting seek to time: 9946.089
Debug.js:108 [32998] Schedule controller starting for video
Debug.js:108 [32998] Seeking to: 9946.089
Debug.js:108 [32998] Native video element event: playing
Debug.js:108 [32999] Got enough buffer to start.
Debug.js:108 [33000] ThroughputRule requesting switch to index: 0 type: video Average throughput 799080 kbps
Debug.js:108 [33001] AbrController (video) stay on 0/0 (buffer: 8.167)
Debug.js:108 [33001] Prior to making a request for time, NextFragmentRequestRule is aligning index handler's currentTime with bufferedRange.end. 9946.089 was changed to 9954.256
Debug.js:108 [33001] Getting the request for video time : 9954.256
Debug.js:108 [33001] Index for video time 9954.256 is 9953
Debug.js:108 [33001] SegmentTemplate: 9953 / Infinity
Debug.js:108 [33002] Getting the next request at index: 9954
Debug.js:108 [33002] SegmentTemplate: 9954 / Infinity
Debug.js:108 [33032] Buffered Range for type: video : 9919.385 - 9944.286
Debug.js:108 [33033] Buffered Range for type: video : 9944.65 - 9954.256
Debug.js:108 [33036] ThroughputRule requesting switch to index: 0 type: video Average throughput 133180 kbps
Debug.js:108 [33037] AbrController (video) stay on 0/0 (buffer: 8.167)
Debug.js:108 [33038] Getting the request for video time : 9955
Debug.js:108 [33039] Index for video time 9955 is 9954
Debug.js:108 [33039] SegmentTemplate: 9954 / Infinity
Debug.js:108 [33039] Getting the next request at index: 9955
Debug.js:108 [33040] SegmentTemplate: 9955 / Infinity
Debug.js:108 [33046] Native video element event: seeked
Debug.js:108 [33047] Native video element event: playing
Debug.js:108 [33047] Native video element event: ratechange: 1
Debug.js:108 [33077] Buffered Range for type: video : 9919.385 - 9944.286
Debug.js:108 [33077] Buffered Range for type: video : 9944.65 - 9955.256
Debug.js:108 [33080] ThroughputRule requesting switch to index: 0 type: video Average throughput 427000 kbps
Debug.js:108 [33080] AbrController (video) stay on 0/0 (buffer: 9.136)
Debug.js:108 [33081] Getting the request for video time : 9956

What does Chrome network console show when the buffer drops to zero? Are segments taking longer to be returned than their duration? Are 404’s being returned for the segment requests?

Also, I see “Refresh manifest in 1 seconds.” – what is your manifest refresh period? 1s is very low. Is playback stable if you change the manifest update period to 30s?

From: caruofc notifications@github.com
Reply-To: "Dash-Industry-Forum/dash.js" reply@reply.github.com
Date: Wednesday, March 8, 2017 at 12:05 PM
To: "Dash-Industry-Forum/dash.js" dash.js@noreply.github.com
Cc: "Law, Will" wilaw@akamai.com, Comment comment@noreply.github.com
Subject: Re: [Dash-Industry-Forum/dash.js] Live streaming delay increases after initial start (#1820)

Okay... following is a snap from chrome console. It seems the buffer got empty (see the bold texts). and then it stops for a while, build the buffer again and then resumes playback. Is there anyway to reduce the required buffer size under 5 sec to resume playback. It seems the current setting is close to 10 sec.

Debug.js:108 [31480] AbrController (video) stay on 0/0 (buffer: 0.285)
Debug.js:108 [31480] Getting the request for video time : 9954
Debug.js:108 [31481] Index for video time 9954 is 9953
Debug.js:108 [31481] SegmentTemplate: 9953 / Infinity
Debug.js:108 [31481] Getting the next request at index: 9954
Debug.js:108 [31885] Parsing complete: ( xml2json: 0.685ms, objectiron: 0.0700ms, total: 0.000755s)
Debug.js:108 [31885] Matching default timing source protocol to manifest protocol: http://time.akamai.com/?iso
Debug.js:108 [31886] Manifest has been refreshed at Wed Mar 08 2017 12:54:25 GMT-0700 (Mountain Standard Time)[1489002865.69]
Debug.js:108 [31886] Refresh manifest in 1 seconds.
Debug.js:108 [31973] Local time: Wed Mar 08 2017 12:54:25 GMT-0700 (Mountain Standard Time)
Debug.js:108 [31973] Server time: Wed Mar 08 2017 12:54:27 GMT-0700 (Mountain Standard Time)
Debug.js:108 [31973] Difference (ms): 1222
Debug.js:108 [31973] Manifest updated... updating data system wide.
Debug.js:108 [31974] Added 0 inline events
Debug.js:108 [31974] Schedule controller stopping for video
Debug.js:108 [31975] Requesting seek to time: 9944.339
Debug.js:108 [31976] Schedule controller starting for video
Debug.js:108 [31976] Seeking to: 9944.339
Debug.js:108 [31979] ThroughputRule requesting switch to index: 0 type: video Average throughput 866440 kbps
Debug.js:108 [31980] AbrController (video) stay on 0/0 (buffer: 0)
Debug.js:108 [31980] Getting the request for video time : 9944.339
Debug.js:108 [32481] ThroughputRule requesting switch to index: 0 type: video Average throughput 866440 kbps
Debug.js:108 [32482] AbrController (video) stay on 0/0 (buffer: 0)
Debug.js:108 [32482] Getting the request for video time : 9954
Debug.js:108 [32482] Index for video time 9954 is 9953
Debug.js:108 [32482] SegmentTemplate: 9953 / Infinity
Debug.js:108 [32482] Getting the next request at index: 9954
Debug.js:108 [32483] SegmentTemplate: 9954 / Infinity
Debug.js:108 [32498] Buffered Range for type: video : 9919.385 - 9944.286
Debug.js:108 [32498] Buffered Range for type: video : 9944.65 - 9954.256
Debug.js:108 [32501] ThroughputRule requesting switch to index: 0 type: video Average throughput 799080 kbps
Debug.js:108 [32501] AbrController (video) stay on 0/0 (buffer: 0)
Debug.js:108 [32501] Getting the request for video time : 9955
Debug.js:108 [32502] Index for video time 9955 is 9954
Debug.js:108 [32502] SegmentTemplate: 9954 / Infinity
Debug.js:108 [32503] Getting the next request at index: 9955
Debug.js:108 [32904] Parsing complete: ( xml2json: 1.68ms, objectiron: 0.0850ms, total: 0.00176s)
Debug.js:108 [32904] Matching default timing source protocol to manifest protocol: http://time.akamai.com/?iso
Debug.js:108 [32905] Manifest has been refreshed at Wed Mar 08 2017 12:54:26 GMT-0700 (Mountain Standard Time)[1489002866.709]
Debug.js:108 [32906] Refresh manifest in 1 seconds.
Debug.js:108 [32995] Local time: Wed Mar 08 2017 12:54:26 GMT-0700 (Mountain Standard Time)
Debug.js:108 [32996] Server time: Wed Mar 08 2017 12:54:28 GMT-0700 (Mountain Standard Time)
Debug.js:108 [32996] Difference (ms): 1200
Debug.js:108 [32996] Manifest updated... updating data system wide.
Debug.js:108 [32996] Added 0 inline events
Debug.js:108 [32997] Schedule controller stopping for video
Debug.js:108 [32997] Requesting seek to time: 9946.089
Debug.js:108 [32998] Schedule controller starting for video
Debug.js:108 [32998] Seeking to: 9946.089
Debug.js:108 [32998] Native video element event: playing
Debug.js:108 [32999] Got enough buffer to start.
Debug.js:108 [33000] ThroughputRule requesting switch to index: 0 type: video Average throughput 799080 kbps
Debug.js:108 [33001] AbrController (video) stay on 0/0 (buffer: 8.167)
Debug.js:108 [33001] Prior to making a request for time, NextFragmentRequestRule is aligning index handler's currentTime with bufferedRange.end. 9946.089 was changed to 9954.256
Debug.js:108 [33001] Getting the request for video time : 9954.256
Debug.js:108 [33001] Index for video time 9954.256 is 9953
Debug.js:108 [33001] SegmentTemplate: 9953 / Infinity
Debug.js:108 [33002] Getting the next request at index: 9954
Debug.js:108 [33002] SegmentTemplate: 9954 / Infinity
Debug.js:108 [33032] Buffered Range for type: video : 9919.385 - 9944.286
Debug.js:108 [33033] Buffered Range for type: video : 9944.65 - 9954.256
Debug.js:108 [33036] ThroughputRule requesting switch to index: 0 type: video Average throughput 133180 kbps
Debug.js:108 [33037] AbrController (video) stay on 0/0 (buffer: 8.167)
Debug.js:108 [33038] Getting the request for video time : 9955
Debug.js:108 [33039] Index for video time 9955 is 9954
Debug.js:108 [33039] SegmentTemplate: 9954 / Infinity
Debug.js:108 [33039] Getting the next request at index: 9955
Debug.js:108 [33040] SegmentTemplate: 9955 / Infinity
Debug.js:108 [33046] Native video element event: seeked
Debug.js:108 [33047] Native video element event: playing
Debug.js:108 [33047] Native video element event: ratechange: 1
Debug.js:108 [33077] Buffered Range for type: video : 9919.385 - 9944.286
Debug.js:108 [33077] Buffered Range for type: video : 9944.65 - 9955.256
Debug.js:108 [33080] ThroughputRule requesting switch to index: 0 type: video Average throughput 427000 kbps
Debug.js:108 [33080] AbrController (video) stay on 0/0 (buffer: 9.136)
Debug.js:108 [33081] Getting the request for video time : 9956

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Dash-2DIndustry-2DForum_dash.js_issues_1820-23issuecomment-2D285153081&d=DwMFaQ&c=96ZbZZcaMF4w0F4jpN6LZg&r=KkevKJerDHRF9WRs8nW8Ew&m=Ky8lasi4qjuKrCj1ci8Nmnlf_E_2aoneYqKvKx8O17o&s=OZ08FePpO2IKv7W74BQvgW9iveu_vasAIAnuwaPLIe0&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AComCpiLDOJc2MJu2TXvpEnl5jE4fFtoks5rjwoJgaJpZM4MXM1a&d=DwMFaQ&c=96ZbZZcaMF4w0F4jpN6LZg&r=KkevKJerDHRF9WRs8nW8Ew&m=Ky8lasi4qjuKrCj1ci8Nmnlf_E_2aoneYqKvKx8O17o&s=R-lw_mVaPAb-RD3y9RVedVdU0s3h2eOq4GDdDZZ-COY&e=.

All time in network is less than 1s. No 404 is found during the period of "brief pause" and the server seems sending segments without any issues. BTW, I changed manifest update period to 30s. nothing changed. seems its working as it was working before.

do you have the same problem in firefox ? and or with https h2 ?
https://bugs.chromium.org/p/chromium/issues/detail?id=695903

Checked in firefox and edge. Same performance.

Attaching .mpd, if that could help in any way.

dashcast.zip

I am also facing the same issue. Latency in live streaming starts from 8 seconds initially and increases to 30 seconds over a period of time. Issue is persistent in chrome and firefox.

Another question - if you leave the web page hosting the player in primary focus, does the delay also accrue? I have noticed on another player that when the tab or window is not active and I go off and do other work and then come back to check the stream, that it is behind, whereas if I sit and watch it, it has no problems. I am wondering if timers or other MSE processes in background tabs are getting deprioritized?

@wilaw I am also facing something similar. I am leaving my browser unattended for few minutes. and when I come back the latency of live stream increases.

When the page is not active setTimeout/setInterval timers are generally slowed down (half speed is a number I remember from the top of my head), but I'd hope dash.js isn't running anything like that, at least not so slowly as to cause this.

@wilaw I am encountering this issue too. I added some debug lines to print out the difference between video.currentTime and player().duration(). The difference is small (<1s) in the beginning, and I have a small latency (~8s). As time goes on, I get a few "Buffer is empty! Stalling!" logs from the DASH player. Each time this happens, the difference between video.currentTime and player().duration increases, and the latency increases by the same amount. After about 10 mins of streaming, the difference increases to about 6s, and the latency is about 13s.

Another interesting note is when I refresh the page, the latency stays at its previous high level. The same with the difference between video.currentTime and player().duration(). The player().duration() seems to be correct, so the DASH player is aware there are more segments. But it refuses to play anything that lies in the growing gap between video.currentTime and player().duration().

Is there any update to this issue? I saw the pull request https://github.com/Dash-Industry-Forum/dash.js/pull/2102 regarding skipping the gap when there is a small discontinuity in the buffer, and I wonder if that is a potential fix for this problem.

When the page is not active setTimeout/setInterval timers are generally slowed down (half speed is a number I remember from the top of my head), but I'd hope dash.js isn't running anything like that, at least not so slowly as to cause this.

As I see from chrome dev tools, fragments downloading is definitely slowing down on inactive tab.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed because no further activity occurred. If you think this issue is still relevant please reopen it. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattlohkamp picture mattlohkamp  Â·  4Comments

ruslandinov picture ruslandinov  Â·  4Comments

fvalleeHbbTV picture fvalleeHbbTV  Â·  3Comments

sandersaares picture sandersaares  Â·  5Comments

yogevNisim picture yogevNisim  Â·  3Comments