[FFmpeg-devel] [PATCH v2] examples/transcoding: Fix time_base handling

Jack Lau jacklau1222 at qq.com
Wed Feb 5 09:08:00 EET 2025


The `dec_ctx->time_base` was incorrectly default set by avcodec_open2(), while `enc_ctx->time_base` was derived from `dec_ctx->framerate`. This mismatch could cause incorrect video duration in the output.

This patch corrects the issue by adjusting the `enc_ctx->time_base` calculation to account for `ticks_per_frame`, ensuring that the time base is consistent between the decoder and encoder contexts.

-------------- next part --------------
An embedded message was scrubbed...
From: unknown sender
Subject: no subject
Date: no date
Size: 3093
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250205/5ecfa0c9/attachment.eml>


More information about the ffmpeg-devel mailing list