diff mbox series

[FFmpeg-devel] doc/examples/transcoding: fix wrong time base

Message ID 20210626200935.28582-1-liudingming@bytedance.com
State New
Headers show
Series [FFmpeg-devel] doc/examples/transcoding: fix wrong time base | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

liudingming June 26, 2021, 8:09 p.m. UTC
Signed-off-by: liudingming <liudingming@bytedance.com>
---
 doc/examples/transcoding.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c
index 3a97426e2c..ea6ffefc70 100644
--- a/doc/examples/transcoding.c
+++ b/doc/examples/transcoding.c
@@ -171,7 +171,7 @@  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(av_mul_q(dec_ctx->framerate, (AVRational){dec_ctx->ticks_per_frame, 1}));
             } else {
                 enc_ctx->sample_rate = dec_ctx->sample_rate;
                 enc_ctx->channel_layout = dec_ctx->channel_layout;