aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_mux.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-09-10 12:27:43 +0200
committerAnton Khirnov <anton@khirnov.net>2024-09-26 18:25:21 +0200
commite3e66b14af9a82930be881752873e1ac2104877b (patch)
treed63275dac5a09fb941faf4e39759b9c6f8df9710 /fftools/ffmpeg_mux.c
parent7f7fe2a10bda086c595bc191145f2390e9781726 (diff)
downloadffmpeg-e3e66b14af9a82930be881752873e1ac2104877b.tar.gz
fftools/ffmpeg_enc: don't write frame rate/SAR to AVStream directly
Have the muxer code read them out of the encoder context in of_stream_init() instead. This is a step towards decoupling encoders from muxers.
Diffstat (limited to 'fftools/ffmpeg_mux.c')
-rw-r--r--fftools/ffmpeg_mux.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index ea0bbeed32..d38f1ec317 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -620,6 +620,9 @@ int of_stream_init(OutputFile *of, OutputStream *ost,
if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0)
ost->st->time_base = av_add_q(enc_ctx->time_base, (AVRational){0, 1});
+ ost->st->avg_frame_rate = enc_ctx->framerate;
+ ost->st->sample_aspect_ratio = enc_ctx->sample_aspect_ratio;
+
ret = avcodec_parameters_from_context(ms->par_in, enc_ctx);
if (ret < 0) {
av_log(ost, AV_LOG_FATAL,