summaryrefslogtreecommitdiff
path: root/src/mpeg2_transcode.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-25 21:34:47 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-25 21:34:47 +0100
commit83583a7fc85cee34207ad12432327dda59377787 (patch)
tree44a8c5852c2ddc9e9b66be91821a11ea703728c6 /src/mpeg2_transcode.cc
parentbc29132b361026a32bfe29418d1aa3b783d2e7a6 (diff)
Fill min/max bit rate in MPEG2 header so that e.g. mediainfo reports the expected numbers.
Diffstat (limited to 'src/mpeg2_transcode.cc')
-rw-r--r--src/mpeg2_transcode.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mpeg2_transcode.cc b/src/mpeg2_transcode.cc
index 0ac2c1af..b8a66647 100644
--- a/src/mpeg2_transcode.cc
+++ b/src/mpeg2_transcode.cc
@@ -162,6 +162,8 @@ MPEG2Compressor::MPEG2Compressor(dcp::Size size, int video_frame_rate, int64_t b
_context->time_base = AVRational{1, video_frame_rate};
_context->pix_fmt = AV_PIX_FMT_YUV420P;
_context->bit_rate = bit_rate;
+ _context->rc_max_rate = bit_rate;
+ _context->rc_min_rate = bit_rate;
int const r = avcodec_open2(_context, _codec, nullptr);
if (r < 0) {