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