From patchwork Fri Apr 22 00:11:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Beauxis X-Patchwork-Id: 35370 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b9e:b0:7d:cfb5:dc7c with SMTP id b30csp91950pzh; Thu, 21 Apr 2022 17:12:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz59eUERKOMLTP06zXQyzLB8l0wswCn4AxUqj190DD7ilNpjI94u3jE/uATXceyzrQ+UvHP X-Received: by 2002:a17:906:d554:b0:6db:572b:df24 with SMTP id cr20-20020a170906d55400b006db572bdf24mr1725319ejc.193.1650586328363; Thu, 21 Apr 2022 17:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650586328; cv=none; d=google.com; s=arc-20160816; b=eZLBqlt2ujuwCkr0LSWOmxeGlcfKnllUcFIuqZsJKbt2yrUbeoSio6EnCpDmYUUTrm j3gVTydd0d/pDL4iIZ3AY5V0J72xx8c+No91re903zGzCCUxYvflQbhxKyrSro+tx2pR J9YuuQ6GWO+o3zX42zNHYu3HlmkmvxJ80Vj8y9BuYzKiqzRdnSojGZrfshYcPJCYmc/6 Mry+u9DOgPtPfkYQCZ7ggFD+CaLdwVf957eioqRDp9vWCi/6SjH6OAdpHiq9SIG4V9iY HVmhUUkQO/JQn5deCuS1Yc9xvLCb8kP5gbcWs9OpG667u4+l6opegwiKRfH4RATKLsXb VtBA== 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 :delivered-to; bh=zSmWypURCsrexe7llHD0SWGXpYm3zspW/wQEbxs5WCM=; b=zwm+kMKiE+SSlCvquOsOHUak2NNxPN6BGBQT0g7F5MoRQgCZrZBrI/YRz/PsQuiVW6 6J59OvZPAHU2RVlcE0fAZ2pIFOtWnc0AQzElJwNFxzkeVL9OY7i3q7pNbvScjMqQtZ+F 4cpMbvpXL06lfASGnIqrh5q9x3yCt2EZKyAjgCkP5DBwfKsNbCdHeH9NdSSjKRLfywZv PROlsl6bzdxLTIbXXaGdSDczu5NYJgfVGSHlf1P/n1Rl7IGsN6lthLQ0aWPbGc15onjG SshhafMX9EJg1qVHAW/s1pLd7yQ6tvMqmtEfxMV95VIysZbiqbgJ72pQ1iVnDOBuYF7B l7tw== 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 s9-20020a056402520900b0041ccf225491si5184676edd.457.2022.04.21.17.11.57; Thu, 21 Apr 2022 17:12:08 -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 63A9668B378; Fri, 22 Apr 2022 03:11:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D17CA68B261 for ; Fri, 22 Apr 2022 03:11:45 +0300 (EEST) Received: by mail-qv1-f42.google.com with SMTP id a5so4908559qvx.1 for ; Thu, 21 Apr 2022 17:11:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=F5GLb4+qkECNBZyfLHnfTsBMRcl79KaScdGzRkMQbkI=; b=wXJWygmITNm2lMLbPrAkovhiyq3lTjd1qTieg+4aH7cQR2+VLyZHMXcqQuDwg4cm/d SfPtwSoQOGgSrspY2oKbL8nZHNwbgWtMgfeIjeHZoTPn5zYrPjwmREE8IAqvm0TSZK6L d/yQ/IX1KbZGkicXTvfGWwzOzIXonmCiCLaDbkybzMA68cZYUPSRUbXFvmZVypInhKzL w9/B2wW9bWg4xg8YiUQVAuy8dMvUDPgmn4j5AxzHQZ3dza83C/ElGPhH3iNVGJvUrOdG aGlHa6TmbsSw5++0YK8tsO7qQGij6FMhP85I+EAFNIz3QCMvr56fKfXzKfdUsWL307RA 4w3Q== X-Gm-Message-State: AOAM532iId7jIJhwae9JdbKqrKoVRPYyDCCUJI/jpdqX9MLpVCm699qV iihVUhGWQ98qtv8x3SuMcLaTxFrCkCY5Yg== X-Received: by 2002:ad4:5943:0:b0:446:5c3e:2c2a with SMTP id eo3-20020ad45943000000b004465c3e2c2amr1534029qvb.75.1650586303956; Thu, 21 Apr 2022 17:11:43 -0700 (PDT) Received: from romains-mbp.lan ([172.58.159.158]) by smtp.gmail.com with ESMTPSA id r7-20020ac85c87000000b002f2048a946bsm375295qta.26.2022.04.21.17.11.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 21 Apr 2022 17:11:43 -0700 (PDT) From: toots@rastageeks.org To: ffmpeg-devel@ffmpeg.org Date: Thu, 21 Apr 2022 19:11:39 -0500 Message-Id: <20220422001139.39280-1-toots@rastageeks.org> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] fftools/opt_common.c: Display muxer/demuxer flags in help screen. 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: Romain Beauxis Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: CUJGJAKucQhG From: Romain Beauxis --- Showing muxer/demuxer flags can be very useful to quickly glance at specific properties, in particular global headers flags. This patch adds a display of these flags in the -h muxer=... and -h demuxer=... calls. fftools/opt_common.c | 78 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/fftools/opt_common.c b/fftools/opt_common.c index c303db4d09..c0daf0840a 100644 --- a/fftools/opt_common.c +++ b/fftools/opt_common.c @@ -424,6 +424,80 @@ static void show_help_codec(const char *name, int encoder) } } +const int fmt_flags[] = { + AVFMT_NOFILE, + AVFMT_NEEDNUMBER, + AVFMT_EXPERIMENTAL, + AVFMT_SHOW_IDS, + AVFMT_GLOBALHEADER, + AVFMT_NOTIMESTAMPS, + AVFMT_GENERIC_INDEX, + AVFMT_TS_DISCONT, + AVFMT_VARIABLE_FPS, + AVFMT_NODIMENSIONS, + AVFMT_NOSTREAMS, + AVFMT_NOBINSEARCH, + AVFMT_NOGENSEARCH, + AVFMT_NO_BYTE_SEEK, + AVFMT_ALLOW_FLUSH, + AVFMT_TS_NONSTRICT, + AVFMT_TS_NEGATIVE, + AVFMT_SEEK_TO_PTS +}; + +const char *fmt_flags_name[] = { + "AVFMT_NOFILE", + "AVFMT_NEEDNUMBER", + "AVFMT_EXPERIMENTAL", + "AVFMT_SHOW_IDS", + "AVFMT_GLOBALHEADER", + "AVFMT_NOTIMESTAMPS", + "AVFMT_GENERIC_INDEX", + "AVFMT_TS_DISCONT", + "AVFMT_VARIABLE_FPS", + "AVFMT_NODIMENSIONS", + "AVFMT_NOSTREAMS", + "AVFMT_NOBINSEARCH", + "AVFMT_NOGENSEARCH", + "AVFMT_NO_BYTE_SEEK", + "AVFMT_ALLOW_FLUSH", + "AVFMT_TS_NONSTRICT", + "AVFMT_TS_NEGATIVE", + "AVFMT_SEEK_TO_PTS" +}; + +const char *fmt_flags_help[] = { + "Demuxer will use avio_open, no opened file should be provided by the caller.", + "Needs 'd' in filename.", + "The muxer/demuxer is experimental and should be used with caution.", + "Show format stream IDs numbers.", + "Format wants global header.", + "Format does not need / have any timestamps.", + "Use generic index building code.", + "Format allows timestamp discontinuities.", + "Format allows variable fps.", + "Format does not need width/height.", + "Format does not require any streams.", + "Format does not allow to fall back on binary search via read_timestamp.", + "Format does not allow to fall back on generic search.", + "Format does not allow seeking by bytes.", + "Format allows flushing.", + "Format does not require strictly increasing timestamps, but they must still be monotonic.", + "Format allows muxing negative timestamps.", + "Seeking is based on PTS." +}; + +static void show_help_fmt_flags(int flags) { + int i; + + printf("flags:\n"); + + for (i = 0; i < sizeof(fmt_flags) / sizeof(fmt_flags[0]); i++) { + if (flags & fmt_flags[i]) + printf(" %s: %s\n", fmt_flags_name[i], fmt_flags_help[i]); + } +} + static void show_help_demuxer(const char *name) { const AVInputFormat *fmt = av_find_input_format(name); @@ -438,6 +512,8 @@ static void show_help_demuxer(const char *name) if (fmt->extensions) printf(" Common extensions: %s.\n", fmt->extensions); + show_help_fmt_flags(fmt->flags); + if (fmt->priv_class) show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM); } @@ -489,6 +565,8 @@ static void show_help_muxer(const char *name) printf(" Default subtitle codec: %s.\n", desc->name); } + show_help_fmt_flags(fmt->flags); + if (fmt->priv_class) show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM); }