Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Stefano Sabatini <stefasab@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Stefano Sabatini <stefasab@gmail.com>
Subject: [FFmpeg-devel] [PATCH 2/3] doc/filters: propose solutions to avoid shell escaping
Date: Sun, 26 Mar 2023 19:34:00 +0200
Message-ID: <20230326173401.56228-2-stefasab@gmail.com> (raw)
In-Reply-To: <20230326173401.56228-1-stefasab@gmail.com>

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".

  reply	other threads:[~2023-03-26 17:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 17:33 [FFmpeg-devel] [PATCH 1/3] doc/filters/drawtext: clarify meaning of strftime format string Stefano Sabatini
2023-03-26 17:34 ` Stefano Sabatini [this message]
2023-03-27  4:35   ` [FFmpeg-devel] [PATCH 2/3] doc/filters: propose solutions to avoid shell escaping Gyan Doshi
2023-03-28 22:30     ` Stefano Sabatini
2023-03-26 17:34 ` [FFmpeg-devel] [PATCH 3/3] doc/filters: mentions that whitespaces are ignored in the filtergraph specification Stefano Sabatini
2023-03-27  4:36   ` Gyan Doshi
2023-03-28 22:31     ` Stefano Sabatini
2023-03-27  4:36 ` [FFmpeg-devel] [PATCH 1/3] doc/filters/drawtext: clarify meaning of strftime format string Gyan Doshi
2023-03-28 22:31   ` Stefano Sabatini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230326173401.56228-2-stefasab@gmail.com \
    --to=stefasab@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git