From patchwork Mon Mar 14 14:26:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 34727 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:3486:0:0:0:0 with SMTP id ek6csp2209960nkb; Mon, 14 Mar 2022 07:26:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZgjCduXOyPfyik6kZZGq9hs8U0OygSwtfL/9HuvHvBQKYhyOzrYis+VlAIroUi1S2Hdz0 X-Received: by 2002:a05:6402:2790:b0:416:55d0:8810 with SMTP id b16-20020a056402279000b0041655d08810mr20463250ede.89.1647268001632; Mon, 14 Mar 2022 07:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647268001; cv=none; d=google.com; s=arc-20160816; b=N2LPFWGwWubajwTHh5qw4BxR97EhKEcpqnpb7t0BT69MBy75vetLEn4XzjH3udsSrs 3WfGRz90fWGWz2qQWgv56pFhl+nlSqjkY8XMzzkLA+UNVAueovWpRx1No9G7ip4P6XjZ nyQtLSFhMTX7LKIwYppujpVW4AqoJDeywrrEqOPr7CDe9/DsVJspT+Vpkdtk03yUk+C/ IKQeIBCq9Tad3oydZ1HAkQkIt0U0leUmsLXHUOW/nxx1m+D9ax8NM2XxVz3oYkYdafpN ttWLCMzKTFVfhy3Iy0GW15YcoqEMt3Ju7K9YAR6poeOiUMSwtlqK6Gh0qUhxHKjQXYao QsvQ== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=CwVXlywc8VPhEBWMCX693pYrg7/XrZ8EJVNKDmLd/lg=; b=lay9LrcHaz5mW/klynzTzzB/ttkvzdBWIdcxWHRN+9vCmLfoYqzGwL7tjEGv0VP/MW 42o4bXR0ql4CgTRE093vutD85evyDMj2H33wxpUDNNBHGHZnKyv8Rp/XfNA1xHvdiIJ+ dnPNYPYMg5YDdTByJ1WwmXWt5K32QAy1BxAfhjQBjwcvgsSpXsZx3/XPb9PaVoxpkGam KRXrLFKvqykZEP4zv80J/tsogFzueXV85ziVyGYBXnfHXAct9T0nLDawWHCwJVtyjjjh JFYq0ZR46Iecef437j+iLN/nE/oBZ49FVuch4hRIhw3oqcaXCb2KPUCD1v6L8Yn1UjyU Eu+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=RDZIsYSx; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x15-20020a05640226cf00b00416a309e850si9942939edd.224.2022.03.14.07.26.41; Mon, 14 Mar 2022 07:26:41 -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=@gmail.com header.s=20210112 header.b=RDZIsYSx; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9DA6A68A8EE; Mon, 14 Mar 2022 16:26:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2085568A8EE for ; Mon, 14 Mar 2022 16:26:32 +0200 (EET) Received: by mail-lf1-f41.google.com with SMTP id s29so6082136lfb.13 for ; Mon, 14 Mar 2022 07:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=2FBuXDo7yJRruJEmg8qEOsCH4Ws5APIlbfoJ7D3CY5I=; b=RDZIsYSxTvbbfiGJ7nbW6xDNf3SqonnqUsE4u8KSCo6AGfUkaoIw/KqWIYXFNaI4BD XTTiB9b6HQKtgbSH8eInQenF8cflRQkSE5XSeaxTElvE/Wn80HVwqU/EbtJ/16XmhWB0 BuSY1N+W7EiHlmexhMiz+ZHyoj0l5pY8c6DlgCsqffJMt0/8jxh3KX95wu/Z96Q3VVhl qvTLQuKAktSpoAenePieYZcYDf0rppRGdfZ3fVW2fbEST7hrLK1QLQ1E4yy+6vGmYJxQ PtU9W2wJhhA0xWwfxghS2Uukg/Yda3d5HCYfXWUyD9eUk1X+EEc2UYyAKQTP4Z6osX02 YWIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=2FBuXDo7yJRruJEmg8qEOsCH4Ws5APIlbfoJ7D3CY5I=; b=CgdGpmLHtZMcBD//Iw4OhiV5puPF3j8mOJ5D/WA/y3WvkThkBdEaWHEFRZuMWxJf8p P+05oIweSb/J1aP379wRQRIy55kYD1IXYa6N4Azr8LNNOla1pHEtmCBTTfYW/3ZSGB0c Q1wVB1QOhfbH3gNlP25x2YMOWAWeSYvG1hFgH6kxbVEogQTmbZrrDgT1hnXxQVTQIvYv lTK0B1wZn8xjag978XxSoBebXb+k6eg7UV9FbeQZ5ee5g5ggOzVRMwq3MxA1XNGZv3Ds 3pb9fSg3LRsV9j2DLor62vTZO+wMXbss9zLDpUwne1HrTHjqbMiYIGSS+HWl+MjAgiHs B7RQ== X-Gm-Message-State: AOAM533kzGUjEnrQjnM/bArgao3ISmHNnhDiFRKT4oQQZjo7IoE1YxBl +yS5sTtO6MtpT4u0uIrTZROr3X0ZdJo= X-Received: by 2002:a05:6512:2104:b0:448:68c5:e78f with SMTP id q4-20020a056512210400b0044868c5e78fmr12105080lfr.47.1647267991383; Mon, 14 Mar 2022 07:26:31 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id c4-20020a056512104400b004484c6ed4b8sm3303932lfb.23.2022.03.14.07.26.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 07:26:30 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Mar 2022 16:26:25 +0200 Message-Id: <20220314142625.8050-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] ffmpeg: add packet duration to AVPacket logging 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: KuybTbFUO5nU From: Jaakko Perttilä Especially useful when debugging subtitle output, but also shows if values are set or not for demux and encoding. Co-authored-by: Jan Ekström Signed-off-by: Jan Ekström --- fftools/ffmpeg.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 9a3fdc636d..98e175068e 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -845,10 +845,11 @@ static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u if (debug_ts) { av_log(NULL, AV_LOG_INFO, "muxer <- type:%s " - "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s size:%d\n", + "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s size:%d\n", av_get_media_type_string(ost->enc_ctx->codec_type), av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->st->time_base), av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->st->time_base), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ost->st->time_base), pkt->size ); } @@ -1036,9 +1037,11 @@ static void do_audio_out(OutputFile *of, OutputStream *ost, if (debug_ts) { av_log(NULL, AV_LOG_INFO, "encoder -> type:audio " - "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n", + "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s " + "duration:%s duration_time:%s\n", av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &enc->time_base), - av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &enc->time_base)); + av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &enc->time_base), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &enc->time_base)); } output_packet(of, pkt, ost, 0); @@ -1360,9 +1363,11 @@ static void do_video_out(OutputFile *of, if (debug_ts) { av_log(NULL, AV_LOG_INFO, "encoder -> type:video " - "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n", + "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s " + "duration:%s duration_time:%s\n", av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &enc->time_base), - av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &enc->time_base)); + av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &enc->time_base), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &enc->time_base)); } if (pkt->pts == AV_NOPTS_VALUE && !(enc->codec->capabilities & AV_CODEC_CAP_DELAY)) @@ -1372,9 +1377,11 @@ static void do_video_out(OutputFile *of, if (debug_ts) { av_log(NULL, AV_LOG_INFO, "encoder -> type:video " - "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n", + "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s " + "duration:%s duration_time:%s\n", av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->mux_timebase), - av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->mux_timebase)); + av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->mux_timebase), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ost->mux_timebase)); } frame_size = pkt->size; @@ -4304,12 +4311,13 @@ static int process_input(int file_index) if (debug_ts) { av_log(NULL, AV_LOG_INFO, "demuxer -> ist_index:%d type:%s " - "next_dts:%s next_dts_time:%s next_pts:%s next_pts_time:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s off:%s off_time:%s\n", + "next_dts:%s next_dts_time:%s next_pts:%s next_pts_time:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n", ifile->ist_index + pkt->stream_index, av_get_media_type_string(ist->dec_ctx->codec_type), av_ts2str(ist->next_dts), av_ts2timestr(ist->next_dts, &AV_TIME_BASE_Q), av_ts2str(ist->next_pts), av_ts2timestr(ist->next_pts, &AV_TIME_BASE_Q), av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ist->st->time_base), av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ist->st->time_base), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ist->st->time_base), av_ts2str(input_files[ist->file_index]->ts_offset), av_ts2timestr(input_files[ist->file_index]->ts_offset, &AV_TIME_BASE_Q)); } @@ -4460,10 +4468,11 @@ static int process_input(int file_index) ifile->last_ts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); if (debug_ts) { - av_log(NULL, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s off:%s off_time:%s\n", + av_log(NULL, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n", ifile->ist_index + pkt->stream_index, av_get_media_type_string(ist->dec_ctx->codec_type), av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ist->st->time_base), av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ist->st->time_base), + av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ist->st->time_base), av_ts2str(input_files[ist->file_index]->ts_offset), av_ts2timestr(input_files[ist->file_index]->ts_offset, &AV_TIME_BASE_Q)); }