From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5C76842112 for ; Sun, 26 Mar 2023 17:34:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 030FD68C42A; Sun, 26 Mar 2023 20:34:11 +0300 (EEST) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A17C168C3FE for ; Sun, 26 Mar 2023 20:34:04 +0300 (EEST) Received: by mail-ed1-f48.google.com with SMTP id r11so26798611edd.5 for ; Sun, 26 Mar 2023 10:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679852043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=l5RhwrCoxiWQIsGVpmKE8sTfFqq29hGr5fMjn/WQbQo=; b=AtaIGPadz3SauBAMRGI/zzyHSzaBEhD92358aYQw8jKFcYL57ORH24jDzWh5mWWp4g dSY7kd61TsQxyGR5zZ/Pw73BYk7YVPg3Pa/LLBy8B4ZX4Oo+CQcZv4uAo1iUMEBJxGV8 spPJ+rCBe6tZNWQ21FbyXNLirpy2wyEqxdEWh8W2KO0K+T/4wElKiE5yY0QzqmNHWpgs Zr17dCjgHiGSo/gKkwJDaR5zMdU29Ev6ULar4P8fX/IIM6vxPe4LS6lfYxdxt030Ah4C 67OFGOkMaO5NOFBG6R52E0aehMXE2fbH1HZVh4wQYvtS4qDWDf1ZlsqwvZ7jZmkMI33V 5Tfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679852043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l5RhwrCoxiWQIsGVpmKE8sTfFqq29hGr5fMjn/WQbQo=; b=sDOgTNl+IwJNvUx7NgJtXtf+r7dnI9BaNqTpXJUhPnVry031zHeCz9MygSlxnm21an F1YPysAGSkUvxMq2rBDpPN7N4CLwWDE5IH1K+6j1qVbK69gWFvulIwkE3VkvJwFwc+a2 wqwlXi4N7M96a74fzNybveIcb0/TW5O52nTfZh2IGpBFK2ym0dWOtI3e6//05yeIhS3q TkjHxjDnqo6WtwjUG8yjJ1qRNBTAmXzcfDJnlje6t8Ys72vrEtpoprsMuaLEexRwREP3 bSrpUXBJzxEfqspxVV2cfweRgbimsDixF9L0+pnTtUkJWlSDz+P6NSvUr3Zw1LcJ6n9Q 99Lg== X-Gm-Message-State: AAQBX9e1XJ5JkIU6J1/G0jHFSsI7dDvljX2CjINrYKVYNLL3iBdAHNio zXWkreRDQIDQzOzafU9/OYoF3zg1b/s= X-Google-Smtp-Source: AKy350bF+FP5O3ukjJOUecLqzImU9+SLo8Df9WLy0AsnSOSutKb4KpDG8xwlFy3FrnWcPH6p3tjLgQ== X-Received: by 2002:a17:907:d68f:b0:878:7189:a457 with SMTP id wf15-20020a170907d68f00b008787189a457mr9941636ejc.51.1679852043079; Sun, 26 Mar 2023 10:34:03 -0700 (PDT) Received: from mariano (dynamic-adsl-62-10-98-143.clienti.tiscali.it. [62.10.98.143]) by smtp.gmail.com with ESMTPSA id be1-20020a1709070a4100b009447277c2aasm668990ejc.39.2023.03.26.10.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Mar 2023 10:34:02 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 45F39BFB72; Sun, 26 Mar 2023 19:34:01 +0200 (CEST) From: Stefano Sabatini To: FFmpeg development discussions and patches Date: Sun, 26 Mar 2023 19:34:00 +0200 Message-Id: <20230326173401.56228-2-stefasab@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230326173401.56228-1-stefasab@gmail.com> References: <20230326173401.56228-1-stefasab@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] doc/filters: propose solutions to avoid shell escaping 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: Stefano Sabatini Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Reference drawtext textfile option and ffmpeg -filter_complext_script and -filter_script as solutils to avoid shell escaping. Address issue: http://trac.ffmpeg.org/ticket/9008 --- doc/ffmpeg.texi | 2 ++ doc/filters.texi | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index 6baf51bf0a..adfc2726ff 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -769,6 +769,7 @@ syntax. See the @ref{filter_complex_option,,-filter_complex option} if you want to create filtergraphs with multiple inputs and/or outputs. +@anchor{filter_script option} @item -filter_script[:@var{stream_specifier}] @var{filename} (@emph{output,per-stream}) This option is similar to @option{-filter}, the only difference is that its argument is the name of the file from which a filtergraph description is to be @@ -1978,6 +1979,7 @@ The default is the number of available CPUs. Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or outputs. Equivalent to @option{-filter_complex}. +@anchor{filter_complex_script option} @item -filter_complex_script @var{filename} (@emph{global}) This option is similar to @option{-filter_complex}, the only difference is that its argument is the name of the file from which a complex filtergraph diff --git a/doc/filters.texi b/doc/filters.texi index b397100ff8..1c9d523340 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -282,6 +282,18 @@ previous string will finally result in: -vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters" @end example +In order to avoid cumbersome escaping when using a commandline tool accepting a +filter specification as input, it is advisable to avoid direct inclusion of the +filter or options specification in the shell. + +For example, in case of the @ref{drawtext,,drawtext filter}, you might prefer to +use the @option{textfile} option in place of @option{text} to specify the text +to render. + +When using the @command{ffmpeg} tool, you might consider to use the +@ref{filter_script option,,-filter_script option,ffmpeg} or +@ref{filter_complex_script option,,-filter_complex_script option,ffmpeg}. + @chapter Timeline editing Some filters support a generic @option{enable} option. For the filters @@ -12359,11 +12371,11 @@ braces is a function name, possibly followed by arguments separated by ':'. If the arguments contain special characters or delimiters (':' or '@}'), they should be escaped. -Note that they probably must also be escaped as the value for the -@option{text} option in the filter argument string and as the filter -argument in the filtergraph description, and possibly also for the shell, -that makes up to four levels of escaping; using a text file avoids these -problems. +Note that they probably must also be escaped as the value for the @option{text} +option in the filter argument string and as the filter argument in the +filtergraph description, and possibly also for the shell, that makes up to four +levels of escaping; using a text file with the @option{textfile} option avoids +these problems. The following functions are available: -- 2.25.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".