[FFmpeg-devel] [PATCH] webmdashenc: parameter'ize minimumUpdatePeriod

Vignesh Venkatasubramanian vigneshv at google.com
Wed Apr 22 02:35:29 CEST 2015


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 at google.com>
---
 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 335f093..ddd7c7a 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.
 
+ at item minimum_update_period
+Minimum update period (in seconds) of the manifest. This will go in the
+ at 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 e627a15..1c63a5b 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, "<UTCTiming\n");
         avio_printf(s->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 5eaf8fb..0e7e7eb 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 c682ecc..91a1c1d 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">
 <UTCTiming
   schemeIdUri="urn:mpeg:dash:utc:direct:2012"
   value=""/>
-- 
2.2.0.rc0.207.ga3a616c



More information about the ffmpeg-devel mailing list