From patchwork Sat Jan 21 14:39:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_Gro=C3=9Fe?= X-Patchwork-Id: 2272 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp529148vsb; Sat, 21 Jan 2017 06:40:23 -0800 (PST) X-Received: by 10.223.134.68 with SMTP id 4mr19486384wrw.49.1485009623142; Sat, 21 Jan 2017 06:40:23 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f38si11808418wrf.325.2017.01.21.06.40.22; Sat, 21 Jan 2017 06:40:23 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CE62168A829; Sat, 21 Jan 2017 16:39:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from james.theweblords.de (james.theweblords.de [217.11.55.87]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C221A68A7E8 for ; Sat, 21 Jan 2017 16:39:13 +0200 (EET) Received: (qmail 28141 invoked by uid 210); 21 Jan 2017 14:39:25 -0000 X-Qmail-Scanner-Diagnostics: from x5d808bdc.dyn.telefonica.de (petronios@theweblords.de@x5d808bdc.dyn.telefonica.de) by james (envelope-from , uid 201) with qmail-scanner-2.10st (mhr: 1.0. spamassassin: 3.4.1. perlscan: 2.10st. Clear:RC:1(93.128.139.220):. Processed in 0.045377 secs); 21 Jan 2017 14:39:25 -0000 Received: from x5d808bdc.dyn.telefonica.de (HELO montepegro.fem.tu-ilmenau.de) (petronios@theweblords.de@93.128.139.220) by james.theweblords.de with ESMTPA; 21 Jan 2017 14:39:25 -0000 From: =?UTF-8?q?Peter=20Gro=C3=9Fe?= To: ffmpeg-devel@ffmpeg.org Date: Sat, 21 Jan 2017 15:39:06 +0100 Message-Id: <20170121143909.29028-6-pegro@friiks.de> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170121143909.29028-1-pegro@friiks.de> References: <20170121143909.29028-1-pegro@friiks.de> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/8] libavformat/dashenc: add option to provide UTC timing source X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: ischluff@mailbox.org, pegro@friiks.de Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" If set, adds a UTCTime tag in the manifest. See http://vm2.dashif.org/dash.js/docs/jsdocs/MediaPlayer.html#addUTCTimingSource for more information. Usable default: "https://time.akamai.com/?iso" Signed-off-by: Peter Große --- libavformat/dashenc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 054d0c0..fd1a304 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -95,6 +95,7 @@ typedef struct DASHContext { const char *single_file_name; const char *init_seg_name; const char *media_seg_name; + const char *utc_timing_url; AVRational min_frame_rate, max_frame_rate; int ambiguous_frame_rate; } DASHContext; @@ -508,6 +509,8 @@ static int write_manifest(AVFormatContext *s, int final) av_free(escaped); } avio_printf(out, "\t\n"); + if(c->utc_timing_url) + avio_printf(out, "\t\n", c->utc_timing_url); if (c->window_size && s->nb_streams > 0 && c->streams[0].nb_segments > 0 && !c->use_template) { OutputStream *os = &c->streams[0]; int start_index = FFMAX(os->nb_segments - c->window_size, 0); @@ -1048,6 +1051,7 @@ static const AVOption options[] = { { "single_file_name", "DASH-templated name to be used for baseURL. Implies storing all segments in one file, accessed using byte ranges", OFFSET(single_file_name), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, { "init_seg_name", "DASH-templated name to used for the initialization segment", OFFSET(init_seg_name), AV_OPT_TYPE_STRING, {.str = "init-stream$RepresentationID$.m4s"}, 0, 0, E }, { "media_seg_name", "DASH-templated name to used for the media segments", OFFSET(media_seg_name), AV_OPT_TYPE_STRING, {.str = "chunk-stream$RepresentationID$-$Number%05d$.m4s"}, 0, 0, E }, + { "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 }, { NULL }, };