From patchwork Fri Jul 8 22:53:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 36712 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1916:b0:8b:804:ebe9 with SMTP id bv22csp323278pzb; Fri, 8 Jul 2022 15:55:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tBUx9B7THuGO+5URIUnj/CelMCjCJtdCnqx8z4SHOZNQbdXp2FT0wvtGXDYQ8AZCFvT1DL X-Received: by 2002:a05:6402:5245:b0:43a:a024:82cc with SMTP id t5-20020a056402524500b0043aa02482ccmr7867170edd.56.1657320902517; Fri, 08 Jul 2022 15:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657320902; cv=none; d=google.com; s=arc-20160816; b=FrEYnvMOvlHS4//Rc5OkRBWziDUhEWdoPuk4BIIKVyQUAMHIukzc7hsVP1rhixcInt XESG4L1ORor4OTdSbxYTfvMvIxh7OcQbmYyBeqGbx3Zor3NtHfo5RxdH1VenzRxTl49H 5Ws3RyHqRjdlnmEEnauQGvzUvKWHFJN9q2nt99UHCYrzTh3cY70kfMqCBq9DyVsAV0Er 3AnhAx8a5boD//l/xtKo/tMMDvY5Ys+ID/6oEWLIVFwygcX9CCJOOxiQuhGgiFgGLfY2 enxatIB/3cS2J8Q+cdFUOvh50aqCHTz2ctpJbc/KEH/g3axdEy6OBU9foT7kKniPSH3t ECvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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:dkim-signature:delivered-to; bh=us/YI6p0XFNsKZEQJuNr80xDRn/zsOKrZnFy8J/g6dU=; b=le047Kkz/ZTWWTJdKCAEDA2lCq4mrnYltMfC0qCWbify7qe502hUgrI6aKS4SNDmJK aaSjVY6jn8oJnJal3s7/e+1bL4eYaOf7dVthXL/nMgaj5ksA9nkIQXes6TSs6jZqd+NH twWqrlKZJmCngQtah6+x3TMSkLG7wqJnW1Q5QLohbzZPF8z3Nxycsb4mBooTWKnbXCfi VeipXOljJCu5lAsbLS9ZymGBkNvfF3dVoKVe3l2JcUAyxLDHuE8tuVJquKaEagMuQ4ki fgVGksSdsPDz4ZnihEVJV3/zVZyzLEk8Mj/IYjuLH8M97JM7Nyu0I/GKXK9nt2e1eGNC rHRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b="iEw/nOrr"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=rothenpieler.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a5-20020a1709066d4500b00718d1cddac7si25249107ejt.2.2022.07.08.15.55.02; Fri, 08 Jul 2022 15:55:02 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b="iEw/nOrr"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=rothenpieler.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E345368B889; Sat, 9 Jul 2022 01:54:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: pom2hMlUXpCo --- 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);