From patchwork Wed Sep 28 10:21:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Scholz X-Patchwork-Id: 38429 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp106880pzh; Wed, 28 Sep 2022 03:21:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM56bvbfDM/DYTnQsiVLmAm/5ob959EBoy925yKrQHjEoYYHlKf/cxu57sYlA7ZH+UiIWWF9 X-Received: by 2002:aa7:cb83:0:b0:443:3f15:84fe with SMTP id r3-20020aa7cb83000000b004433f1584femr32819754edt.17.1664360479539; Wed, 28 Sep 2022 03:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664360479; cv=none; d=google.com; s=arc-20160816; b=arHaghEOjt1ZhKtXVcy0fCbW1gocQOFPO0ZgPaQ5Lu/7HKJ3m71aCk8ORpTQOisi69 NyOKfLaL6luMh4pFH1kFzHtwUJBazJF9RH637TpP8+asURnwHpsXVwps/QoleYRraibO NWT3NLXQ1U591IoQtPh8/GXI260r8vYoHhQ7iZJ0BMrZ+A2daFd7NFKAU4VGfG/1tmnK AFoUQjEyO0485EFKtJ7syhjetYQns34aOU+gaBIgf1780385LUqIuMYylRW1AKrNs2Rm kMB55YOKrGTKyWcz+L96nHp9Cbv1+bMaNLMI6mh/svfBEQ0GspQpa/lrNGL+V3+/IKN9 XTEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=b9INY7hfApShjO/aB5/bOd60a3ht4oy+wJR5ZzS7xRU=; b=lK6oN1ZK+++Rhtb1jrszkzB40mmTrSPx4KXazWUC33k5MBvzK0L9AiHvrDV2aMewqu IFTUWzcRmDBz6COG3nX0GJ+S90UNf0qucdfyBRxEzmBS9TRYrV349qo8LFg02X9PbHFl efvvr3wrq7ol61Zp4+DONAB5Kjxsc0fcHsfwZBAxcBhSaA2mMS+O/t0PwLkJ5nLMoApX OPBKJV3K7+O/4IgkeVQ/gLNQp3b+nw2di/iR7ViRG+PlrrhYO2u2s0StzvTtE5s7qKn4 oBF35Orp8z3O8MM8FSF6YQJP5FJYGhvGjnrzp893ZW2bJjMReb+RHKzptFv19iZWewza 4Nmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=n9qjgWIo; 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=QUARANTINE 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 z5-20020a05640240c500b00453e1a11542si4628406edb.493.2022.09.28.03.21.15; Wed, 28 Sep 2022 03:21:19 -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=20210112 header.b=n9qjgWIo; 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=QUARANTINE 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 D0F8F68BC71; Wed, 28 Sep 2022 13:21:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 94F4368BC68 for ; Wed, 28 Sep 2022 13:21:05 +0300 (EEST) Received: by mail-ej1-f53.google.com with SMTP id l14so26121381eja.7 for ; Wed, 28 Sep 2022 03:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=RHoQ2yuAl5vXa5FgA29cRh23Owv7LCFV347vogmGzTg=; b=n9qjgWIoHi1HQK0Pmt3bwVM75EL3QZ5guUMdn+2UOy2iSOQ4PegJrtKx88H8LmJIGc aqIX+sSnSg6x3ggI2V5ZSWoijE2oulCJI/qWZUC0Rz9CYIovcC0WrZsFViIzcXOHSzIO 95wSf+yUgap3+n8uY7UrpdQaR51w1lnax3CcjZ18thHiBv1GdA/ADY+0EKcCSD5cuBiM OX5Ccp8AT+lyz9nX8TX6cfeUG1ycbCstJQg28kTVySRhPOBU4CNB98+dqEi6VJ3wcZC0 Ob183jhGA4Si00y0yHoI+0S+bTpa/w+8sUGNrFIZuH5Tdh8Sy7MWZnxO+PhDL6kW8flw nGqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=RHoQ2yuAl5vXa5FgA29cRh23Owv7LCFV347vogmGzTg=; b=xXZKt3gnrHY38jz+gNRaKWZtbAnjv/pMfTL0dcAYy/zYB4xea6KUGOAv0LG342LT+y fKUe1eBu+uueaHt/Gz0llMc/objMxc5f+fICkuveYal1Kzb32af22ANj3+n8pfqWJzVt msnqP9s7YgF5y7QrToARGTeUVGPLC9ym5s9gdlQB9liK5STKsJtIjxXT/PTmd1okuncP HN4AFi+z2ZxvgJKbaWcydvBWBqhsCSgTBuiQ7YdH96XzzAfThxGroeeAWQ7scFAjjHPl woKIe/V/nw0zyhnBekfkqqioNVhib9Yjd8YFt7TegE3pLdaSL+Gz/EvyiOllrewA8vbU dSpA== X-Gm-Message-State: ACrzQf3RWsj993i8l6XuqDmu7/8kX6nsjtAuEMk2/FKj+mhNvgLjVoE6 Bi4jorRXSvejUaAmf26bA4FgWRM/CJc97A== X-Received: by 2002:a17:907:2bc3:b0:76f:5a9b:2039 with SMTP id gv3-20020a1709072bc300b0076f5a9b2039mr26061566ejc.534.1664360464693; Wed, 28 Sep 2022 03:21:04 -0700 (PDT) Received: from MBP-von-Marvin.citadel.scalie.me (84-112-104-25.cable.dynamic.surfer.at. [84.112.104.25]) by smtp.gmail.com with ESMTPSA id m17-20020a50c191000000b00456f569f31dsm3164632edf.75.2022.09.28.03.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 03:21:04 -0700 (PDT) From: Marvin Scholz To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Sep 2022 12:21:00 +0200 Message-Id: <20220928102101.37967-1-epirat07@gmail.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] ffmpeg: Make find_stream_info behave like a normal per-file option 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 Cc: Marvin Scholz Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UllEc1Ve6gyt Currently it would essentially change the find_stream_info setting for the file it was specified for and all following files, which is unusual and somewhat unexpected behaviour for a per-file option and not even documented to behave like this. --- fftools/ffmpeg.h | 1 + fftools/ffmpeg_opt.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index ede0b2bd96..3389ce5edc 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -126,6 +126,7 @@ typedef struct OptionsContext { int accurate_seek; int thread_queue_size; int input_sync_ref; + int find_stream_info; SpecifierOpt *ts_scale; int nb_ts_scale; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 5febe319e4..df1c8df454 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -190,7 +190,6 @@ static int input_stream_potentially_available = 0; static int ignore_unknown_streams = 0; static int copy_unknown_streams = 0; static int recast_media = 0; -static int find_stream_info = 1; static void uninit_options(OptionsContext *o) { @@ -240,6 +239,7 @@ static void init_options(OptionsContext *o) o->accurate_seek = 1; o->thread_queue_size = -1; o->input_sync_ref = -1; + o->find_stream_info = 1; o->shortest_buf_duration = 10.f; } @@ -1307,7 +1307,7 @@ static int open_input_file(OptionsContext *o, const char *filename) for (i = 0; i < ic->nb_streams; i++) choose_decoder(o, ic, ic->streams[i], HWACCEL_NONE, AV_HWDEVICE_TYPE_NONE); - if (find_stream_info) { + if (o->find_stream_info) { AVDictionary **opts = setup_find_stream_info_opts(ic, o->g->codec_opts); int orig_nb_streams = ic->nb_streams; @@ -4000,7 +4000,8 @@ const OptionDef options[] = { { "thread_queue_size", HAS_ARG | OPT_INT | OPT_OFFSET | OPT_EXPERT | OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(thread_queue_size) }, "set the maximum number of queued packets from the demuxer" }, - { "find_stream_info", OPT_BOOL | OPT_PERFILE | OPT_INPUT | OPT_EXPERT, { &find_stream_info }, + { "find_stream_info", OPT_BOOL | OPT_PERFILE | OPT_INPUT | OPT_EXPERT | OPT_OFFSET, + { .off = OFFSET(find_stream_info) }, "read and decode the streams to fill missing information with heuristics" }, { "bits_per_raw_sample", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(bits_per_raw_sample) },