From patchwork Sun Mar 26 17:33:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Sabatini X-Patchwork-Id: 40840 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7a30:b0:df:834d:2c1a with SMTP id t48csp775214pzh; Sun, 26 Mar 2023 10:34:40 -0700 (PDT) X-Google-Smtp-Source: AKy350brdj4PULP572NLhygDWzTKgS3Km9SS29OtsFrP8CfTwuZ7xUNlA7Nqs1JnepkVF2ay7Vnj X-Received: by 2002:a17:906:519d:b0:939:5398:768e with SMTP id y29-20020a170906519d00b009395398768emr8220741ejk.7.1679852080657; Sun, 26 Mar 2023 10:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679852080; cv=none; d=google.com; s=arc-20160816; b=zczAnrePjkLZqUfJVkuqBdxPdnut49V7Q7lwh+kHoKuplZ1SdXEc7ED5xwtWCyKNo4 FkXvoYPhmqiIDOVLZb11xvOXPiLoyHczVI9ZRdwlqabhC15hoUYcMWIfqhhTDK93WPI1 3zDNfSsKZ6QOPqwnpQ4er9/O6dC1SYlFhmfiZE6QBnwiguWc6rPMhRJf6cqHCT7SQFn+ dUDppznpt1vVjakQqwFR6VRveTMvNnWvnaE0xJBLgLz8O/U9R6N4g4eHRRB7xAmrVeXi PxIikQXUB3TbzFlsTn029DsSbM7+5TvtPuKIV6V0WjD/726hFZGD3a+tMf29TdN1iOwI fcNA== 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=pJ5azGPkpT8pB+NSVu7Nhh5muEMsdq64yEsvD2GRWgw=; b=Qe9f/tm0TXChl7+ObhSaiQUW3upTCT30u0cbl0jv9Ee4qr2vIlt4IvnoVspXVFQSGi gbAawKAuV3RnzlX4xOUyhJV/iM18KBUqshFkZPrJFaex/Ezsxr78JGi5ysq9LtPIn5pl n1owGuhh0RlQDd5Ryh6VIS7cylayAzWPHKdaQhEGq1EfWM9ZaGuXkafcAnCOqK4h4jOZ /kGcc0942XLR9uyLgpI9YoVqj4e1b0jYWzpLCe+MUSYQSQ5ZXcySZ379NGnJ/zE2RkOP ZgbzSPV9A2lwICcW+eX+BAUbWRLiFk1Q/Q4rIUMwR57NgGySJGOGcKROoEhtWhifweGd p26w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=edIEgtes; 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 g12-20020a1709065d0c00b009453c587601si19336ejt.782.2023.03.26.10.34.33; Sun, 26 Mar 2023 10:34:40 -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=edIEgtes; 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 91C9668C558; Sun, 26 Mar 2023 20:34:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 54D2E68C4C9 for ; Sun, 26 Mar 2023 20:34:06 +0300 (EEST) Received: by mail-ed1-f42.google.com with SMTP id ew6so26731985edb.7 for ; Sun, 26 Mar 2023 10:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679852045; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=XWbSob47/fLpA74G47f+X0PN0J3gkfgVclyVT2gia1s=; b=edIEgtesVPgtK9mmIMve77WVC9djP+vmJO7imGVjXA1tyrKatQyUd3xbXjdpUCAYPz zKeYUzFPT7Gw75FjNAZ+sEMcxiGlR18hmzJ+YdODMe/iO58xkCBC0RzHq41AuNFY/0jd 79rr0/pXa8cSEThJj9RO5DkuoA5d3i51qFErf1eSdC/oTCMMJt3ilVL2Qh55ww9GmqYj DPjEdyU6cNP8pErKEEXoqheXYYJwAkP+kUA4Ea3IvAWXNILkjYnjbcz8vJvsY1t/yjym oi5ilSviHZuT+dN/xKN4yS6N8YnJQogaxWR7mW6ysTE/C9uI/pzK6Odr6ATTwK4jGg01 4y3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679852045; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XWbSob47/fLpA74G47f+X0PN0J3gkfgVclyVT2gia1s=; b=RtD9fVfqAYDDNKh0rfqV5A+AALorn8U+pNDYiB6vJPzbcYAttkSvteBWRB+8LusCen Yon5xDLgBJL4gWm+VrW9+rSxhvTpbvrPJDz8xnuBWWgCtZ7s7cPjRW7n4xKYjRR9K+Qc 9x77HHAZP1EigC6Enev3t+U3pR16YWAmJmS6NRAnTiyl+xcB2fBHUaEZtOFNWDUCMdl8 qvw6QHq9DoEs5ZE9ZKUNXcVPcsb23DMCF+YAumyfLyQxdp2CjcgxfLFzvF1xwbRFkoR6 73rGsaqXZjchOqYuYfGVbAm6z9gnctdviyvEBrTRRmK4aVn97/NoCDlwjqr6wNBcG7Fl cKFg== X-Gm-Message-State: AAQBX9fLQxlrD/VG+0s+lHmRTytDTmmi/05K450xDMcdk6v2BwDqZCly ZDhdZNPDcPgGgUOaSp/k3kf3NTCPedQ= X-Received: by 2002:a17:906:b24e:b0:930:21a:c80 with SMTP id ce14-20020a170906b24e00b00930021a0c80mr9974812ejb.47.1679852045131; Sun, 26 Mar 2023 10:34:05 -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 g7-20020a1709061c8700b0091f5e98abd5sm13184914ejh.133.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 43F0FBFB73; Sun, 26 Mar 2023 19:34:01 +0200 (CEST) From: Stefano Sabatini To: FFmpeg development discussions and patches Date: Sun, 26 Mar 2023 19:33:59 +0200 Message-Id: <20230326173401.56228-1-stefasab@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] doc/filters/drawtext: clarify meaning of strftime format string 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: u6LUOFFk2wzW Also clarify what should be used instead of the strftime expansion mode. --- doc/filters.texi | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 4449998ba4..b397100ff8 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -12103,13 +12103,12 @@ The default value of @var{bordercolor} is "black". @item expansion Select how the @var{text} is expanded. Can be either @code{none}, -@code{strftime} (deprecated) or -@code{normal} (default). See the @ref{drawtext_expansion, Text expansion} section -below for details. +@code{strftime} (deprecated) or @code{normal} (default). See the +@ref{drawtext_expansion, Text expansion} section below for details. @item basetime Set a start time for the count. Value is in microseconds. Only applied -in the deprecated strftime expansion mode. To emulate in normal expansion +in the deprecated @code{strftime} expansion mode. To emulate in normal expansion mode use the @code{pts} function, supplying the start time (in seconds) as the second argument. @@ -12340,10 +12339,12 @@ The current packet's size (in bytes). @anchor{drawtext_expansion} @subsection Text expansion -If @option{expansion} is set to @code{strftime}, -the filter recognizes strftime() sequences in the provided text and -expands them accordingly. Check the documentation of strftime(). This -feature is deprecated. +If @option{expansion} is set to @code{strftime}, the filter recognizes +sequences accepted by the @code{strftime} C function in the provided +text and expands them accordingly. Check the documentation of +@code{strftime}. This feature is deprecated in favor of @code{normal} +expansion with the @code{gmtime} or @code{localtime} expansion +functions. If @option{expansion} is set to @code{none}, the text is printed verbatim. @@ -12390,13 +12391,13 @@ It can be used to add padding with zeros from the left. @item gmtime The time at which the filter is running, expressed in UTC. -It can accept an argument: a strftime() format string. +It can accept an argument: a @code{strftime} C function format string. The format string is extended to support the variable @var{%[1-6]N} which prints fractions of the second with optionally specified number of digits. @item localtime The time at which the filter is running, expressed in the local time zone. -It can accept an argument: a strftime() format string. +It can accept an argument: a @code{strftime} C function format string. The format string is extended to support the variable @var{%[1-6]N} which prints fractions of the second with optionally specified number of digits. @@ -12438,8 +12439,8 @@ If the format is set to @code{hms}, a third argument @code{24HH} may be supplied to present the hour part of the formatted timestamp in 24h format (00-23). -If the format is set to @code{localtime} or @code{gmtime}, -a third argument may be supplied: a strftime() format string. +If the format is set to @code{localtime} or @code{gmtime}, a third +argument may be supplied: a @code{strftime} C function format string. By default, @var{YYYY-MM-DD HH:MM:SS} format will be used. @end table @@ -12543,7 +12544,8 @@ drawtext="text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)" @end example @item -Print the date of a real-time encoding (see strftime(3)): +Print the date of a real-time encoding (see documentation for the +@code{strftime} C function): @example drawtext='fontfile=FreeSans.ttf:text=%@{localtime\:%a %b %d %Y@}' @end example From patchwork Sun Mar 26 17:34:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Sabatini X-Patchwork-Id: 40838 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7a30:b0:df:834d:2c1a with SMTP id t48csp774988pzh; Sun, 26 Mar 2023 10:34:16 -0700 (PDT) X-Google-Smtp-Source: AKy350ba8oudl13dIL1Wsovd/sMnVuF13SnDOEscti7Rqbzwhs8+2kWmz84lLaUj1veb70M7NicB X-Received: by 2002:a17:906:cb98:b0:931:73d:4cc3 with SMTP id mf24-20020a170906cb9800b00931073d4cc3mr10212469ejb.11.1679852055732; Sun, 26 Mar 2023 10:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679852055; cv=none; d=google.com; s=arc-20160816; b=QKermnssruQ8K7cHtO6YEjuLey2612ghtEHy0T6adF5QCDTrBAhX4sVCAWNwGWDRU3 GHDQ2j/p1/WshdWvbCjuotIsa8kRAhvbb8vJrCQeIas1Oz7aK1U1+8vUweXx71VrM2jP b+9NW7Y5//bI+BUPhbcvDvYfA2jJ9PQ9BnoKacqGc/SdJR7vejz+xSjhRvoOGPZUzSmH cK6v5BUD1UTMckSYV0MQTgWuFrqD1a6z5Dve/k/+K7Cn+CYkaw4CalWoAA2LmVlXX2Nh 1iUfVJO7A1ehvV5vV67arRaos0K6jBp+3xDz7H5Gxp3oqFNeao1ioB1XzK9UlpJ+fOcw cN2g== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=WhvPUEIo3atW7tF0Uauq59o9BpW+HZji48oMvrgw+pg=; b=nQgg0pj5qEFvnoGic2pKON0MoJUt3RJx24KVFG8TfasInHmx/EIsvOaRX9fb4+1Y+x 9Z+Rpaw3ezXOKYBWjka9y2WwzJ7UQSvjotvIQByL+Upjzv7fd2Mt5yc9TGZvHw1zVXG3 nona2ocMj/veSpezWudIelUhrXZ7jUynLPfGFS913/uVstjvWGx4c2IwXypxf3GhDAn3 am0rNqrP7CpJd1JxOV53stTlKXzxfxtDpm9pxUFp0LdsplFMCp5FGLFUEFZUVSG4dgzt CmxGqATCMbSM9bkcyOwqBZR97lOuenRPdzZLXwMSzEVtShNQRc4JXJALrHN6KaNaWL84 aryQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=AtaIGPad; 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 lc22-20020a170906f91600b00924c79a4314si24852294ejb.668.2023.03.26.10.34.15; Sun, 26 Mar 2023 10:34:15 -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=AtaIGPad; 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 3DFB568C407; Sun, 26 Mar 2023 20:34:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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-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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ijGaMzdht645 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: From patchwork Sun Mar 26 17:34:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Sabatini X-Patchwork-Id: 40839 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7a30:b0:df:834d:2c1a with SMTP id t48csp775086pzh; Sun, 26 Mar 2023 10:34:25 -0700 (PDT) X-Google-Smtp-Source: AKy350arQJr/AbDm9jvhyWEZ6N4g2zy6wXRrT0Rjxr5ki/ONqK2jy0fNkMEGwRd7xATJLvbO0Iwh X-Received: by 2002:a17:906:9241:b0:932:cec7:6801 with SMTP id c1-20020a170906924100b00932cec76801mr9576726ejx.54.1679852065177; Sun, 26 Mar 2023 10:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679852065; cv=none; d=google.com; s=arc-20160816; b=nhv7YwdTo1zuX4TAiGldicE+96Rc/TF4WTTiO1HkABKEISSN+YSyl5Xqg6NwxEgamy HY8DG3Cjlv3SYPr5vhwMCoB0Sy/kykYYJEqya9vJzvDgvsqZ/uQl69/BrqYJCq3V5O6w JRAbckekLBwmkCniery9Dd+ruwBr2Sjyng74t644S1Jns/OgZzd13uCRjA9p8Zo/Q5mm 38sIZuI+R8IZwAzhbbNh8rzMSH1JAqvFbClHjlIzCQgPYFCO6ubiCtLeOgeGqSaweLm+ fRVKzETaZ9rVTN00bF3BiWCD5fHlUmetcrSX9jSexpm903Nxt2+IZUj+YpClBzoNIKkX CzCQ== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=zYDARStFpe1K3ZRYqknhQWkvPmNkh1t7cYvL7uz5RmQ=; b=t5IfaHsrAuf0wQrEifk0qY+rPD4ARMij73SFapE7UjMZk7uKP5rdvISEMfovFTDLNp E3lsFXFc+joIXuXK8KWhUs+W5O7N5ABN3GUavrd+ry/RbQrZZAiZZV9tN5UeQGOpKpvt m+Dmj8BnhnxjYJQ/34z2vG9lXCr+eV/t5CsI+Vqk6AX4Zi+25xS7UqihvtPLdjIaRXPh Hao1Y59349+6LiXkRCG5vTR4/iQE7SxqwXMX4ER97gPgDQHGTueCt9w0ZG3U0T+dNESF h7hvyJwNOUb4JooxknXNKDSBuNfQSzOaTWYxtZxVrP65U2YD9nVDxeJ3elvExj89IHc5 j7vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b="EO/EDUQz"; 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 gn7-20020a1709070d0700b008c254523c37si30130730ejc.539.2023.03.26.10.34.24; Sun, 26 Mar 2023 10:34:25 -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="EO/EDUQz"; 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 6BC8268C05B; Sun, 26 Mar 2023 20:34:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 08E0F68C05B for ; Sun, 26 Mar 2023 20:34:05 +0300 (EEST) Received: by mail-ed1-f54.google.com with SMTP id h8so26766336ede.8 for ; Sun, 26 Mar 2023 10:34:05 -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=qABimQdyvUWR2mXCHo1TLtmUE/FrppKuyiTTh4lGKIU=; b=EO/EDUQzqydtnIsbN7w+8vFoB0v0gXArqD71nLBHupBjyKpC9d7UvAwOAtRqYLHRBR HQUXz8irbcuhZfRv1fFctse2aKGXKXX//nVPagmVkro1gCa8c9qEJktQEty+WsXRf9Sf wChc7VmBvO2uWMDxeYp9AN7IeKkoPIF9jg1Nx2ouKMhs/qKTTSPxL5W5egQuXAUzvSFH pXyLqSjY7YrkAPHAIx3UiRvH2eUd8KzAOufXKC0oyeQYruhXC86QQIE3tgpfnEzsSxD1 t7CjMr0wq4gwF6ookSZBU0N3sFEIH+cjhHiDNFCfELcw7+pAnZhi4XlEQ10/Ip2IzIev Sorg== 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=qABimQdyvUWR2mXCHo1TLtmUE/FrppKuyiTTh4lGKIU=; b=3oUt5ZEeKQjK5KC6deUjfoqFA00LOGkNnpd0vy1uHwQHLmvR3FOH7XTEumailkEsJE A+qCWBEfjhDrJn2GbhNXsiRyA+xcR2qT0i2sW6rpcOLrqXUDPay527kzKmsUvgw5i/BU reX3VX53j/av2WCA68u9BEUWQObnCbnZX6WfxVClKiIk1ZjCF6gSo0lRCG790IR9FvkV JDIBewUqVBC8h5VHFpxDCogFI3/wC3DbzERzmObqXGzPft5kbMmh28g0U49kigYTFg5u Ri8t8un+PfSgQrLHdoEu+EqWhP0tw77QvFZ6kQRSSsw8pkxVwM/CAwnAzRBDuZS+ytsw MrLw== X-Gm-Message-State: AAQBX9fJRMd+T3Z6ENpoU9Ib65XhTOTpapOOKoV17CFqPEi+GtDZzZZL hxh5/sBaDrUelC5ADkOAYfAMfQ6hovI= X-Received: by 2002:a05:6402:14d6:b0:502:4184:a067 with SMTP id f22-20020a05640214d600b005024184a067mr2249052edx.15.1679852043517; 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 q18-20020a50c352000000b00501d39f1d2dsm9234061edb.41.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 4A09BBFB75; 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:01 +0200 Message-Id: <20230326173401.56228-3-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 3/3] doc/filters: mentions that whitespaces are ignored in the filtergraph specification 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: m+KIVYTVXy9Y Also provide example showing how to use this feature to improve filtergraph readability. Address issue: http://trac.ffmpeg.org/ticket/8115 --- doc/filters.texi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index 1c9d523340..889de8b11a 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -214,6 +214,23 @@ In a complete filterchain all the unlabelled filter input and output pads must be connected. A filtergraph is considered valid if all the filter input and output pads of all the filterchains are connected. +Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens +in the filtergraph specification are ignored. This means that the filtergraph +can be expressed using empty lines and spaces to improve redability. + +For example, the filtergraph: +@example +testsrc,split[L1],hflip[L2];[L1][L2] hstack +@end example + +can be represented as: +@example +testsrc, +split [L1], hflip [L2]; + +[L1][L2] hstack +@end example + Libavfilter will automatically insert @ref{scale} filters where format conversion is required. It is possible to specify swscale flags for those automatically inserted scalers by prepending