Browse code

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 <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Vignesh Venkatasubramanian authored on 2015/04/22 09:35:29
Showing 4 changed files
... ...
@@ -1253,6 +1253,10 @@ Smallest time (in seconds) shifting buffer for which any Representation is
1253 1253
 guaranteed to be available. This will go in the @samp{timeShiftBufferDepth}
1254 1254
 attribute of the @samp{MPD} element. Default: 60.
1255 1255
 
1256
+@item minimum_update_period
1257
+Minimum update period (in seconds) of the manifest. This will go in the
1258
+@samp{minimumUpdatePeriod} attribute of the @samp{MPD} element. Default: 0.
1259
+
1256 1260
 @end table
1257 1261
 
1258 1262
 @subsection Example
... ...
@@ -56,6 +56,7 @@ typedef struct WebMDashMuxContext {
56 56
     int chunk_duration;
57 57
     char *utc_timing_url;
58 58
     double time_shift_buffer_depth;
59
+    int minimum_update_period;
59 60
     int debug_mode;
60 61
 } WebMDashMuxContext;
61 62
 
... ...
@@ -116,7 +117,7 @@ static void write_header(AVFormatContext *s)
116 116
         }
117 117
         avio_printf(s->pb, "  availabilityStartTime=\"%s\"\n", gmt_iso);
118 118
         avio_printf(s->pb, "  timeShiftBufferDepth=\"PT%gS\"\n", w->time_shift_buffer_depth);
119
-        avio_printf(s->pb, "  minimumUpdatePeriod=\"0\"");
119
+        avio_printf(s->pb, "  minimumUpdatePeriod=\"PT%dS\"", w->minimum_update_period);
120 120
         avio_printf(s->pb, ">\n");
121 121
         avio_printf(s->pb, "<UTCTiming\n");
122 122
         avio_printf(s->pb, "  schemeIdUri=\"%s\"\n",
... ...
@@ -517,6 +518,7 @@ static const AVOption options[] = {
517 517
     { "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 },
518 518
     { "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 },
519 519
     { "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 },
520
+    { "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 },
520 521
     { NULL },
521 522
 };
522 523
 
... ...
@@ -44,7 +44,7 @@ FATE_VP8-$(call DEMDEC, WEBM_DASH_MANIFEST, VP8) += fate-webm-dash-manifest-repr
44 44
 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" -
45 45
 
46 46
 FATE_VP8-$(call DEMDEC, WEBM_DASH_MANIFEST, VP8) += fate-webm-dash-manifest-live
47
-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 -
47
+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 -
48 48
 
49 49
 FATE_SAMPLES_AVCONV += $(FATE_VP6-yes)
50 50
 fate-vp6: $(FATE_VP6-yes)
... ...
@@ -8,7 +8,7 @@
8 8
   profiles="urn:mpeg:dash:profile:isoff-live:2011"
9 9
   availabilityStartTime=""
10 10
   timeShiftBufferDepth="PT7200S"
11
-  minimumUpdatePeriod="0">
11
+  minimumUpdatePeriod="PT60S">
12 12
 <UTCTiming
13 13
   schemeIdUri="urn:mpeg:dash:utc:direct:2012"
14 14
   value=""/>