diff --git a/src/media/media_encoder.cpp b/src/media/media_encoder.cpp index 33cdaf57c796f45585a90fc25ed47a8aba93b880..da565bb65585a9de43413b54029efd87891b09e1 100644 --- a/src/media/media_encoder.cpp +++ b/src/media/media_encoder.cpp @@ -103,10 +103,10 @@ MediaEncoder::setOptions(const MediaStream& opts) // resolutions videoOpts_.width -= videoOpts_.width % 2; videoOpts_.height -= videoOpts_.height % 2; - if (not videoOpts_.frameRate) + if (!videoOpts_.frameRate) videoOpts_.frameRate = 30; - if (opts.bitrate) - libav_utils::setDictValue(&options_, "max_rate", std::to_string(opts.bitrate)); + if (!videoOpts_.bitrate) + videoOpts_.bitrate = SystemCodecInfo::DEFAULT_VIDEO_BITRATE;; } else { audioOpts_ = opts; } diff --git a/src/media/media_stream.h b/src/media/media_stream.h index bf4300ad61a43f29cad74225e24b7fedf556b02c..b13f79dcc449d8c2518b6be8872bafc474e7b213 100644 --- a/src/media/media_stream.h +++ b/src/media/media_stream.h @@ -38,7 +38,7 @@ struct MediaStream int64_t firstTimestamp {0}; int width {0}; int height {0}; - int bitrate; + int bitrate {0}; rational<int> frameRate; int sampleRate {0}; int nbChannels {0};