From patchwork Sat Nov 26 08:19:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 39452 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp6013128pzb; Sat, 26 Nov 2022 00:19:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf70SQ3YZlAVLwLqQhGZJshITAFHllIyxDnpB+1DOQlqGhTfd5gHER7PGjGFGNck5xL7cFK9 X-Received: by 2002:aa7:c3c9:0:b0:469:1342:2ad with SMTP id l9-20020aa7c3c9000000b00469134202admr28151144edr.180.1669450795757; Sat, 26 Nov 2022 00:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669450795; cv=none; d=google.com; s=arc-20160816; b=OI+iV9bxcTDNqHHP5tgtOPOAS9pzXzKxK4laEMLnDmf0saJd5YgNy+sjYvv7RyV0LZ 13aOioyLqrX8o93YlmvIrIP7KpvD1o8twX9ggHE5fKTqKITF24CZFojBCMdTltTpVCB+ DQTfIuFQCgVSARY+DWrlaw7Y+zvR86Ksisc/jFQJPbgdJA5EX+C3sydA88ddch0IsGo6 koODBt7QAB2ruZl5WqO0v0W9vKDx8lMEHFYE1h9by1bUhUiXM/pTSBUVGwDCu20kB21r L8twugKovk1ebOgoEsWKpTdGqhf2Bi/Qnde+FzdBGeqfdsdccNP9xZd0fkWVwiDCTTz3 a51w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=BA9GB0EnVx9mAdHQW5ZQ5aSKmyaIxbasUByfJWOwPrU=; b=mS18VWPt8CEEfKXYuDe5bSubEHJpxEHP6yIff0euapM4rx2gQsTJ8LqhcFV+k9UWzq dxs4Lz/kFh1N4+1/6ZyeAGmyxUwuxP1zM1BHG+QHGfVUCPSfF4FG++0tSGgWLlA7zdix Z2SSHr6BnDnYj1/QMsZxKcDARRd7Mm2QaZrDR7L9NeJRZjaIRlvrMLk76IZ43HjOIXNR Ch+7L5M1evC0yf6XV3i+YKg1mpy14WE7uvSTOeVyQwwmRRhl6NAuOC46tfILO87YEIP4 uTQHYvVAUoeYIUMxHujyeDS2OkTCXKB+T4/UwjV5JilifaE+zEidBwCIVGdLk3dW6BVQ lcbw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v25-20020a50d099000000b004637e16cfa4si4798483edd.599.2022.11.26.00.19.55; Sat, 26 Nov 2022 00:19:55 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 703F668B5DA; Sat, 26 Nov 2022 10:19:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 058FE68B48E for ; Sat, 26 Nov 2022 10:19:25 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id BB77C240499 for ; Sat, 26 Nov 2022 09:19:24 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id QLZ-GHE_6Xsb for ; Sat, 26 Nov 2022 09:19:24 +0100 (CET) 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 95F5B2404F7 for ; Sat, 26 Nov 2022 09:19:23 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 850373A0709 for ; Sat, 26 Nov 2022 09:19:23 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 26 Nov 2022 09:19:04 +0100 Message-Id: <20221126081911.31275-6-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221126081911.31275-1-anton@khirnov.net> References: <20221126081911.31275-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/13] fftools/ffmpeg: move logging filtered frame timestamps 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: er9fblSq+9+K Do it right after the frame is received from the filtergraph. This is a more logical place for this and will simplify future commits. --- fftools/ffmpeg.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 44582e3568..263670d3f5 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -676,7 +676,6 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost, AVFrame *frame) { double float_pts = AV_NOPTS_VALUE; // this is identical to frame.pts but with higher precision - int64_t orig_pts = AV_NOPTS_VALUE; AVCodecContext *enc = ost->enc_ctx; AVRational filter_tb = (AVRational){ -1, -1 }; if (!frame || frame->pts == AV_NOPTS_VALUE || @@ -690,7 +689,6 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost, AVRational tb = enc->time_base; int extra_bits = av_clip(29 - av_log2(tb.den), 0, 16); filter_tb = av_buffersink_get_time_base(filter); - orig_pts = frame->pts; tb.den <<= extra_bits; float_pts = @@ -708,11 +706,6 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost, early_exit: if (debug_ts) { - av_log(NULL, AV_LOG_INFO, "filter_raw -> pts:%s pts_time:%s time_base:%d/%d\n", - frame ? av_ts2str(orig_pts) : "NULL", - frame ? av_ts2timestr(orig_pts, &filter_tb) : "NULL", - filter_tb.num, filter_tb.den); - av_log(NULL, AV_LOG_INFO, "filter -> pts:%s pts_time:%s exact:%f time_base:%d/%d\n", frame ? av_ts2str(frame->pts) : "NULL", (enc && frame) ? av_ts2timestr(frame->pts, &enc->time_base) : "NULL", @@ -1302,6 +1295,12 @@ static int reap_filters(int flush) AVRational tb = av_buffersink_get_time_base(filter); ost->last_filter_pts = av_rescale_q(filtered_frame->pts, tb, AV_TIME_BASE_Q); + + if (debug_ts) + av_log(NULL, AV_LOG_INFO, "filter_raw -> pts:%s pts_time:%s time_base:%d/%d\n", + av_ts2str(filtered_frame->pts), + av_ts2timestr(filtered_frame->pts, &tb), + tb.num, tb.den); } switch (av_buffersink_get_type(filter)) {