From d173f3708edbd2909b0838dca61a7d29fff63914 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Wed, 12 Apr 2023 15:25:34 +0800 Subject: [PATCH] tmp input --- simp_ffmpeg_input.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/simp_ffmpeg_input.c b/simp_ffmpeg_input.c index baa55ee..f28b7fa 100644 --- a/simp_ffmpeg_input.c +++ b/simp_ffmpeg_input.c @@ -255,17 +255,21 @@ static int __ffmpeg_decode(simp_avio_t* io, AVCodecContext* dec_ctx, AVPacket* p if (nb_vframes) { (*nb_vframes)++; + int64_t pts = f->frame->pts; + f->frame->pts = f->frame->pts * av_q2d(s->time_base) / av_q2d(io->frame_rate); - scf_logi("frame->pts: %ld, stream_index: %d, io->frame_rate: %d:%d, s->time_base: %d:%d\n", - frame->pts, pkt->stream_index, + scf_logd("f->frame->pts: %ld, pts: %ld, stream_index: %d, io->frame_rate: %d:%d, s->time_base: %d:%d\n", + f->frame->pts, pts, pkt->stream_index, io->frame_rate.num, io->frame_rate.den, s->time_base.num, s->time_base.den); } else { + int64_t pts = f->frame->pts; + f->frame->pts = f->frame->pts * av_q2d(s->time_base) / av_q2d(io->sample_rate); - scf_logi("frame->pts: %ld, stream_index: %d, io->sample_rate: %d:%d, s->time_base: %d:%d\n", - frame->pts, pkt->stream_index, + scf_logd("f->frame->pts: %ld, pts: %ld, stream_index: %d, io->sample_rate: %d:%d, s->time_base: %d:%d\n", + f->frame->pts, pts, pkt->stream_index, io->sample_rate.num, io->sample_rate.den, s->time_base.num, s->time_base.den); } -- 2.25.1