diff options
author | Marvin W <git@larma.de> | 2021-11-09 22:06:46 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-11-10 11:05:34 +0100 |
commit | 72569ea52faf9895b4a897feffd37fa7fe3e2116 (patch) | |
tree | c5e506ce605a13748d3445cadc7a85ff2db142b2 | |
parent | aae13b9ea6a3ac3e35164704bb7966d646833686 (diff) | |
download | dino-72569ea52faf9895b4a897feffd37fa7fe3e2116.tar.gz dino-72569ea52faf9895b4a897feffd37fa7fe3e2116.zip |
Improve codec support
-rw-r--r-- | plugins/rtp/src/codec_util.vala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/rtp/src/codec_util.vala b/plugins/rtp/src/codec_util.vala index 417dc4be..8299fc51 100644 --- a/plugins/rtp/src/codec_util.vala +++ b/plugins/rtp/src/codec_util.vala @@ -146,7 +146,7 @@ public class Dino.Plugins.Rtp.CodecUtil { // VP8 if (encode == "msdkvp8enc") return " rate-control=vbr"; if (encode == "vaapivp8enc") return " rate-control=vbr"; - if (encode == "vp8enc") return " deadline=1 error-resilient=1"; + if (encode == "vp8enc") return " deadline=1 error-resilient=3 lag-in-frames=0 resize-allowed=true threads=8 dropframe-threshold=30"; // OPUS if (encode == "opusenc") { @@ -159,7 +159,8 @@ public class Dino.Plugins.Rtp.CodecUtil { public static string? get_encode_suffix(string media, string codec, string encode, JingleRtp.PayloadType? payload_type) { // H264 - if (media == "video" && codec == "h264") return " ! video/x-h264,profile=constrained-baseline ! h264parse"; + if (media == "video" && codec == "h264") return " ! capsfilter caps=video/x-h264,profile=constrained-baseline ! h264parse"; + if (media == "video" && codec == "vp8" && encode == "vp8enc") return " ! capsfilter caps=video/x-vp8,profile=(string)1"; return null; } @@ -171,17 +172,18 @@ public class Dino.Plugins.Rtp.CodecUtil { if (encode_name == null) return 0; Gst.Element encode = encode_bin.get_by_name(@"$(encode_bin.name)_encode"); - bitrate = uint.min(2048000, bitrate); - switch (encode_name) { case "msdkh264enc": case "vaapih264enc": case "x264enc": + case "msdkvp9enc": + case "vaapivp9enc": case "msdkvp8enc": case "vaapivp8enc": bitrate = uint.min(2048000, bitrate); encode.set("bitrate", bitrate); return bitrate; + case "vp9enc": case "vp8enc": bitrate = uint.min(2147483, bitrate); encode.set("target-bitrate", bitrate * 1000); @@ -198,6 +200,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"; return null; } |