From patchwork Fri Aug 20 15:27:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29645 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1362503iov; Fri, 20 Aug 2021 08:27:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynElundrqDkracvhDstAnfGs7vcX8oTxqugqSTcGscKNP8S03VYPcvX6d87roHT/+8FCez X-Received: by 2002:a17:906:5e59:: with SMTP id b25mr22185000eju.492.1629473263127; Fri, 20 Aug 2021 08:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629473263; cv=none; d=google.com; s=arc-20160816; b=jP4/cWDlf2tYtua7E+iEQp4RCD399kaomTz5ECF0C7o8iMx0d26MPqKEFXwpskLqpT quNl+4ffeQSG9PeMns/Gi80QKLf35doHiDnXDSm9AsL5Mir60A8nE8t2MBBKKAtpwkc4 7bv/EMTtPYe847aomWHRssogu4OqVdMQXU0FZ5cXCOvhNCeLdxr1Mai8tOp5gzH/Rwj0 5kQssr/gmzeC/S4PpNGtIZKNroRHLdLHsZAzo6qsU8oc3vlEfMnyaZ8KpZyypzF/akvY rX3N4qMZGPxvZlk+8XA9fO7avz2kWi/0JOE6Um+ys2N6Y4UjgdjBfMb26yEUZoMeqr1e kBng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=HbmYspA8ngiu3KbLJHat3bzysIMLA5Y9zwLpAyL3cAk=; b=HOopioMvnV7sxTXi+2J52RG1B3gdpGmv2/s0SisKxWRKdz29TkfY9kLTV0iD0DDcU/ +BsMBfPsVlWJumEZE9SdMdYZM0McpzcFWxRMQhj0cakvVvr67/b/BqxV4wfoKUKEXn6E zonPEua3DkmDCfE4CZtyFMfCxRzb13ILCUKMwbgE5YF4xnovJr+1ueFOXbrXDOTiMdHu Rx/aK4SlTM3vyJwKJrxfkfuLG0UvAgU/1zvmyWGdkvuxwzcg0eIC5fEMUMUhPgfrCPfy dWCG+AjyqQrOrWnc3yN6d5eq80dgQATidoBH0435GAg7LwzQDQfkUm6vIRfIdFzUr6cA Y+iw== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y21si6553242edq.281.2021.08.20.08.27.42; Fri, 20 Aug 2021 08:27:43 -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; 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 0DCB368A15F; Fri, 20 Aug 2021 18:27:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B910F680BBB for ; Fri, 20 Aug 2021 18:27:31 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 17KFRUYs009181 for ; Fri, 20 Aug 2021 17:27:31 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id C0D62EB5BC; Fri, 20 Aug 2021 17:27:30 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Aug 2021 17:27:25 +0200 Message-Id: <20210820152728.565116-1-george@nsup.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Fri, 20 Aug 2021 17:27:31 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 1/4] libavformat/concatdec: remove support for unsafe=-1 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: JhGQUpT5HLLk It only makes sense as the default value, but it is not the default since 689211d5727231c3fe92762d224dbadebdbf4e30. Signed-off-by: Nicolas George --- doc/demuxers.texi | 9 +++------ libavformat/concatdec.c | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) Second patch updated with Andrea's comments. Final patch removing the in-protocol option syntax withdrawn for now. Other patches unchanged. Will push soon. diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 5b8cf1bfea..5f18e4551b 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -96,8 +96,7 @@ backslash or single quotes. All subsequent file-related directives apply to that file. @item @code{ffconcat version 1.0} -Identify the script type and version. It also sets the @option{safe} option -to 1 if it was -1. +Identify the script type and version. To make FFmpeg recognize the format automatically, this directive must appear exactly as is (no extra space or byte-order-mark) on the very first @@ -177,7 +176,8 @@ This demuxer accepts the following option: @table @option @item safe -If set to 1, reject unsafe file paths. A file path is considered safe if it +If set to 1, reject unsafe file paths and directives. +A file path is considered safe if it does not contain a protocol specification and is relative and all components only contain characters from the portable character set (letters, digits, period, underscore and hyphen) and have no period at the beginning of a @@ -187,9 +187,6 @@ If set to 0, any file name is accepted. The default is 1. --1 is equivalent to 1 if the format was automatically -probed and 0 otherwise. - @item auto_convert If set to 1, try to perform automatic conversions on packet data to make the streams concatenable. diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 934e9c02fc..ed6b9d8044 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -118,7 +118,7 @@ static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile, size_t url_len; int ret; - if (cat->safe > 0 && !safe_filename(filename)) { + if (cat->safe && !safe_filename(filename)) { av_log(avf, AV_LOG_ERROR, "Unsafe file name '%s'\n", filename); FAIL(AVERROR(EPERM)); } @@ -476,8 +476,6 @@ static int concat_read_header(AVFormatContext *avf) av_log(avf, AV_LOG_ERROR, "Line %d: invalid version\n", line); FAIL(AVERROR_INVALIDDATA); } - if (cat->safe < 0) - cat->safe = 1; } else { av_log(avf, AV_LOG_ERROR, "Line %d: unknown keyword '%s'\n", line, keyword); @@ -757,7 +755,7 @@ static int concat_seek(AVFormatContext *avf, int stream, static const AVOption options[] = { { "safe", "enable safe mode", - OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = 1}, -1, 1, DEC }, + OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC }, { "auto_convert", "automatically convert bitstream format", OFFSET(auto_convert), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC }, { "segment_time_metadata", "output file segment start time and duration as packet metadata", From patchwork Fri Aug 20 15:27:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29644 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1362644iov; Fri, 20 Aug 2021 08:27:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP+ZGCqZHMXs8YSKFAow9PI0Vi5P1kJ2YaqQXKmHWU/v4uZGGredgHTwjjmtvUiwzBqeqS X-Received: by 2002:a17:907:75d0:: with SMTP id jl16mr193814ejc.38.1629473273157; Fri, 20 Aug 2021 08:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629473273; cv=none; d=google.com; s=arc-20160816; b=hefblknBVWWD0p2TEjgbcD4CNquusMMfbmuRVI1H+5jWKa5iib8baCtCrUJ25PGN7X toCinb2qbl+Wbfy73eYCGbWkKJ5jAxYkTWHnV7O3twUjkFy6bt/WtuBd4Kje53KFBldX o458DO0igAvdzp86eeWQ/iPLyIbDR8ygeNqY92P6LMFdccOuZWG8CCVKGVI2/5S7DgJQ dlzSV92R5Muh/ABbmSu2+R7HnATXm3SSE0oAaPpc3cq1/skygoBEfli4ujzpmZx6YdnE 6MH6jgPQlgIreZnIq/La5gOgigXGYmWUY/ec7nNezS2LlCGukttRqPRtJmgFHlqNF7Q9 pO1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=8/6BZaquvGIv9ydct5LJB40dPlg/zp7lYVHasx1EQRI=; b=X7JDaV4ojEQu8hR/gOr1ufyg4Eho4Me703mP82yutCWiVnqTOyugjhqU6pMUSmmds5 9NMuIyPHrr73qzrrpNdgvfxaPo6zhNF3QwOdpXZrJGI3eYIo94pEOcxEDjxxn5mj6yUv tAD8v5f2WmypeotjGGdIz4glfq8Eh0OAEOziO+6GqVtC2uVN8piW5ykG7rq19/u7J2Y8 m1pMSDn0sejNgBGUMcs73DrrY7L4Eh0G1kFEhY55k7s4QNokKGtd6qhfEmS2tspHWCNv ryCH1DotZFkTT7kUerkQ00kXeKZyFZQ8p9mQDpVKGRWtFaOs2EvXTiEXb54NNFCBO1xE T0rA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b6si7815828edu.115.2021.08.20.08.27.52; Fri, 20 Aug 2021 08:27:53 -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; 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 37A8168A306; Fri, 20 Aug 2021 18:27:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B666680BBB for ; Fri, 20 Aug 2021 18:27:32 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 17KFRVuf009188 for ; Fri, 20 Aug 2021 17:27:31 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 860C2EB5BC; Fri, 20 Aug 2021 17:27:31 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Aug 2021 17:27:26 +0200 Message-Id: <20210820152728.565116-2-george@nsup.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210820152728.565116-1-george@nsup.org> References: <20210820152728.565116-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Fri, 20 Aug 2021 17:27:31 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 2/4] lavf/concatdec: support per-file options X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Pgith/vN5vnL Signed-off-by: Nicolas George --- doc/demuxers.texi | 4 ++++ libavformat/concatdec.c | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 5f18e4551b..eb3351833a 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -151,6 +151,10 @@ Metadata of the packets of the file. The specified metadata will be set for each file packet. You can specify this directive multiple times to add multiple metadata entries. +@item @code{option @var{key} @var{value}} +Option to access, open and probe the file. +Can be present multiple times. + @item @code{stream} Introduce a stream in the virtual file. All subsequent stream-related directives apply to the last introduced diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index ed6b9d8044..30db456b0e 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -52,6 +52,7 @@ typedef struct { int64_t inpoint; int64_t outpoint; AVDictionary *metadata; + AVDictionary *options; int nb_streams; } ConcatFile; @@ -330,6 +331,7 @@ static int open_file(AVFormatContext *avf, unsigned fileno) { ConcatContext *cat = avf->priv_data; ConcatFile *file = &cat->files[fileno]; + AVDictionary *options = NULL; int ret; if (cat->avf) @@ -345,12 +347,22 @@ static int open_file(AVFormatContext *avf, unsigned fileno) if ((ret = ff_copy_whiteblacklists(cat->avf, avf)) < 0) return ret; - if ((ret = avformat_open_input(&cat->avf, file->url, NULL, NULL)) < 0 || + ret = av_dict_copy(&options, file->options, 0); + if (ret < 0) + return ret; + + if ((ret = avformat_open_input(&cat->avf, file->url, NULL, &options)) < 0 || (ret = avformat_find_stream_info(cat->avf, NULL)) < 0) { av_log(avf, AV_LOG_ERROR, "Impossible to open '%s'\n", file->url); + av_dict_free(&options); avformat_close_input(&cat->avf); return ret; } + if (options) { + av_log(avf, AV_LOG_WARNING, "Unused options for '%s'.\n", file->url); + /* TODO log unused options once we have a proper string API */ + av_dict_free(&options); + } cat->cur_file = file; file->start_time = !fileno ? 0 : cat->files[fileno - 1].start_time + @@ -387,6 +399,7 @@ static int concat_read_close(AVFormatContext *avf) } av_freep(&cat->files[i].streams); av_dict_free(&cat->files[i].metadata); + av_dict_free(&cat->files[i].options); } if (cat->avf) avformat_close_input(&cat->avf); @@ -458,6 +471,26 @@ static int concat_read_header(AVFormatContext *avf) FAIL(AVERROR_INVALIDDATA); } av_freep(&metadata); + } else if (!strcmp(keyword, "option")) { + char *key, *val; + if (cat->safe) { + av_log(avf, AV_LOG_ERROR, "Options not permitted in safe mode.\n"); + FAIL(AVERROR(EPERM)); + } + if (!file) { + av_log(avf, AV_LOG_ERROR, "Line %d: %s without file\n", + line, keyword); + FAIL(AVERROR_INVALIDDATA); + } + if (!(key = av_get_token((const char **)&cursor, SPACE_CHARS)) || + !(val = av_get_token((const char **)&cursor, SPACE_CHARS))) { + av_freep(&key); + FAIL(AVERROR(ENOMEM)); + } + ret = av_dict_set(&file->options, key, val, + AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL); + if (ret < 0) + FAIL(ret); } else if (!strcmp(keyword, "stream")) { if (!avformat_new_stream(avf, NULL)) FAIL(AVERROR(ENOMEM)); From patchwork Fri Aug 20 15:27:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29643 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1362752iov; Fri, 20 Aug 2021 08:28:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzA387dob7DAgOekbc42MUeNiJ2lOypfR705vXo+FPbY6f/eVe1kzDZ9Ynbl/oGLeX8sbN4 X-Received: by 2002:a17:906:7716:: with SMTP id q22mr22783015ejm.457.1629473282997; Fri, 20 Aug 2021 08:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629473282; cv=none; d=google.com; s=arc-20160816; b=q2WbB1YpaMMrw5HswKTInWyus6iLJXZU+VwKgKwAdEHVWIUWDaxqQb8aZ2sGwlS7uv a6yQRJeqqOWHoFxmRjgg1Lpao9VeFYMgqsYY9nZwCAnCDWD0tWePiPRioAM+mbbgFLep ykUgMiD830B8Nhy2SBDm+NKSPh/p5Mp91xbZsGj6sTxsMPdu3JiNEAb8Qn63aA1G9B+2 FjZfSTYLypTLUpwqn+XlEwDQfEp35bLPOOmeBRTf5qiv6uVRlQNrrVC3uePPQ3k36QVX x7eEnBS45p7Dc2dHew5VChNg6qu3UfrERKUZXBJ/HyIxLJ5Va+S2ftsfJtqhUfMPuo3J VKiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=PYTFM7XCr1oP9/VmvAVwJQyBnJQ7h2WncHAAr11wGKw=; b=FDYU+dCiJBUNK11pAxegiYLA0udVf7X4Pdsoxqds5kJLx8v4oIxLPvm7iEe3IQzNMa Rf8o2WvfS6gjHSKJ4+UYcq/hBcN+VEZbREz34EttsD/m2qrNqCbI4FYgZ5lLKxl23nkb tX7ebsvs9d1jgaLg1ZVuaNfmH8+XaxxmxwPytv4xD0ySltcEW0tSM0X1TKfQDZF8yQOM 8qpvvXkCR5+DRzOCMY0vreUX5pU9nM17zDWYE/2A8bVdU0tq1QPAqZiw4K0gZhltZLSr bT9t3AXqDgzHiTsc0NnNVqyAyBdlgSUZkGzdYSwaBppWAKflkA/mS39GMpfYdXhyq7Ga KIZQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ar11si7275050ejc.701.2021.08.20.08.28.02; Fri, 20 Aug 2021 08:28:02 -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; 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 3390168A369; Fri, 20 Aug 2021 18:27:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 17F2368A199 for ; Fri, 20 Aug 2021 18:27:33 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 17KFRWg8009192 for ; Fri, 20 Aug 2021 17:27:32 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 44DFAEB5BC; Fri, 20 Aug 2021 17:27:32 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Aug 2021 17:27:27 +0200 Message-Id: <20210820152728.565116-3-george@nsup.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210820152728.565116-1-george@nsup.org> References: <20210820152728.565116-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Fri, 20 Aug 2021 17:27:32 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 3/4] tools/dvd2concat: document that -protocol_whitelist is needed X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: oQG2bmtkwCCD Signed-off-by: Nicolas George --- tools/dvd2concat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/dvd2concat b/tools/dvd2concat index 8effee86b9..0280838a6b 100755 --- a/tools/dvd2concat +++ b/tools/dvd2concat @@ -37,7 +37,8 @@ normally contains a directory named B. It must not be encrypted with CSS. I is the output file. It can be used as an input to ffmpeg. -It will require the B<-safe 0> option. +It will require the B<-safe 0> and +B<-protocol_whitelist file,subfile,concat> options. =cut From patchwork Fri Aug 20 15:27:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29646 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp1362907iov; Fri, 20 Aug 2021 08:28:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4x92+sTiyIv7rG2yojSe1/BtrZQLTwGHCS1WfW9YEEYXZzqEGogIXELO13Oz2KanSfLre X-Received: by 2002:a05:6402:2029:: with SMTP id ay9mr22653195edb.236.1629473294075; Fri, 20 Aug 2021 08:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629473294; cv=none; d=google.com; s=arc-20160816; b=sV1WqBOUbLTUkNiZsQks5xz/X2LvRUWyOVqYZRIwSu1b0uTOXfWishMYuMwotfYvwc b+31XpIUwnBnUYQezHx1upC+PEl2i5M4KO2WWXTpkYV4ZEdPDPvtPvma/cM1VWkIaPZI KKqG3Q96J8zyVVC/FIJHtrgZlHFvFsaifAJc1MmJfpWUgQdl/wj6laIz/sARanYBFCWB y/67mUpGsp4HZI6dMjKd6Bzt3xG0+SGkHwbtZgoGXA5I9RYBj9Nww6tEBFN29Lhg/szj mh7n4eTXVp5MgyDLxpviJqOFdjtDdDVGrp1Ia9OsPF0p2MMXbsdT9bQjpVD4DD3fIe6m ctSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=5Ht1gvWa3rvbcD/5lQSZ05JPkhPtHoHomhEjomprwTQ=; b=MN3o/F2zWD4y5qClOCAgxK0R3I2cA2eyC9d0c11Zmku88i1nXWiG54gAqsc4UzEXNM vM5xIe/QnYoXwcUCQQvwYpGdt+GPk0qmel6F+X1z/WsxyBgNMwXGiNPs9Blk32sA2mPs rqFQ8lr6Q8gySF1kRu9KM5KkAaSmpn/6uwKynVjMKU2E0XhYu9OL+HiG6gsZtMzm7sh3 rsT7vjrrPABlTa/JuCwl1WfMUpCz/Ie1GyHV4GamCTX8ude08kklfpIrIMYMkqdSIanf R4KWRQjzuzSYUZakccL9pTBiRmbegcmSFAltfqb+9dmzY7xRTHYlF6ker0uQWnF4FLsT vu3g== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qb41si4079421ejc.234.2021.08.20.08.28.13; Fri, 20 Aug 2021 08:28:14 -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; 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 63A6F68A3B0; Fri, 20 Aug 2021 18:27:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CFD8B68A26E for ; Fri, 20 Aug 2021 18:27:33 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 17KFRXft009196 for ; Fri, 20 Aug 2021 17:27:33 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 0A139EB5BC; Fri, 20 Aug 2021 17:27:32 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Fri, 20 Aug 2021 17:27:28 +0200 Message-Id: <20210820152728.565116-4-george@nsup.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210820152728.565116-1-george@nsup.org> References: <20210820152728.565116-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Fri, 20 Aug 2021 17:27:33 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 4/4] tools/dvd2concat: use option keyword X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: xuFPLbfe6ejU subfile,,start,X,end,Y,,: is ugly and will be gone some day. Signed-off-by: Nicolas George --- tools/dvd2concat | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/dvd2concat b/tools/dvd2concat index 0280838a6b..ef04a87d05 100755 --- a/tools/dvd2concat +++ b/tools/dvd2concat @@ -117,10 +117,12 @@ for my $cell (@{$track->{cell}}) { my $file = @files == 1 ? $files[0] : "concat:" . join("|", @files); my $start = $off << 11; my $end = ($off + $size) << 11; - $file = "subfile,,start,${start},end,${end},,:$file"; my $dur = int(1000 * $cell->{length}); - $concat .= sprintf "\nfile '%s'\nduration %02d:%02d:%02d.%03d\n", $file, + $concat .= "\nfile 'subfile:$file'\n"; + $concat .= "option start $start\n"; + $concat .= "option end $end\n"; + $concat .= sprintf "duration %02d:%02d:%02d.%03d\n", int($dur / 3600000), int($dur / 60000) % 60, int($dur / 1000) % 60, $dur % 1000; }