From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id C5D724D3F0
	for <ffmpegdev@gitmailbox.com>; Fri, 21 Feb 2025 11:27:25 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5878D68C79C;
	Fri, 21 Feb 2025 13:27:23 +0200 (EET)
Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com
 [209.85.214.179])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EADDA68C6E2
 for <ffmpeg-devel@ffmpeg.org>; Fri, 21 Feb 2025 13:27:16 +0200 (EET)
Received: by mail-pl1-f179.google.com with SMTP id
 d9443c01a7336-220d601886fso29509785ad.1; 
 Fri, 21 Feb 2025 03:27:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740137235; x=1740742035; darn=ffmpeg.org;
 h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date
 :references:in-reply-to:message-id:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=G3xKHbW/w1rWaP1FiY6RhVk/HczYLilUuRYCZaCWHug=;
 b=lCO/YLEMbVdsv42j2SwRUKBr7WLX5vNLM6xJQVOhTOn0SN17VdSBy5MQbsFoduMufz
 Jm4tQNolO+aTL+DtyqQLSYa6U5re3gXO9MN693eylMjpyCxlk64a5A5pcMejM7GyJ95U
 +HEewavSAnv6Umo+zHKOB9KxOOwFOtknonhZc5Zk3dPEYtG1ZVDmTfqkEHW/JXdMg9r0
 cKrfNpsPI6bANKjd5PPYeOynBbH1ibY2KYISUQaKWJrJ4GCqDJTmztClzNeYlbklJNnZ
 izR3sa40XwOtZbShGZAoF8ZK96nA9nqGeOKc5528x5ANvHyg8cTMv4M35c5iaSjAxtJJ
 +frg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740137235; x=1740742035;
 h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date
 :references:in-reply-to:message-id:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=G3xKHbW/w1rWaP1FiY6RhVk/HczYLilUuRYCZaCWHug=;
 b=d4LaZPn9oKxiRIRtJyOUlxwdWcwYZB9Qi7xyQLT2jkW2dhuw6eY9VzfF4bjLeeQG5u
 3f6MrAR34ORoffhm6qLGE391SQQopUl/17ndmgPSBdrEIGcEHA78Aug0tcu1ULZcwlkt
 M9TGBMxHCDTJvyGbYMvLM6Z1tLWx6Wt03LMwmdYx71761b/4DhX7wSvqz5cunN4EEoeT
 V7Hy+sGSbaiGZn0IGtElENWi/w7tM0SF8MGtpQQPbsEthCAu2e06y+L8FRGxdzVUKKET
 sWQsqpbzklGvAHGJiTEXy/9KPM9qY9/WyXESKjQL7kU8vciLTEG0iRldEBgWqxuxtnCu
 2CZA==
X-Forwarded-Encrypted: i=1;
 AJvYcCV7SaXbA+aXMKWjY1zBfTaaFZ7XLwCioG9IiOeh2QV/LubDTszZqm/Tl1dTxYq+hPUB6NJX9DhSymn4IgAF/AfpLQ/Ddx8/8Ag=@ffmpeg.org
X-Gm-Message-State: AOJu0YwyZMQinm2+ptlv+wKlFlg7y5bW7049wLeL+EYIgsBaMjRv3XWD
 WwTLnr1CMwIAVe0kvfXZFXuM9ztqfXIXqZ2GVUg7rygouIInB1RuXIhSVw==
X-Gm-Gg: ASbGncuDlYOMBEYLc57sFTiedwrIj5DpXN3WATyI+6JtwWcml5kbWe3KaPLTUMfEhMz
 Wjknuns1H2jD9iXLXaiZOH2g5YkLxrYM0okVfaxzXLe9YemzT2wwPDtoHm1aY+Y2gUCA+TJtLt4
 BOphaZ5hSPbv1YoekxuVIXZ0FjbC5pcXIl+JgogUTRS39fKMQUIEv3Appr+o8GCrKfa8bR53A1o
 QuRAhULVNgaW51JLNjE4X58YAdNBekuU4H9iHylnG13Arg2XPXkazEH2msbRTuafCum594vo+sb
 EMwwpbS1HyUMoXdMnOwZReeT7aIlrFBvkPv+5Kkd749C
X-Google-Smtp-Source: AGHT+IHMapJPqhEBrV5wd0CZsvKqconIQxvUVjNXhA64k3aAycUFJvBRfebHuz/Kt90DF4Pphctoow==
X-Received: by 2002:a17:902:d4cd:b0:215:9470:7e82 with SMTP id
 d9443c01a7336-2219ff30c0amr48880135ad.4.1740137235223; 
 Fri, 21 Feb 2025 03:27:15 -0800 (PST)
Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-220d5349306sm135280665ad.48.2025.02.21.03.27.14
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 21 Feb 2025 03:27:15 -0800 (PST)
From: softworkz <ffmpegagent@gmail.com>
X-Google-Original-From: softworkz <softworkz@hotmail.com>
Message-Id: <1bf975fa0e590e86c9b6624bd671f0b6cfff8353.1740137232.git.ffmpegagent@gmail.com>
In-Reply-To: <pull.52.v2.ffstaging.FFmpeg.1740137232.ffmpegagent@gmail.com>
References: <pull.52.ffstaging.FFmpeg.1739959172.ffmpegagent@gmail.com>
 <pull.52.v2.ffstaging.FFmpeg.1740137232.ffmpegagent@gmail.com>
Date: Fri, 21 Feb 2025 11:27:12 +0000
Fcc: Sent
MIME-Version: 1.0
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH v2 4/4] fftools: Enable filtergraph printing
 and update docs
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Soft Works <softworkz-at-hotmail.com@ffmpeg.org>,
 softworkz <softworkz@hotmail.com>,
 Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/1bf975fa0e590e86c9b6624bd671f0b6cfff8353.1740137232.git.ffmpegagent@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: softworkz <softworkz@hotmail.com>

Enables filtergraph printing and adds the options to the docs

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 doc/ffmpeg.texi         | 10 ++++++++++
 fftools/ffmpeg.c        |  4 ++++
 fftools/ffmpeg_filter.c |  5 +++++
 3 files changed, 19 insertions(+)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index da6549f043..6398b4ed92 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -1388,6 +1388,16 @@ It is on by default, to explicitly disable it you need to specify @code{-nostats
 @item -stats_period @var{time} (@emph{global})
 Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.
 
+@item -print_graphs (@emph{global})
+Prints filtergraph details to stderr in the format set via -print_graphs_format.
+
+@item -print_graphs_file @var{filename} (@emph{global})
+Writes filtergraph details to the specified file in the format set via -print_graphs_format.
+
+@item -print_graphs_format @var{format} (@emph{global})
+Sets the output printing format (available formats are: default, compact, csv, flat, ini, json, xml)
+The default format is json.
+
 @item -progress @var{url} (@emph{global})
 Send program-friendly progress information to @var{url}.
 
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..b4bc76d788 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -81,6 +81,7 @@
 #include "ffmpeg.h"
 #include "ffmpeg_sched.h"
 #include "ffmpeg_utils.h"
+#include "ffmpeg_graphprint.h"
 
 const char program_name[] = "ffmpeg";
 const int program_birth_year = 2000;
@@ -308,6 +309,9 @@ const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
 
 static void ffmpeg_cleanup(int ret)
 {
+    if (print_graphs || print_graphs_file)
+        print_filtergraphs(filtergraphs, nb_filtergraphs, output_files, nb_output_files);
+
     if (do_benchmark) {
         int64_t maxrss = getmaxrss() / 1024;
         av_log(NULL, AV_LOG_INFO, "bench: maxrss=%"PRId64"KiB\n", maxrss);
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 6de4e87ade..7198416ae9 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -22,6 +22,7 @@
 
 #include "ffmpeg.h"
 #include "ffmpeg_filter.h"
+#include "ffmpeg_graphprint.h"
 
 #include "libavfilter/avfilter.h"
 #include "libavfilter/buffersink.h"
@@ -2970,6 +2971,10 @@ read_frames:
     }
 
 finish:
+
+    if (print_graphs || print_graphs_file)
+        print_filtergraph(fg, fgt.graph);
+
     // EOF is normal termination
     if (ret == AVERROR_EOF)
         ret = 0;
-- 
ffmpeg-codebot
_______________________________________________
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".