nginx-rtmp-module icon indicating copy to clipboard operation
nginx-rtmp-module copied to clipboard

Fix support dash.js >= 2.1

Open sergey-dryabzhinsky opened this issue 9 years ago • 22 comments

As mentioned in https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/pull/121#issuecomment-221043812 Pull #121 broke dash.js support. Seems like we need to return availabilityEndTime back. Or don't. May be just need right times in playlist.

Use fix-121-dash-availabilityEndTime branch to test fixes and improvements.

sergey-dryabzhinsky avatar May 23 '16 19:05 sergey-dryabzhinsky

Strange, otherwise, its better to have UTCTiming element in MPD

ArhiChief avatar May 24 '16 17:05 ArhiChief

It's recommended. And if you needed it you must use link to the streaming server. And you should expire file by link:

# HTTP virt-host config

location /time.txt {
  expire -1;
  open_file_cache off;
}

sergey-dryabzhinsky avatar May 24 '16 21:05 sergey-dryabzhinsky

@ArhiChief Can you test latest code from fix-121-dash-availabilityEndTime branch with dash.js ~= 2.0.0 and shaka-player?

sergey-dryabzhinsky avatar May 24 '16 22:05 sergey-dryabzhinsky

Just add into rtmp config:

dash_clock_compensation http_head;
dash_clock_helper_uri http://your-rtmp-server/any-static-file-like-robots.txt;

And add forced expiration for that file in http config section.

sergey-dryabzhinsky avatar May 24 '16 22:05 sergey-dryabzhinsky

ok, I'll test it today

ArhiChief avatar May 31 '16 14:05 ArhiChief

I have just tested this branch and with the Dash.js 2.1 player the livestream stops after 3 seconds.

zydronium avatar Jun 05 '16 08:06 zydronium

I have tested http_head and ntp, both methods work fine. It can be closed now and merge fix-121-dash-availabilityEndTime branch to dev.

arition avatar Jun 15 '16 13:06 arition

@arition I waiting response from @ArhiChief @zydronium and dev branch working fine? Can you provide you config option for dash, stream encoding options like keyframe interval/GOP?

sergey-dryabzhinsky avatar Jun 16 '16 12:06 sergey-dryabzhinsky

@Iratu I wonder what is error was: Debug.js:108[40318] [object MediaError]. It may be video/audio decode error. Or playlist chunk download error. Or even chunk index desynchronization.

And maybe we need msec precision in times.

Can someone provide MPD-playlist from other software, like Wowza?

sergey-dryabzhinsky avatar Jun 19 '16 19:06 sergey-dryabzhinsky

Seems like we can add some precision to buffer/period times. And probably fix some roundup for int values.

sergey-dryabzhinsky avatar Jun 20 '16 11:06 sergey-dryabzhinsky

Updated fix-121-dash-availabilityEndTime branch. Please, check it with Dash 2.0 and 2.1.

sergey-dryabzhinsky avatar Jun 20 '16 11:06 sergey-dryabzhinsky

Freezes after 2 seconds of playback with 2.1.1 and all lower versions

Debug for 2.1.1: http://pastebin.com/F7qndhEV

Using the nightly, it doesn't load at all: http://pastebin.com/LcPjhpGd

The MPD that was used: http://pastebin.com/YpeuscSR

TimIsOverpowered avatar Jun 21 '16 16:06 TimIsOverpowered

@TimIsOverpowered It seems like your encoder has GOP/key_frame_interval option more than 2s. Or it produce keyframes not by 2s interval.

sergey-dryabzhinsky avatar Jun 22 '16 00:06 sergey-dryabzhinsky

@sergey-dryabzhinsky I have set dash_fragment to 2s and dash_playlist_length to 8s.

OBS' keyframe interval is set to 2 as well.

What could be the problem?

TimIsOverpowered avatar Jun 22 '16 02:06 TimIsOverpowered

Have same problem with Shaka player 2.0 beta2 in Firefox.

Player play 1 fragment (sometimes not) and hangs for about a minute, then video start playing normally. Seems like player out of sync. But player does sync request. Server provides Date header with proper CORS.

dash_fragment is default, 5s. publish_time_fix off. Stream is h264 baseline with GOP 2/s and CBR,

I have no idea, what difference between Chromium and Firefox. In Chromium same playback starts fast and play without lags.

Any suggestions?

skykohai avatar Jun 22 '16 22:06 skykohai

@sergey-dryabzhinsky When the keyframes are stable at 2s, it works great!

TimIsOverpowered avatar Jun 23 '16 19:06 TimIsOverpowered

@skykohai May be this Shaka issue https://github.com/google/shaka-player/issues/377 is related. Make sure that encoder GOP/keyframe is per 5s or less but dividable in terms of fps, playlist length dividable by 5s, wait_key on; in live app.

sergey-dryabzhinsky avatar Jun 26 '16 17:06 sergey-dryabzhinsky

Merged with dev.

sergey-dryabzhinsky avatar Jul 07 '16 16:07 sergey-dryabzhinsky