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 9F4EE4D88A
	for <ffmpegdev@gitmailbox.com>; Sun, 20 Apr 2025 22:08:58 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 96F31687C17;
	Mon, 21 Apr 2025 01:08:53 +0300 (EEST)
Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com
 [209.85.210.182])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 887CD687C17
 for <ffmpeg-devel@ffmpeg.org>; Mon, 21 Apr 2025 01:08:47 +0300 (EEST)
Received: by mail-pf1-f182.google.com with SMTP id
 d2e1a72fcca58-736ad42dfd6so2826432b3a.3
 for <ffmpeg-devel@ffmpeg.org>; Sun, 20 Apr 2025 15:08:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1745186925; x=1745791725; 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=DMxunydcBLvV22xyIBsIw8gcvW0pUkNyevuuxPqTFYo=;
 b=nQmWkiiyfXqnBG6B4YIEIwcJbDk1Hys8cLSGj+bXHg4KYCdZr4R0pBf+pHWGZPBswA
 qXptA1UIEq7WBDLPjhuxwxbyrOYCEWYwJ9LxhbOhD3X2r2SX0l/pychzaCgqwXVilKGY
 TEqiVSrYEZXDWkensgIat+s417FH3dFY8GWD60gSOegzt9xaX2Q5VxeL1yKOBApiwnyr
 wtKACqUfORU4Y2NbKOBtq6tdVVJryAwrF5V1mkI+Zu6k4VWG+w1DM3Js9e2Um57e3Zy0
 gD2jsLYiXW2dAqJ8fP1+mQ2uEnDXqPCQydoXX23Df3tUReDbD5rnD8kR7W/aheuezOAg
 llPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1745186925; x=1745791725;
 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=DMxunydcBLvV22xyIBsIw8gcvW0pUkNyevuuxPqTFYo=;
 b=Ex69b23uyo97P1Y6MrPdXN251mmLVbDa4WwhiYRv8A8SDq5eB+yprpOzYkmFfurWXi
 s3Q9ofl8OUPBlZ9Z79zC8lNVuZVqNx77108urbkjjuSUNKBhnu1b44E3cPsu5X+6rysL
 N0HEzXqLenbg16RlaBPRu/Y3Eq2wUXkZfARJjF/H8smqARLIFceXWpj9rNV2CjiZVXXh
 a3xk0J5nC+YvEsPZikexnOLq/Q7Y3bi/Xwwd2rhvneizVKX9yhdvw98CsxOyk2SG+BSt
 CghuvZ/33JiFmd4LmFVgNcYc5Vme0mQUlv96xfCwlO4CZuyhrt1cOm+/XC9r2R7kBy2/
 6rRQ==
X-Gm-Message-State: AOJu0YzeYiJJrDitnLDrz53v0+Zq9jo1lAe3EG9HYrHhAwWVyOUHdnsv
 AuBoxIjLFCrSYaofJXGhcDLczAiTsajRGHMHouY0xMto6U1+puP4VzrVDQ==
X-Gm-Gg: ASbGncsIDNR5dTiAwZPj2cTs4hbwuVFXh5XHLUPNJfo18XZyiwaEK4Fl4oRBZ7HZlGZ
 HNMJxB1h2KsKO1cGaA9GyoTy/Qupk5JSiGTEHgS9MdnuGwOt2Dlfhrrymkzrk4ZnTWIDfc05XVx
 b63SZJTHcWOlvze6Er1pokefYxcVzJIZJGxYILdJU1OpA0MfhZbrhOn7prg1lgS3mSjGZqRBQBw
 SNDQ3Q+gnGzudEHQp1/HHr18qHiDdLpzHWGKLk/L30k1BMuqdDNH1pRIbRLRaikIyZ9+DiMxsEQ
 6SAGg62Hr/bb19mS9IYooYa5el2iSfjpf8vAq8qptIMsDRWwMjg1qaCi9QQ=
X-Google-Smtp-Source: AGHT+IGI1CAVCwRt2Jo+28O+5/zF+Doz6/BZKXcyT1xAvvZnNRA68rxa18U/ylMa74Zc+i/UGp2Jdg==
X-Received: by 2002:a05:6a21:9101:b0:1f5:6b36:f574 with SMTP id
 adf61e73a8af0-203cbd5b63amr14132952637.38.1745186925566; 
 Sun, 20 Apr 2025 15:08:45 -0700 (PDT)
Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-b0db13a3bdcsm4544594a12.19.2025.04.20.15.08.45
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 20 Apr 2025 15:08:45 -0700 (PDT)
From: softworkz <ffmpegagent@gmail.com>
X-Google-Original-From: softworkz <softworkz@hotmail.com>
Message-Id: <pull.69.v2.ffstaging.FFmpeg.1745186919807.ffmpegagent@gmail.com>
In-Reply-To: <pull.69.ffstaging.FFmpeg.1745101853603.ffmpegagent@gmail.com>
References: <pull.69.ffstaging.FFmpeg.1745101853603.ffmpegagent@gmail.com>
Date: Sun, 20 Apr 2025 22:08:39 +0000
Fcc: Sent
MIME-Version: 1.0
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH v2] fftools/ffmpeg: Log exit code on exit
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: softworkz <softworkz@hotmail.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/pull.69.v2.ffstaging.FFmpeg.1745186919807.ffmpegagent@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: softworkz <softworkz@hotmail.com>

When viewing logs, there are situations where it is not entirely
clear whether ffmpeg CLI has exited gracefully. The two primary cases
are

- A crash/segfault has occured
  Windows for example doesn't output any message to the calling shell
- The process has been terminated (e.g. killed externally)

Printing a message on exit provides a reliable indication that the
process has exited normally.
Printing the exit code is useful as it usually remains invisible
and unnoticed by users running FFmpeg from a shell.

Signed-off-by: softworkz <softworkz@hotmail.com>
---
    fftools/ffmpeg: Log 'EXIT' on exit
    
    When viewing logs, there are situations where it is not entirely clear
    whether ffmpeg CLI has exited gracefully. The two primary cases are
    
     * A crash/segfault has occured Windows for example doesn't output any
       message to the calling shell
     * The process has been terminated (e.g. killed externally)
    
    Printing "EXIT" on exit provides a reliable indication that the process
    has exited normally.
    
    Signed-off-by: softworkz softworkz@hotmail.com
    
    
    Versions
    ========
    
    
    V2
    ==
    
     * Include exit code in exit message as suggested by Marton Balint

Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-69%2Fsoftworkz%2Fsubmit_exit_message-v2
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-69/softworkz/submit_exit_message-v2
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/69

Range-diff vs v1:

 1:  a9ea4afc19 ! 1:  2d488c126f fftools/ffmpeg: Log 'EXIT' on exit
     @@ Metadata
      Author: softworkz <softworkz@hotmail.com>
      
       ## Commit message ##
     -    fftools/ffmpeg: Log 'EXIT' on exit
     +    fftools/ffmpeg: Log exit code on exit
      
          When viewing logs, there are situations where it is not entirely
          clear whether ffmpeg CLI has exited gracefully. The two primary cases
     @@ Commit message
            Windows for example doesn't output any message to the calling shell
          - The process has been terminated (e.g. killed externally)
      
     -    Printing "EXIT" on exit provides a reliable indication that the
     +    Printing a message on exit provides a reliable indication that the
          process has exited normally.
     +    Printing the exit code is useful as it usually remains invisible
     +    and unnoticed by users running FFmpeg from a shell.
      
          Signed-off-by: softworkz <softworkz@hotmail.com>
      
     @@ fftools/ffmpeg.c: finish:
       
           sch_free(&sch);
       
     -+    av_log(NULL, AV_LOG_INFO, "\n");
     -+    av_log(NULL, AV_LOG_INFO, "EXIT\n");
     ++    av_log(NULL, AV_LOG_VERBOSE, "\n");
     ++    av_log(NULL, AV_LOG_VERBOSE, "Exiting with exit code %d\n", ret);
      +
           return ret;
       }


 fftools/ffmpeg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..397bc1f229 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1012,5 +1012,8 @@ finish:
 
     sch_free(&sch);
 
+    av_log(NULL, AV_LOG_VERBOSE, "\n");
+    av_log(NULL, AV_LOG_VERBOSE, "Exiting with exit code %d\n", ret);
+
     return ret;
 }

base-commit: 853e66a0726b0a9d6d6269a22f6f9b5be7763738
-- 
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".