Skip to content

Commit 259c9cb

Browse files
author
xufuji456
committed
fix: keep time_base of encoder_context same with decoder_context
1 parent 588aeec commit 259c9cb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎app/src/main/cpp/media_transcode.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ static int open_output_file(const char *filename)
145145
else
146146
enc_ctx->pix_fmt = dec_ctx->pix_fmt;
147147
/* video time_base can be set to whatever is handy and supported by encoder */
148-
enc_ctx->time_base = av_inv_q(dec_ctx->framerate);
148+
// enc_ctx->time_base = av_inv_q(dec_ctx->framerate);
149+
enc_ctx->time_base = dec_ctx->time_base;
149150
} else {
150151
enc_ctx->sample_rate = dec_ctx->sample_rate;
151152
enc_ctx->channel_layout = dec_ctx->channel_layout;

0 commit comments

Comments
 (0)