From 33240c33dfd2b7288f3aa8b0d726a3ba3b0777ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Calles?= Date: Mon, 25 Nov 2013 09:59:04 +0000 Subject: [PATCH 1/3] fixed representation id naming --- dash/ngx_rtmp_dash_module.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dash/ngx_rtmp_dash_module.c b/dash/ngx_rtmp_dash_module.c index 8c86a8e..ab1b701 100644 --- a/dash/ngx_rtmp_dash_module.c +++ b/dash/ngx_rtmp_dash_module.c @@ -265,7 +265,7 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s) " maxHeight=\"%ui\"\n" \ " maxFrameRate=\"%ui\">\n" \ " \n" \ " width, codec_ctx->height, codec_ctx->frame_rate, + &ctx->name, codec_ctx->width, codec_ctx->height, codec_ctx->frame_rate, @@ -385,7 +386,8 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s) } if (ctx->has_audio) { - p = ngx_slprintf(buffer, last, NGX_RTMP_DASH_MANIFEST_AUDIO, + p = ngx_slprintf(buffer, last, NGX_RTMP_DASH_MANIFEST_AUDIO, + &ctx->name, codec_ctx->audio_codec_id == NGX_RTMP_AUDIO_AAC ? "40.2" : "6b", codec_ctx->sample_rate, From ba94a0c1e45585a293897490e1fe0bfb40520e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Calles?= Date: Mon, 25 Nov 2013 11:01:07 +0000 Subject: [PATCH 2/3] adding some HbbTV compliancy to MPD --- dash/ngx_rtmp_dash_module.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dash/ngx_rtmp_dash_module.c b/dash/ngx_rtmp_dash_module.c index ab1b701..2332572 100644 --- a/dash/ngx_rtmp_dash_module.c +++ b/dash/ngx_rtmp_dash_module.c @@ -253,8 +253,11 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s) " minimumUpdatePeriod=\"PT%uiS\"\n" \ " minBufferTime=\"PT%uiS\"\n" \ " timeShiftBufferDepth=\"PT0H0M0.00S\"\n" \ - " suggestedPresentationDelay=\"PT%uiS\"\n" \ - " profiles=\"urn:mpeg:dash:profile:isoff-live:2011\">\n" \ + " suggestedPresentationDelay=\"PT%uiS\"\n" \ + " profiles=\"urn:hbbtv:dash:profile:isoff-live:2012," \ + "urn:mpeg:dash:profile:isoff-live:2011\"\n" \ + " xmlns:xsi=\"http://www.w3.org/2011/XMLSchema-instance\"\n" \ + " xsi:schemaLocation=\"urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd\">\n" \ " \n" From ed68e4a2eb75be82fba1d3844f63d5a6f3d6ef2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Calles?= Date: Wed, 27 Nov 2013 17:04:09 +0000 Subject: [PATCH 3/3] added presentation delay to dash fragments + Repr. IDs --- dash/ngx_rtmp_dash_module.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dash/ngx_rtmp_dash_module.c b/dash/ngx_rtmp_dash_module.c index 2332572..844dbfa 100644 --- a/dash/ngx_rtmp_dash_module.c +++ b/dash/ngx_rtmp_dash_module.c @@ -263,6 +263,7 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s) #define NGX_RTMP_DASH_MANIFEST_VIDEO \ " \n" \ " buf->pos += 2; - return ngx_rtmp_dash_append(s, in, &ctx->audio, 0, h->timestamp); + return ngx_rtmp_dash_append(s, in, &ctx->audio, 0, h->timestamp, 0); } @@ -1016,7 +1018,9 @@ static ngx_int_t ngx_rtmp_dash_video(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, ngx_chain_t *in) { + u_char *p; uint8_t ftype, htype; + uint32_t delay; ngx_rtmp_dash_ctx_t *ctx; ngx_rtmp_codec_ctx_t *codec_ctx; ngx_rtmp_dash_app_conf_t *dacf; @@ -1049,6 +1053,14 @@ ngx_rtmp_dash_video(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, if (htype != 1) { return NGX_OK; } + + p = (u_char *) &delay; + + p[0] = in->buf->pos[4]; + p[1] = in->buf->pos[3]; + p[2] = in->buf->pos[2]; + p[3] = 0; + ctx->has_video = 1; @@ -1056,7 +1068,8 @@ ngx_rtmp_dash_video(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, in->buf->pos += 5; - return ngx_rtmp_dash_append(s, in, &ctx->video, ftype == 1, h->timestamp); + return ngx_rtmp_dash_append(s, in, &ctx->video, ftype == 1, h->timestamp, + delay); }