From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 685FE4F1ED for ; Sat, 17 May 2025 18:19:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 56D7F68D7DE; Sat, 17 May 2025 21:19:08 +0300 (EEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id AD32468D480 for ; Sat, 17 May 2025 21:19:01 +0300 (EEST) Received: by mail-wm1-f67.google.com with SMTP id 5b1f17b1804b1-441d1ed82faso22819145e9.0 for ; Sat, 17 May 2025 11:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20230601.gappssmtp.com; s=20230601; t=1747505941; x=1748110741; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=l/PYOUb1Jy0EqaE6xqKLtp9vQq/b2Q1IbF+C3SWf0X0=; b=E+021H7FvC1DCkUh9fGA4KYf4ha7rRXWATrA1oY927di3BHyN1BLdoXZ0QlK+4eUJz rDGN3QDQLrRtx8w73As7bL3E/wnNJq49YVr5MaxABwxolDqDekOx2FSzQ2XWDRdONBFK W2GUmfpamIONNBhhme78QsFkgCqU7cm8nQObv764DS0pUzLhzN9XRb6zrglh3mXoX1n/ QTIf3b9Eil/XubpNWRrj55xL97XtAsTDGU/8747EOPkLOUZNAU+WI7NThN2M1bPAzxeD 5PmI/O3D/07wj3e6MFdXBcI9KRPp1Y66uaA+23eKWs4YoOPdyZpqaqVG6iOtDIx8qUWs 5qbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747505941; x=1748110741; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l/PYOUb1Jy0EqaE6xqKLtp9vQq/b2Q1IbF+C3SWf0X0=; b=AVnditT8/qsQAES3OJYo07UtiRpMh7zlSMrfwc9o62fxw/pggH8WStDY27tGsIpnN/ eycSXtpd36fZzdtw6bjcrCySumlPjLlmMpsNF2pusbRQX2hh/iti6cR1xDdYCmuwbmhL nAQEZIbF90NHiC0gWqciG+b7vLyHIfV7aCf+bcpsOoRNE108Ze/Elk/DVd7RTg/l/uyV oDupnbVnULCmpysir9RJvQXysQHnr45/LmHgrpctRYslnxPe5aF0FflrMhBNotm5Jp6T bZszRL3fsEZl2T/PlaHJlT0JiJ+eWw09Ck5VaFncCbYqBbYAmpY8y9IQHxwkENVwIHQj u3zg== X-Gm-Message-State: AOJu0Yw1EmsuxU74VllxLC/veXpv9lhBprPcO+/cLRR1d5Y8peziZBfe Aqc1Sfrn2J9Z49DM5Y/vBE7480WKuC4fbrwKhcYX0pDaXUO+kvoM8aw6PrHMNmE9Bu5quqiBzIZ AlteQF5B47ixG X-Gm-Gg: ASbGncuX3gHm+QXjiOEDxIOuI8ZrSAglSwViUfr2ovROQdPBcpJ1PJ+E6GYVU+srA+m 3LGTUq97cTVzX5APUYpdbxFKAfvoZlUoeSp5ovnM/gPXujdih6qLzonO/0d/k0rjoNq9XSdh4y0 6xrSBO7kfDPwS0Uzz3yQmb9kvWXWhZ2OkllHEEpTJZYcB+JhtiO2h8aiCGUAjyaSzuLknzVDcCp 65MEWT4l6zozejaEZP2j8BYeRKnak8KcA9cen0y1Rk/m5DwOCkoSt1og86bJhI5n09/WqeyGinv MA5Ta89SrS0kv88Xm4aDQ2ARyQYybMyYMU708ZkkNybEVuAPbgB404VqibEpCG7TB4DvzxgI29A cRavN9IBrNXQ45cM1gK1hAgdUsoRermnDCFY= X-Google-Smtp-Source: AGHT+IHIjs9kqmICoxGOJVPy4WAj8MEjeGOdNxntwy3HVke377p1aW6X853kiH0eHIUOVZugQoYdLQ== X-Received: by 2002:a05:600c:3b21:b0:441:b3eb:5720 with SMTP id 5b1f17b1804b1-442ff0396b5mr67210775e9.29.1747505940545; Sat, 17 May 2025 11:19:00 -0700 (PDT) Received: from [192.168.0.15] (cpc92320-cmbg19-2-0-cust719.5-4.cable.virginm.net. [82.13.66.208]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-442f3951b57sm155728455e9.21.2025.05.17.11.19.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 May 2025 11:19:00 -0700 (PDT) Message-ID: Date: Sat, 17 May 2025 19:18:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20250517111422.3393457-1-sw@jkqxz.net> From: Mark Thompson In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/3] ffmpeg: Don't print graphs if there are no graphs to print 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 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: On 17/05/2025 18:52, softworkz . wrote: > > >> -----Original Message----- >> From: ffmpeg-devel On Behalf Of Mark >> Thompson >> Sent: Samstag, 17. Mai 2025 13:14 >> To: ffmpeg-devel@ffmpeg.org >> Subject: [FFmpeg-devel] [PATCH 1/3] ffmpeg: Don't print graphs if there are no >> graphs to print >> >> Avoids writing an empty json blob in setup error cases. >> --- >> fftools/ffmpeg.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c >> index 964770df23..ad28cff78d 100644 >> --- a/fftools/ffmpeg.c >> +++ b/fftools/ffmpeg.c >> @@ -309,7 +309,8 @@ const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL >> }; >> >> static void ffmpeg_cleanup(int ret) >> { >> - if (print_graphs || print_graphs_file) >> + if ((print_graphs || print_graphs_file) && >> + (nb_filtergraphs > 0 || nb_output_files > 0)) >> print_filtergraphs(filtergraphs, nb_filtergraphs, input_files, >> nb_input_files, output_files, nb_output_files); > > The feature is not just about filter graphs, that's why it's been renamed > as "Execution Graph Printing". It also works when no filter graphs are > in play at all. > Here's an example: > > https://softworkz.github.io/ffmpeg_output_apis/1_nofilters_3_in_1_out.html > > > As for the nb_output_files check, I'm not sure - is it 0 or 1 in case of > -f null output? 1, including when you stream copy to null and there aren't any real graphs. At least one output is mandatory for a valid command line, so it should always appear in non-error cases as far as I am aware. The aim is to avoid to the nonsense json blob when an early error happens - example below. It does still get printed on later errors (such as a muxer error), because the graph is created then and some operations will have happened at that point. Thanks, - Mark $ ./ffmpeg_g -print_graphs -i nonexistent -f null - ... [in#0 @ 0x513000000200] Error opening input: No such file or directory Error opening input file nonexistent. Error opening input files: No such file or directory { "graphs": [ ], "inputfiles": [ { "index": "0", "inputstreams": [ ] } ], "decoders": [ ], "encoders": [ ], "outputfiles": [ ], "streamlinks": [ ] } _______________________________________________ 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".