diff --git a/src/media/media_encoder.cpp b/src/media/media_encoder.cpp index 9d2505a8c0013b29e152820089cecb741be289fe..7698aaf7783abe77dab6c0171acb2983cf9e099e 100644 --- a/src/media/media_encoder.cpp +++ b/src/media/media_encoder.cpp @@ -179,8 +179,12 @@ MediaEncoder::openOutput(const char *filename, // http://www.webmproject.org/docs/encoder-parameters/ av_opt_set(encoderCtx_->priv_data, "quality", "realtime", 0); av_opt_set_int(encoderCtx_->priv_data, "error-resilient", 1, 0); - av_opt_set_int(encoderCtx_->priv_data, "cpu-used", 3, 0); + av_opt_set_int(encoderCtx_->priv_data, "cpu-used", 7, 0); // value obtained from testing av_opt_set_int(encoderCtx_->priv_data, "lag-in-frames", 0, 0); + // allow encoder to drop frames if buffers are full and + // to undershoot target bitrate to lessen strain on resources + av_opt_set_int(encoderCtx_->priv_data, "drop-frame", 25, 0); + av_opt_set_int(encoderCtx_->priv_data, "undershoot-pct", 95, 0); // don't set encoderCtx_->gop_size: let libvpx decide when to insert a keyframe encoderCtx_->slices = 2; // VP8E_SET_TOKEN_PARTITIONS encoderCtx_->qmin = 4;