* [FFmpeg-devel] [PATCH] fftools/ffmpeg: log correct filter timebase with debug_ts
@ 2022-07-05 15:25 Timo Rothenpieler
0 siblings, 0 replies; only message in thread
From: Timo Rothenpieler @ 2022-07-05 15:25 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Timo Rothenpieler
---
fftools/ffmpeg.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index e7384f052a..6ec28f3019 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -766,6 +766,7 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost,
{
double float_pts = AV_NOPTS_VALUE; // this is identical to frame.pts but with higher precision
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 +775,9 @@ 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);
tb.den <<= extra_bits;
float_pts =
@@ -798,8 +799,8 @@ early_exit:
frame ? av_ts2str(frame->pts) : "NULL",
frame ? av_ts2timestr(frame->pts, &enc->time_base) : "NULL",
float_pts,
- enc ? enc->time_base.num : -1,
- enc ? enc->time_base.den : -1);
+ filter_tb.num,
+ filter_tb.den);
}
return float_pts;
--
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".
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-05 15:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05 15:25 [FFmpeg-devel] [PATCH] fftools/ffmpeg: log correct filter timebase with debug_ts Timo Rothenpieler
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git