From f82ce6aa882b6ccb5727c4357e4862ad11acd229 Mon Sep 17 00:00:00 2001 From: Vignesh Venkatasubramanian Date: Tue, 21 Apr 2015 17:35:29 -0700 Subject: [PATCH] webmdashenc: parameter'ize minimumUpdatePeriod Some players do not support setting minimumUpdatePeriod to zero. This patch adds a new parameter that will let the users set any value to this field. Also updates the test and the documentation. Signed-off-by: Vignesh Venkatasubramanian Signed-off-by: Michael Niedermayer --- doc/muxers.texi | 4 ++++ libavformat/webmdashenc.c | 4 +++- tests/fate/vpx.mak | 2 +- tests/ref/fate/webm-dash-manifest-live | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index 335f093aaa..ddd7c7aa10 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -1253,6 +1253,10 @@ Smallest time (in seconds) shifting buffer for which any Representation is guaranteed to be available. This will go in the @samp{timeShiftBufferDepth} attribute of the @samp{MPD} element. Default: 60. +@item minimum_update_period +Minimum update period (in seconds) of the manifest. This will go in the +@samp{minimumUpdatePeriod} attribute of the @samp{MPD} element. Default: 0. + @end table @subsection Example diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c index e627a15f9a..1c63a5b0a4 100644 --- a/libavformat/webmdashenc.c +++ b/libavformat/webmdashenc.c @@ -56,6 +56,7 @@ typedef struct WebMDashMuxContext { int chunk_duration; char *utc_timing_url; double time_shift_buffer_depth; + int minimum_update_period; int debug_mode; } WebMDashMuxContext; @@ -116,7 +117,7 @@ static void write_header(AVFormatContext *s) } avio_printf(s->pb, " availabilityStartTime=\"%s\"\n", gmt_iso); avio_printf(s->pb, " timeShiftBufferDepth=\"PT%gS\"\n", w->time_shift_buffer_depth); - avio_printf(s->pb, " minimumUpdatePeriod=\"0\""); + avio_printf(s->pb, " minimumUpdatePeriod=\"PT%dS\"", w->minimum_update_period); avio_printf(s->pb, ">\n"); avio_printf(s->pb, "pb, " schemeIdUri=\"%s\"\n", @@ -517,6 +518,7 @@ static const AVOption options[] = { { "chunk_duration_ms", "duration of each chunk (in milliseconds)", OFFSET(chunk_duration), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, { "utc_timing_url", "URL of the page that will return the UTC timestamp in ISO format", OFFSET(utc_timing_url), AV_OPT_TYPE_STRING, { 0 }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM }, { "time_shift_buffer_depth", "Smallest time (in seconds) shifting buffer for which any Representation is guaranteed to be available.", OFFSET(time_shift_buffer_depth), AV_OPT_TYPE_DOUBLE, { .dbl = 60.0 }, 1.0, DBL_MAX, AV_OPT_FLAG_ENCODING_PARAM }, + { "minimum_update_period", "Minimum Update Period (in seconds) of the manifest.", OFFSET(minimum_update_period), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, { NULL }, }; diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak index 5eaf8fbbe3..0e7e7eb5ad 100644 --- a/tests/fate/vpx.mak +++ b/tests/fate/vpx.mak @@ -44,7 +44,7 @@ FATE_VP8-$(call DEMDEC, WEBM_DASH_MANIFEST, VP8) += fate-webm-dash-manifest-repr fate-webm-dash-manifest-representations: CMD = run ffmpeg -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video1.webm -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video4.webm -c copy -map 0 -map 1 -f webm_dash_manifest -adaptation_sets "id=0,streams=0,1" - FATE_VP8-$(call DEMDEC, WEBM_DASH_MANIFEST, VP8) += fate-webm-dash-manifest-live -fate-webm-dash-manifest-live: CMD = run ffmpeg -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -debug_mode 1 - +fate-webm-dash-manifest-live: CMD = run ffmpeg -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -minimum_update_period 60 -debug_mode 1 - FATE_SAMPLES_AVCONV += $(FATE_VP6-yes) fate-vp6: $(FATE_VP6-yes) diff --git a/tests/ref/fate/webm-dash-manifest-live b/tests/ref/fate/webm-dash-manifest-live index c682ecc7d2..91a1c1dcee 100644 --- a/tests/ref/fate/webm-dash-manifest-live +++ b/tests/ref/fate/webm-dash-manifest-live @@ -8,7 +8,7 @@ profiles="urn:mpeg:dash:profile:isoff-live:2011" availabilityStartTime="" timeShiftBufferDepth="PT7200S" - minimumUpdatePeriod="0"> + minimumUpdatePeriod="PT60S">