aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2021-11-15 23:48:47 +0100
committerMarvin W <git@larma.de>2021-11-15 23:49:48 +0100
commitec6541518684d7c61c6475498c4ddf25d8f96b55 (patch)
tree532f0ca55057c39d06be7fd31a3359b3c8a74556
parent0b828a0ae55b3c0eaf1206f0c54cfcee4f60e6af (diff)
downloaddino-ec6541518684d7c61c6475498c4ddf25d8f96b55.tar.gz
dino-ec6541518684d7c61c6475498c4ddf25d8f96b55.zip
Optimize encoder for low cpu usage
-rw-r--r--plugins/rtp/src/codec_util.vala10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/rtp/src/codec_util.vala b/plugins/rtp/src/codec_util.vala
index ec922f97..f9f7f7ec 100644
--- a/plugins/rtp/src/codec_util.vala
+++ b/plugins/rtp/src/codec_util.vala
@@ -97,7 +97,7 @@ public class Dino.Plugins.Rtp.CodecUtil {
case "h264":
return new string[] {/*"msdkh264enc", */"vaapih264enc", "x264enc"};
case "vp9":
- return new string[] {/*"msdkvp9enc", */"vaapivp9enc" /*, "vp9enc" */};
+ return new string[] {/*"msdkvp9enc", */"vaapivp9enc", "vp9enc"};
case "vp8":
return new string[] {/*"msdkvp8enc", */"vaapivp8enc", "vp8enc"};
}
@@ -141,15 +141,15 @@ public class Dino.Plugins.Rtp.CodecUtil {
// H264
if (encode == "msdkh264enc") return @" rate-control=vbr";
if (encode == "vaapih264enc") return @" rate-control=vbr tune=low-power";
- if (encode == "x264enc") return @" byte-stream=1 speed-preset=ultrafast tune=zerolatency";
+ if (encode == "x264enc") return @" byte-stream=1 speed-preset=ultrafast tune=zerolatency bframes=0 cabac=false dct8x8=false";
// VP8
if (encode == "vaapivp8enc" || encode == "msdkvp8enc") return " rate-control=vbr target-percentage=90";
- if (encode == "vp8enc") return " deadline=1 error-resilient=3 lag-in-frames=0 resize-allowed=true threads=8 dropframe-threshold=30 end-usage=vbr";
+ if (encode == "vp8enc") return " deadline=1 error-resilient=3 lag-in-frames=0 resize-allowed=true threads=8 dropframe-threshold=30 end-usage=vbr cpu-used=4";
// VP9
if (encode == "msdkvp9enc" || encode == "vaapivp9enc") return " rate-control=vbr target-percentage=90";
- if (encode == "vp9enc") return " deadline=1 error-resilient=3 lag-in-frames=0 resize-allowed=true threads=8 dropframe-threshold=30 end-usage=vbr";
+ if (encode == "vp9enc") return " deadline=1 error-resilient=3 lag-in-frames=0 resize-allowed=true threads=8 dropframe-threshold=30 end-usage=vbr cpu-used=4";
// OPUS
if (encode == "opusenc") {
@@ -219,7 +219,7 @@ public class Dino.Plugins.Rtp.CodecUtil {
public static string? get_decode_args(string media, string codec, string decode, JingleRtp.PayloadType? payload_type) {
if (decode == "opusdec" && payload_type != null && payload_type.parameters.has("useinbandfec", "1")) return " use-inband-fec=true";
if (decode == "vaapivp9dec" || decode == "vaapivp8dec" || decode == "vaapih264dec") return " max-errors=100";
- if (decode == "vp8dec") return " threads=8";
+ if (decode == "vp8dec" || decode == "vp9dec") return " threads=8";
return null;
}