From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7F4AD45A15 for ; Sun, 9 Apr 2023 14:13:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D8DD668BDB3; Sun, 9 Apr 2023 17:09:44 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 85DD068BD6C for ; Sun, 9 Apr 2023 17:09:17 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 098FB2405F9 for ; Sun, 9 Apr 2023 16:09:15 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id DZJ5pG_O54dm for ; Sun, 9 Apr 2023 16:09:14 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 464912406CB for ; Sun, 9 Apr 2023 16:09:10 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 37A813A039B for ; Sun, 9 Apr 2023 16:09:10 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 9 Apr 2023 16:08:35 +0200 Message-Id: <20230409140853.28858-11-anton@khirnov.net> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230409140853.28858-1-anton@khirnov.net> References: <20230409140853.28858-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/29] fftools/ffmpeg: move printing verbose muxing stats to ffmpeg_mux 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: This is a more appropriate place for this. --- fftools/ffmpeg.c | 34 ---------------------------------- fftools/ffmpeg_mux.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 48e771cbc5..e1748114b3 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -809,40 +809,6 @@ static void print_final_stats(int64_t total_size) av_log(NULL, AV_LOG_VERBOSE, " Total: %"PRIu64" packets (%"PRIu64" bytes) demuxed\n", total_packets, total_size); } - - for (i = 0; i < nb_output_files; i++) { - OutputFile *of = output_files[i]; - uint64_t total_packets = 0, total_size = 0; - - av_log(NULL, AV_LOG_VERBOSE, "Output file #%d (%s):\n", - i, of->url); - - for (j = 0; j < of->nb_streams; j++) { - OutputStream *ost = of->streams[j]; - enum AVMediaType type = ost->st->codecpar->codec_type; - - total_size += ost->data_size_mux; - total_packets += atomic_load(&ost->packets_written); - - av_log(NULL, AV_LOG_VERBOSE, " Output stream #%d:%d (%s): ", - i, j, av_get_media_type_string(type)); - if (ost->enc_ctx) { - av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" frames encoded", - ost->frames_encoded); - if (type == AVMEDIA_TYPE_AUDIO) - av_log(NULL, AV_LOG_VERBOSE, " (%"PRIu64" samples)", ost->samples_encoded); - av_log(NULL, AV_LOG_VERBOSE, "; "); - } - - av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" packets muxed (%"PRIu64" bytes); ", - atomic_load(&ost->packets_written), ost->data_size_mux); - - av_log(NULL, AV_LOG_VERBOSE, "\n"); - } - - av_log(NULL, AV_LOG_VERBOSE, " Total: %"PRIu64" packets (%"PRIu64" bytes) muxed\n", - total_packets, total_size); - } } static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time) diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 9a91861bd4..5acd3b9b9d 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -637,6 +637,41 @@ static int check_written(OutputFile *of) return ret; } +static void mux_final_stats(Muxer *mux) +{ + OutputFile *of = &mux->of; + uint64_t total_packets = 0, total_size = 0; + + av_log(NULL, AV_LOG_VERBOSE, "Output file #%d (%s):\n", + of->index, of->url); + + for (int j = 0; j < of->nb_streams; j++) { + OutputStream *ost = of->streams[j]; + enum AVMediaType type = ost->st->codecpar->codec_type; + + total_size += ost->data_size_mux; + total_packets += atomic_load(&ost->packets_written); + + av_log(NULL, AV_LOG_VERBOSE, " Output stream #%d:%d (%s): ", + of->index, j, av_get_media_type_string(type)); + if (ost->enc_ctx) { + av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" frames encoded", + ost->frames_encoded); + if (type == AVMEDIA_TYPE_AUDIO) + av_log(NULL, AV_LOG_VERBOSE, " (%"PRIu64" samples)", ost->samples_encoded); + av_log(NULL, AV_LOG_VERBOSE, "; "); + } + + av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" packets muxed (%"PRIu64" bytes); ", + atomic_load(&ost->packets_written), ost->data_size_mux); + + av_log(NULL, AV_LOG_VERBOSE, "\n"); + } + + av_log(NULL, AV_LOG_VERBOSE, " Total: %"PRIu64" packets (%"PRIu64" bytes) muxed\n", + total_packets, total_size); +} + int of_write_trailer(OutputFile *of) { Muxer *mux = mux_from_of(of); @@ -668,6 +703,8 @@ int of_write_trailer(OutputFile *of) } } + mux_final_stats(mux); + // check whether anything was actually written ret = check_written(of); mux_result = err_merge(mux_result, ret); -- 2.39.1 _______________________________________________ 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".