[FFmpeg-devel] [PATCH] libavformat/dashenc.c:add support to change mpd update interval

Michael Niedermayer michael at niedermayer.cc
Tue Jun 2 11:10:04 EEST 2020


On Mon, Jun 01, 2020 at 06:21:40PM +0800, Siyuan Huang wrote:
> Hello Mr.James 
> 
>  
> 
> For this , in dash if . there are tcs whose segment type is SegmentTemplate
> ,and minimumUpdatePeriod is not 50 . 
> 
> (eg: https://livesim.dashif.org/livesim/mup_30/testpic_2s/Manifest.mpd)
> 
> Cause there is no rules in dash spec says , in template cases , the live
> miniupdateperiod should be 500s, 
> 
> So I modify my patch that , keep the 500 as the default minimumUpdatePeriod
> value , but add option to set this value for template cases 
> 
>  
> 
> B.R
> 
> Huang Siyuan 
> 

>  dashenc.c |    4 ++++
>  1 file changed, 4 insertions(+)
> dd5fe480cc5f00a97ae191281638dc5c5643d1b9  0001-libavformat-dashenc.c-add-support-to-change-mpd-upda.patch
> From fe662fef246c465f72b4e82c44cbe6fd62e73a4e Mon Sep 17 00:00:00 2001
> From: SiyuanHuang <saber.huang at samsung.com>
> Date: Mon, 1 Jun 2020 18:19:07 +0800
> Subject: [PATCH] libavformat/dashenc.c:add support to change mpd update
>  interval
> 
> according iso 23009-1 , in live cases , mpd refresh period should be changeable
> 
> Signed-off-by: SiyuanHuang <saber.huang at samsung.com>
> ---
>  libavformat/dashenc.c | 4 ++++
>  1 file changed, 4 insertions(+)
>  mode change 100644 => 100755 libavformat/dashenc.c
> 
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c

> old mode 100644
> new mode 100755

this looks unintended


> index 3f6c39f003..4143b94883
> --- a/libavformat/dashenc.c
> +++ b/libavformat/dashenc.c
> @@ -196,6 +196,7 @@ typedef struct DASHContext {
>      int target_latency_refid;
>      AVRational min_playback_rate;
>      AVRational max_playback_rate;
> +    int64_t update_period;
>  } DASHContext;
>  
>  static struct codec_string {
> @@ -1178,6 +1179,8 @@ static int write_manifest(AVFormatContext *s, int final)
>          char now_str[100];
>          if (c->use_template && !c->use_timeline)
>              update_period = 500;
> +        if (c->update_period)
> +            update_period = c->update_period;
>          avio_printf(out, "\tminimumUpdatePeriod=\"PT%"PRId64"S\"\n", update_period);
>          if (!c->ldash)
>              avio_printf(out, "\tsuggestedPresentationDelay=\"PT%"PRId64"S\"\n", c->last_duration / AV_TIME_BASE);

> @@ -2372,6 +2375,7 @@ static const AVOption options[] = {
>      { "target_latency", "Set desired target latency for Low-latency dash", OFFSET(target_latency), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT_MAX, E },
>      { "min_playback_rate", "Set desired minimum playback rate", OFFSET(min_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E },
>      { "max_playback_rate", "Set desired maximum playback rate", OFFSET(max_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E },
> +    {"update_period", "Set the mpd update interval", OFFSET(update_period), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E},

shouldnt this be AV_OPT_TYPE_INT64 ?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Nations do behave wisely once they have exhausted all other alternatives. 
-- Abba Eban
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200602/a5de6570/attachment.sig>


More information about the ffmpeg-devel mailing list