From patchwork Tue Apr 24 09:16:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dixit, Vishwanath" X-Patchwork-Id: 8623 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp1622313jad; Tue, 24 Apr 2018 02:17:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx487Q/381yV815N06zKJ01dCNNbbsHRrv8Gv4fJLg+lIRH9IDWv7PvWWRR4GUZuibsKu5/bS X-Received: by 2002:adf:b0c1:: with SMTP id j1-v6mr18549315wra.3.1524561458190; Tue, 24 Apr 2018 02:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524561458; cv=none; d=google.com; s=arc-20160816; b=dtMTmL9iej5R5tl3+nspf3iMpMJN90Z/hWJ3i2m6nfdzStBaSsm2Oy8aE32T8vwmCW NLvy0UGNVF7sG7eHYJBSUbAZ5KeN9gVE1h1s3DQZ3BI1rzbvSHp2X86X/RnS8HgfxeeM 1xX+eLNasM5Ghf6rrdMueRdIKuMOhr4n2GlKFO3xdb4FGskmZSenrzK+h6qGl+bz8vyP umK4TRcNmyxyTq2eXHTEdLCeV/8yrsUKwCNszxSmLDmE39FZBjBdMz0dk1s4mDGJrM7d VIAoD0uT1ydm1ech3T7uPF5OAwV4gljxzl89CkIAQMi2xhfsZRmkeW5R6iWNCLzMcliZ bcUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=f4xfZxx3mXMZGhMToH/kit5WwN/+1BFXmCWkBoyeXgE=; b=qVYAHCSmXa8211tMzGS9ermyK3AIafQFp3ToAS6A5Yz1B9TBPRd63bdONOpws6DAUa g8ZeDLiI+ZvE2INxiRobxOeEzzSR9FGSFEOepND/Zkt2myKSuMFZO82+ooEpwtJM5SS0 8radp25ECeyQ2Q1SeiGRlaOS1EHJCJOdEg1aYX+kSpuYJTbodGK6wHSM4HtIwxCuk7KA CYyfInt2V1y2EYUR+sItgIYyXyyyEb6hmpmKYhMz9Igycae/zd6k2bl1sntY1UgJxXmc 10JLKbR+G9+Iu6cskhuVuMlevrLKbjrkwUz/VRmm8HEy/uUPqlvofCY6yXWy9s28d/gI sGlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=GW1+9AWw; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g43-v6si10954393wrd.88.2018.04.24.02.17.37; Tue, 24 Apr 2018 02:17:38 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=GW1+9AWw; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D12BA689F9E; Tue, 24 Apr 2018 12:16:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a1i318.smtp2go.com (a1i318.smtp2go.com [43.228.185.62]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3BFFC689DB6 for ; Tue, 24 Apr 2018 12:16:41 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1524562336; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=0YWP03NCZSNZ4KZkFUw6YdYCp0sf9bG/Ou3qCc6QvJg=; b=GW1+9AWw vdrxdhCygSG39BpFxHfzqEtkJuWAimByJ4uscPU13BE4FwamTIwsV1JKtcHggarDAL3gLODItwaSl 51UFa67NuF4IYiFgy/G8ocZorjlexPkw9nHpUxi2dW/xcixUM6toi3oBOkVS7f4P295TMTLFt18+k ThSNY0MRf68FvN9gSqJGkGJvEiBNMEEr4h5f4MzjBiZQq2Q7efPGBGDnoUPYyrUcQMzSmi2w118aH REigMr8+vzdW+Cs/Mhcet8ZVMIOpIPiTpxG+QE+phD1Wc5ggngxKElrQKrpJeEGLThWlcF0K2D0sE 3VoqFGsv8WqRYmKbWxzw0y+fZw==; From: vdixit@akamai.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 24 Apr 2018 14:46:58 +0530 Message-Id: <1524561418-4419-3-git-send-email-vdixit@akamai.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1524561418-4419-1-git-send-email-vdixit@akamai.com> References: <1524561418-4419-1-git-send-email-vdixit@akamai.com> X-Smtpcorp-Track: 1fjI4R4baDCLlM.3rYShnvXG Feedback-ID: 337386m:337386asVRLGB:337386sY5RW0tBnA:SMTPCORP X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH 3/3] avformat/dashenc: configuring container format options 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: Vishwanath Dixit MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Vishwanath Dixit --- doc/muxers.texi | 4 ++++ libavformat/dashenc.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/doc/muxers.texi b/doc/muxers.texi index db81901..e9082a4 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -282,6 +282,10 @@ corrects that index value. Typically this logic is needed in live streaming use cases. The network bandwidth fluctuations are common during long run streaming. Each fluctuation can cause the segment indexes fall behind the expected real time position. +@item -format_options @var{options_list} +Set container format (mp4/webm) options using a @code{:} separated list of +key=value parameters. Values containing @code{:} special characters must be +escaped. @end table @anchor{framecrc} diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index fefe3ce..1ba5146 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -124,6 +124,7 @@ typedef struct DASHContext { int streaming; int64_t timeout; int index_correction; + char *format_options_str; } DASHContext; static struct codec_string { @@ -987,6 +988,11 @@ static int dash_init(AVFormatContext *s) av_dict_free(&opts); os->init_start_pos = 0; + if (c->format_options_str) { + ret = av_dict_parse_string(&opts, c->format_options_str, "=", ":", 0); + if (ret < 0) + return ret; + } if (!strcmp(os->format_name, "mp4")) { if (c->streaming) av_dict_set(&opts, "movflags", "frag_every_frame+dash+delay_moov", 0); @@ -1506,6 +1512,7 @@ static const AVOption options[] = { { "streaming", "Enable/Disable streaming mode of output. Each frame will be moof fragment", OFFSET(streaming), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, { "timeout", "set timeout for socket I/O operations", OFFSET(timeout), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT_MAX, .flags = E }, { "index_correction", "Enable/Disable segment index correction logic", OFFSET(index_correction), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, + { "format_options","set list of options for the container format (mp4/webm) used for dash", OFFSET(format_options_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E}, { NULL }, };