aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-05-31 16:58:50 +0200
committerAnton Khirnov <anton@khirnov.net>2023-06-03 11:27:11 +0200
commit828d3b4432dbd9f47526e13544e820c9212efc2f (patch)
tree5cf28b3187d9948748d5fd792696a828f812c423
parent6b8d53f72801dd17eb5804aa3ba1134884475309 (diff)
downloadffmpeg-828d3b4432dbd9f47526e13544e820c9212efc2f.tar.gz
doc/examples/transcode: set packet timebase for decoding
It is recommended for callers to set it, though not required.
-rw-r--r--doc/examples/transcode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/examples/transcode.c b/doc/examples/transcode.c
index 805a028ed7..84dd9fc8bc 100644
--- a/doc/examples/transcode.c
+++ b/doc/examples/transcode.c
@@ -97,6 +97,11 @@ static int open_input_file(const char *filename)
"for stream #%u\n", i);
return ret;
}
+
+ /* Inform the decoder about the timebase for the packet timestamps.
+ * This is highly recommended, but not mandatory. */
+ codec_ctx->pkt_timebase = stream->time_base;
+
/* Reencode video & audio and remux subtitles etc. */
if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO
|| codec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {