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 51AC140CA6 for ; Fri, 8 Jul 2022 22:55:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B2A2D68B988; Sat, 9 Jul 2022 01:54:32 +0300 (EEST) Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8DCAE68B871 for ; Sat, 9 Jul 2022 01:54:22 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id EE9FB317320; Sat, 9 Jul 2022 00:54:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1657320861; bh=Bmzam+iYvlG6j5Tx8e/IsLnfBQ4CIaYRrPyPDHletVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iEw/nOrrR38ygWNDHkkMONn/2r5KnuNfy3YDOSkeL8bJlKtXKFHVN5xN9aSDVIEve cuEPTpzt5snwdHgegsmZk3kLuprSa60B1cmRgzmF3U/R0SOBxCBBkKIWcevDynel2S CKMhvomhaVFEIvsG3td0Mo1ke46w/KRk5jh/zjRvxjdRh6+0n2DBZR1jFRCPx5aEFs j2xZgXQqrla4rSbVicnySrtAC/pEfmX+kmO4QVIazSBdBFtGMx8QTszCVSKv0ZuT+O EIU2I65W5jENKkkq86H3ojS5FpxcOTntEm8dWeF8uhvfi8LnxycOdzQLJVxL8H75AG cefFB8NXAS5bA== From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Sat, 9 Jul 2022 00:53:57 +0200 Message-Id: <20220708225404.23748-2-timo@rothenpieler.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220708225404.23748-1-timo@rothenpieler.org> References: <20220708225404.23748-1-timo@rothenpieler.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/8] fftools/ffmpeg: make debug_ts print raw filter output 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 Cc: Timo Rothenpieler 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: --- fftools/ffmpeg.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index e7384f052a..a69364c0d4 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -765,7 +765,9 @@ 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 || !enc || !ost->filter || !ost->filter->graph->graph) goto early_exit; @@ -774,9 +776,10 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost, AVFilterContext *filter = ost->filter->filter; int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time; - AVRational filter_tb = av_buffersink_get_time_base(filter); 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 = @@ -794,9 +797,14 @@ 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", - frame ? av_ts2timestr(frame->pts, &enc->time_base) : "NULL", + (enc && frame) ? av_ts2timestr(frame->pts, &enc->time_base) : "NULL", float_pts, enc ? enc->time_base.num : -1, enc ? enc->time_base.den : -1); -- 2.34.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".