Hello.
I found one better method to fix this issue. Firstly, i think the problem
caused by incorrectly setting enc_ctx->time_base, so i refer to the
implementation in avcodec_open2()
361 #if FF_API_AVCTX_TIMEBASE
362if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
363
From: Jack Lau
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` calcul
To be clear, i want to give an example, i use a 10s duration, 30fps video.
The ifmt_ctx->streams[stream_index]->time_base is same as
ofmt_ctx->streams[stream_index]->time_base after initializing.
The stream->dec_ctx->time_base is default 0,60 but
stream->enc_ctx->time_base is set to av_inv_q(dec_ct
>
> AVCodecContext.time_base is not used for decoding.
Thank you for your reply. I understand that time_base is not used during
decoding, but the transcoding code calls av_packet_rescale_ts twice, once
before decoding and once after encoding, as shown below:
540 if (filter_ctx[stream_
>
> AVCodecContext.time_base is not used for decoding.
Thank you for your reply. I understand that time_base is not used during
decoding, but the transcoding code calls av_packet_rescale_ts twice, once
before decoding and once after encoding, as shown below:
540 if (filter_ctx[stream_
The `dec_ctx->time_base` was incorrectly default set to 0/60, while
`enc_ctx->time_base` was derived from `dec_ctx->framerate`. This
mismatch could cause incorrect video duration in the output.
This patch aligns `enc_ctx->time_base` with `dec_ctx->time_base` to
prevent rescaling issues and ens
From bfd5500a5448ad468d32994816e8a55c0d4a2428 Mon Sep 17 00:00:00 2001
From: Jack Lau
Date: Tue, 4 Feb 2025 21:39:20 +0800
Subject: [PATCH] examples/transcoding: Fix time_base handling
The `dec_ctx->time_base` was incorrectly default set to 0/60, while
`enc_ctx->time_base` was derived from `dec
fix-time-base-handling.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubs
The `dec_ctx->time_base` was incorrectly default set to 0/60, while
`enc_ctx->time_base` was derived from `dec_ctx->framerate`. This mismatch could
cause incorrect video duration in the output.
This patch aligns `enc_ctx->time_base` with `dec_ctx->time_base` to prevent
rescaling issues and ensu
The `dec_ctx->time_base` was incorrectly default set to 0/60, while
`enc_ctx->time_base` was derived from `dec_ctx->framerate`. This mismatch
could cause incorrect video duration in the output.
This patch aligns `enc_ctx->time_base` with `dec_ctx->time_base` to prevent
rescaling issues and ensure
10 matches
Mail list logo