From 259c9cb5314080e93bb320ca50958ba533d07dc7 Mon Sep 17 00:00:00 2001 From: xufuji456 Date: Sat, 16 Jul 2022 12:32:06 +0800 Subject: [PATCH] fix: keep time_base of encoder_context same with decoder_context --- app/src/main/cpp/media_transcode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/media_transcode.cpp b/app/src/main/cpp/media_transcode.cpp index aca00fe..29598d6 100644 --- a/app/src/main/cpp/media_transcode.cpp +++ b/app/src/main/cpp/media_transcode.cpp @@ -145,7 +145,8 @@ static int open_output_file(const char *filename) else enc_ctx->pix_fmt = dec_ctx->pix_fmt; /* video time_base can be set to whatever is handy and supported by encoder */ - enc_ctx->time_base = av_inv_q(dec_ctx->framerate); +// enc_ctx->time_base = av_inv_q(dec_ctx->framerate); + enc_ctx->time_base = dec_ctx->time_base; } else { enc_ctx->sample_rate = dec_ctx->sample_rate; enc_ctx->channel_layout = dec_ctx->channel_layout;