From patchwork Tue Sep 26 01:52:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodger Combs X-Patchwork-Id: 5280 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp3285027jaa; Mon, 25 Sep 2017 19:00:24 -0700 (PDT) X-Received: by 10.28.150.195 with SMTP id y186mr1863793wmd.52.1506391224328; Mon, 25 Sep 2017 19:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506391224; cv=none; d=google.com; s=arc-20160816; b=z9RynOaI7jY8IzmNmgJl3G5sXbEDcCKhV6emWHzId8I6MNo73KU7FcI6/MBif50C2e UnDV7I5f1eQvLLHpF40i7miu8o84iVZXScIkTZevO0xxz803EGEU1qrrqatRhPFBKS0z HCmRatcOqE0Kd4nsZWrX6STiSo3QAxpREEa0kjMCMGJnztw88qsJOMHXdkBwiiSm2t/B 31+zJRbXhna//VIXsmUdLEJ6dwisHjgncs1IJDl5K4+2Da4azpfu7YGiL7P0QtL4SAmt zlohzcFpYZo0afwxCq2l/jwLoY0t78F1CsC8mMPXau7FN4ie4osgCZw3HchL4KptU3yz SA/w== 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:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=lNN5p21oOrpXTYe8czOLfCPPoegxZNUtOmDNowfRcEg=; b=v6qHkUW4mzdztZd/JgHn2SZCgDA7EZp2lWpZdqhivgaawdCUMVEOuItEk09ld2JZ0T K2q3NCQ3nzImgxrylDD1o4AjW23TQ2syc/lxCK/lt9u1gvqC0sU/y6CJb1RlsE7QxGsB P2Z0luYn1RdAxFaZwjlDYKy4xDLO5n20pNdiUR0sfb0XiF93nrNjalBoxY08OMpCb8n8 hb3ES0ym44WPUGMsK7jgobCmPWCCbn19fGXLp8UyTa4yos96ELoJISVo8Uck0XVrCsm1 Rfs/B+O5VyxS9+qljEmXQzs+pVRJ4wXT25PkCR+dHcCfcMqN/w5DgNzEDPVsUM345hCJ ZzWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=gvXAdRul; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i66si609929wma.47.2017.09.25.19.00.23; Mon, 25 Sep 2017 19:00:24 -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=@gmail.com header.s=20161025 header.b=gvXAdRul; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B219E689B65; Tue, 26 Sep 2017 05:00:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f67.google.com (mail-it0-f67.google.com [209.85.214.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5CAC8689B12 for ; Tue, 26 Sep 2017 05:00:05 +0300 (EEST) Received: by mail-it0-f67.google.com with SMTP id 85so4495593ith.5 for ; Mon, 25 Sep 2017 19:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=kzakdL31CuTsMbi6k83ucBi2UDLUMhGcGERyCCtW9NQ=; b=gvXAdRulcKTnJuSMMiXmAVtABY2eqdIoHQGZnOBKY1EUdw9NWZ5kcCiYKUbVcatZfU rX84OLmlnTLwq1NdQwEEkQYLMGwEHKzTP91o+GoxjYmv4z8EV/n/w51AT2dy94lP0Yn1 tnFIDjXujihN6uK6mfXWzqVfsi9H5OUfVOiLMe38Xujr89PTmh40UrLXJGwtJDqL4QWz W5zu66FjJS4NEpmxJq/fNfl58xqrh7nPUTptBTfWRbxaXMNWHpAMtPsc2y2pr9qGkAH6 5p4YM5xISSsEwtvdkEI9r3u812MvPj49ahfpB8xe6+ZBo576UFbOq9YkTjGR5oM07XnJ taeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=kzakdL31CuTsMbi6k83ucBi2UDLUMhGcGERyCCtW9NQ=; b=MNxU8ZpzqeIFfF7VrMat4ePa50QDy7r04zgYYbgyXj1h2d3Y0o1ESUFGdaRTO6yQl2 QL9PeZlceWKHTgzk47ERgBp8r/K6eCp+EznLqXVyNCP2OHZNkRXE4nld1wJAStCyY5XA UdvVchpAnZM0+fhaOT1qphP87moG5SWc5qPZqWSk452O9LgI9921tUEXu/RsgyJyWtIQ pLMjt+7w/mLuNj2CfO6dfqKs3W3K3yJQH95eRSn9LCabpV9HwTJVkzKmtS2Gf7yY1IkI jVMCesuiqYfSJrvONdmMlH3P2F+iIhiOsaSqR26B/7kusJcqGXyfqZXNswtu9+wrfBaT ugQw== X-Gm-Message-State: AHPjjUiYZrGdMKekyZ0vRFv90myZg414GhWDPWY/o4b8ENcylveEvq7Q 7/9bRaPtBMblQAn5NV+fK562DR4M X-Google-Smtp-Source: AOwi7QA5ECMCKUDP2jBlJ2dhlN7cMwE3bNRe4ZanIDh/KXSl8/YAO5wgxRpuTKNSH3+TbOWuIKptXA== X-Received: by 10.36.198.196 with SMTP id j187mr3237294itg.125.1506390727087; Mon, 25 Sep 2017 18:52:07 -0700 (PDT) Received: from Rodgers-MacBook-Pro.local.net (c-73-75-100-12.hsd1.il.comcast.net. [73.75.100.12]) by smtp.gmail.com with ESMTPSA id x187sm210408ite.39.2017.09.25.18.52.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Sep 2017 18:52:05 -0700 (PDT) From: Rodger Combs To: ffmpeg-devel@ffmpeg.org Date: Mon, 25 Sep 2017 20:52:02 -0500 Message-Id: <20170926015202.42432-1-rodger.combs@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [FFmpeg-devel] [PATCH] lavf/dashenc: add format_options option, mirroring segment.c 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/dashenc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 6471649eb7..5e5bea54c4 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -90,6 +90,7 @@ typedef struct DASHContext { AVRational min_frame_rate, max_frame_rate; int ambiguous_frame_rate; const char *utc_timing_url; + const char *format_options_str; } DASHContext; static int dash_write(void *opaque, uint8_t *buf, int buf_size) @@ -551,6 +552,17 @@ static int dash_init(AVFormatContext *s) os->init_start_pos = 0; av_dict_set(&opts, "movflags", "frag_custom+dash+delay_moov", 0); + + if (c->format_options_str) { + ret = av_dict_parse_string(&opts, c->format_options_str, "=", ":", 0); + if (ret < 0) { + av_log(s, AV_LOG_ERROR, "Could not parse format options list '%s'\n", + c->format_options_str); + av_dict_free(&opts); + return ret; + } + } + if ((ret = avformat_init_output(ctx, &opts)) < 0) return ret; os->ctx_inited = 1; @@ -945,6 +957,7 @@ static const AVOption options[] = { { "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, E }, + { "format_options", "set list of options for the underlying mp4 muxer", OFFSET(format_options_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E }, { NULL }, };