diff --git a/README.md b/README.md index d28796bc2..16d7a261e 100644 --- a/README.md +++ b/README.md @@ -326,7 +326,7 @@ Sample test results are shown below. They were generated with [`run-video-bench. The `h264.net` columns are the managed [H.264 port](src/Codecs/SIPSorcery.H264/), which is for educational use only and is never packaged, so the published tool leaves it out; the script builds the CLI from source with it to measure it. It picks its threads (a slice each) by frame size: 1 up to 640x480, 2 above that, 3 above 1280x960, and 4, OpenH264's most, from 1080p on a machine with more than 8 processors. That's the table libwebrtc has for OpenH264 but leaves off, running it on one thread. Its frame skipping is off so that it encodes every frame as the other encoders do, and its decoder gets the same FFmpeg (libx264 Constrained Baseline) clip as the FFmpeg H264 decoder. -The `vp9.net` columns are the managed [VP9 port](src/Codecs/SIPSorcery.VP9/) of libvpx, which isn't packaged yet either, so the script builds the CLI from source with it as well. It follows libwebrtc's set-up of libvpx VP9, CBR at cpu-used 7 with row multi-threading, on threads it picks by frame size: 2 at 480p, 4 at 720p, 8 at 1080p and 16 from 1440p (no more than the processors), where libwebrtc stops at 4 for native libvpx. Its decoder gets the same FFmpeg (libvpx-vp9) clip as the FFmpeg VP9 decoder. FFmpeg's VP9 encoder runs on every core at cpu-used 8 with row multi-threading, so it does less work per frame than `vp9.net` does. +The `vp9.net` columns are the managed [VP9 port](src/Codecs/SIPSorcery.VP9/) of libvpx, which is in the published tool. It follows libwebrtc's set-up of libvpx VP9, CBR at cpu-used 7 with row multi-threading, on threads it picks by frame size: 2 at 480p, 4 at 720p, 8 at 1080p and 16 from 1440p (no more than the processors), where libwebrtc stops at 4 for native libvpx. Its decoder gets the same FFmpeg (libvpx-vp9) clip as the FFmpeg VP9 decoder. FFmpeg's VP9 encoder runs on every core at cpu-used 8 with row multi-threading, so it does less work per frame than `vp9.net` does. ### Machine diff --git a/src/SIPSorcery.Cli/Commands/webrtc/WebRtcVideoBenchCommand.cs b/src/SIPSorcery.Cli/Commands/webrtc/WebRtcVideoBenchCommand.cs index def3d285a..001d97ab9 100644 --- a/src/SIPSorcery.Cli/Commands/webrtc/WebRtcVideoBenchCommand.cs +++ b/src/SIPSorcery.Cli/Commands/webrtc/WebRtcVideoBenchCommand.cs @@ -18,8 +18,7 @@ // Stage 3b (--encoder av1.net): the managed SIPSorcery.AV1 (av1rt) AV1 encoder. // Stage 3c (--encoder h264.net): the managed SIPSorcery.H264 (OpenH264 port) encoder, // in source builds with -p:IncludeH264Net=true only. -// Stage 3d (--encoder vp9.net): the managed SIPSorcery.VP9 (libvpx port) encoder, -// in source builds with -p:IncludeVp9Net=true only. +// Stage 3d (--encoder vp9.net): the managed SIPSorcery.VP9 (libvpx port) encoder. // Stage 4 (--decoder ffmpeg|vp8.net|h264.net|vp9.net): a decoder on its own. A short clip is // encoded first (untimed), then only the // decoding of it, looped, is timed. @@ -47,6 +46,7 @@ // (SIPSorcery.VP9 isn't packaged yet). h264.net's --threads 0 // leaves the threads to the codec, by frame size. // 29 Nov 2026 Claude vp9.net's --threads help for its row based multi-threading. +// 04 Dec 2026 Claude vp9.net is always built in, now that SIPSorcery.VP9 is packaged. // // License: // BSD 3-Clause "New" or "Revised" License, see included LICENSE.md file. @@ -107,16 +107,10 @@ public sealed class WebRtcVideoBenchCommand : CommandBase #endif /// - /// The --encoder and --decoder name of the managed SIPSorcery.VP9 codec. It is compiled in only - /// when the tool is built from source with -p:IncludeVp9Net=true (see the project file). + /// The --encoder and --decoder name of the managed SIPSorcery.VP9 codec. /// private const string VP9_NET_STAGE = "vp9.net"; -#if !VP9NET - private const string VP9_NET_NOT_BUILT = "vp9.net is only in source builds of the tool made with -p:IncludeVp9Net=true: " + - "SIPSorcery.VP9 isn't packaged yet."; -#endif - /// Seconds of frames (at --fps, at least 30 frames) in the clip the --decoder stage loops. private const int DECODE_CLIP_SECONDS = 2; @@ -204,7 +198,7 @@ public override Command Build() Description = "The pipeline stage to test: none (packetise only), ffmpeg (SIPSorceryMedia.FFmpeg in-process encoder), " + "ffmpeg-piped (external ffmpeg process), vp8.net (managed Vpx.Net codec), av1.net (managed SIPSorcery.AV1 " + "encoder), h264.net (managed SIPSorcery.H264 encoder, in source builds made with -p:IncludeH264Net=true " + - "only) or vp9.net (managed SIPSorcery.VP9 encoder, in source builds made with -p:IncludeVp9Net=true only). " + + "only) or vp9.net (managed SIPSorcery.VP9 encoder). " + "The none stage packetises a frame " + "sized from --bitrate/--fps, so it is independent of resolution (width/height are reported for context only).", DefaultValueFactory = _ => "none" @@ -264,8 +258,8 @@ public override Command Build() { Description = "Benchmark a decoder instead of an encoder: ffmpeg (SIPSorceryMedia.FFmpeg, any codec), vp8.net " + "(managed Vpx.Net, VP8 only), h264.net (managed SIPSorcery.H264, H264 only, in source builds made with " + - "-p:IncludeH264Net=true only) or vp9.net (managed SIPSorcery.VP9, VP9 only, in source builds made with " + - "-p:IncludeVp9Net=true only). A short --codec clip is encoded first, untimed, by --encoder (left as " + + "-p:IncludeH264Net=true only) or vp9.net (managed SIPSorcery.VP9, VP9 only). A short --codec clip is " + + "encoded first, untimed, by --encoder (left as " + "none, ffmpeg, the native encoders a remote WebRTC peer most likely uses; or vp8.net, av1.net, h264.net or " + "vp9.net), then " + "only the decoding of it, looped, is timed. Decoded pictures are converted to BGR as a receiver's are." @@ -439,7 +433,6 @@ private static int Run(string? preset, int width, int height, int fps, int durat #endif case VP9_NET_STAGE: -#if VP9NET if (codecEnum != VideoCodecsEnum.VP9) { return WriteResult(asJson, Empty(encoder, codec, width, height, fps, @@ -447,9 +440,6 @@ private static int Run(string? preset, int width, int height, int fps, int durat ExitCodes.InvalidArgument); } return RunVp9Encode(width, height, fps, durationSeconds, bitrate, codec, tuning, asJson, logger, ct); -#else - return WriteResult(asJson, Empty(encoder, codec, width, height, fps, VP9_NET_NOT_BUILT), ExitCodes.InvalidArgument); -#endif case "ffmpeg": return RunNativeFfmpegEncode(width, height, fps, durationSeconds, bitrate, codec, codecEnum, ffmpegPath, tuning, asJson, logger, ct); @@ -638,7 +628,6 @@ private static int RunH264Encode(int width, int height, int fps, int durationSec }; #endif -#if VP9NET /// /// Stage 3d: the managed SIPSorcery.VP9 encoder (a port of libvpx's realtime VP9 encoder), set up as /// libwebrtc sets up libvpx (CBR, speed 7, cyclic refresh, row based multi-threading), on --threads @@ -667,7 +656,6 @@ private static int RunVp9Encode(int width, int height, int fps, int durationSeco // fast the loop runs. --threads sets the encoder's and the decoder's threads (0: the codec's choice). private static SIPSorcery.VP9.VP9Codec CreateVp9NetCodec(int fps, int bitrate, int threads) => new(targetBitrateKbps: Math.Max(1, bitrate / 1000), threads: Math.Clamp(threads, 0, 64)) { FrameRate = fps }; -#endif /// /// Stage 4 (--decoder): a decoder on its own. A clip of of @@ -688,12 +676,6 @@ private static int RunDecode(string decoderName, string encoderName, int width, { return WriteResult(asJson, Empty(stage, codec, width, height, fps, H264_NET_NOT_BUILT), ExitCodes.InvalidArgument); } -#endif -#if !VP9NET - if (decoderName == VP9_NET_STAGE || encoderName.Trim().Equals(VP9_NET_STAGE, StringComparison.OrdinalIgnoreCase)) - { - return WriteResult(asJson, Empty(stage, codec, width, height, fps, VP9_NET_NOT_BUILT), ExitCodes.InvalidArgument); - } #endif if (decoderName != "ffmpeg" && decoderName != "vp8.net" && decoderName != H264_NET_STAGE && decoderName != VP9_NET_STAGE) { @@ -788,9 +770,7 @@ private static int RunDecode(string decoderName, string encoderName, int width, #if H264NET H264_NET_STAGE => new SIPSorcery.H264.H264Codec(), #endif -#if VP9NET VP9_NET_STAGE => CreateVp9NetCodec(fps, bitrate, tuning.Threads), -#endif _ => new FFmpegVideoEncoder(), }; @@ -905,12 +885,10 @@ private static List EncodeClip(string clipEncoder, int encWidth, int enc encode = raw => encoder.EncodeVideo(encWidth, encHeight, raw, VideoPixelFormatsEnum.I420, codecEnum); break; #endif -#if VP9NET case VP9_NET_STAGE: encoder = CreateVp9NetCodec(fps, bitrate, tuning.Threads); encode = raw => encoder.EncodeVideo(encWidth, encHeight, raw, VideoPixelFormatsEnum.I420, codecEnum); break; -#endif default: { Dictionary? extraOptions = null; diff --git a/src/SIPSorcery.Cli/benchmarks/README.md b/src/SIPSorcery.Cli/benchmarks/README.md index 40d2939b7..e8ca999ba 100644 --- a/src/SIPSorcery.Cli/benchmarks/README.md +++ b/src/SIPSorcery.Cli/benchmarks/README.md @@ -53,8 +53,7 @@ its [README](../../Codecs/SIPSorcery.H264/README.md)) and is never packaged, so out. The script builds the CLI from source with `-p:IncludeH264Net=true` to measure it, and `-SkipH264Net` leaves it out. -`vp9.net`, the managed libvpx VP9 port, isn't packaged yet either. The script builds the CLI with -`-p:IncludeVp9Net=true` to measure it, and `-SkipVp9Net` leaves it out. +`vp9.net`, the managed libvpx VP9 port, is in the published tool. `-SkipVp9Net` leaves its columns out. The WebRTC pipeline table (`loopback`, ffmpeg encoder and decoder, H264 by default): @@ -97,7 +96,7 @@ Useful parameters (all optional): | `-FfmpegPath` | (PATH) | FFmpeg shared-library directory. | | `-OutputDir` | `./results` | Where `results.json` and `RESULTS.md` are written. | | `-SkipH264Net` | off | Leaves out the `h264.net` columns and builds the CLI without SIPSorcery.H264, as it is published. | -| `-SkipVp9Net` | off | Leaves out the `vp9.net` columns and builds the CLI without SIPSorcery.VP9. | +| `-SkipVp9Net` | off | Leaves out the `vp9.net` columns. | | `-Codecs` | (all) | Only these codecs' encode and decode columns (`vp8`, `vp9`, `h264`, `h265`, `av1`), to re-measure some of them. | The CLI is published to a temp directory once at the start, then invoked per run, so build/JIT noise @@ -109,14 +108,16 @@ To measure one cell by hand, run the same command the script does, for example: dotnet run -c Release --project src/SIPSorcery.Cli -- webrtc video-bench --preset 1080p --decoder ffmpeg --codec av1 --json ``` -The `h264.net` and `vp9.net` cells need their source build flags: +The `h264.net` cells need the source build flag: ```powershell dotnet run -c Release --property:IncludeH264Net=true --project src/SIPSorcery.Cli -- webrtc video-bench --preset 1080p --encoder h264.net --json ``` +The `vp9.net` cells need no flag: + ```powershell -dotnet run -c Release --property:IncludeVp9Net=true --project src/SIPSorcery.Cli -- webrtc video-bench --preset 1080p --encoder vp9.net --codec vp9 --json +dotnet run -c Release --project src/SIPSorcery.Cli -- webrtc video-bench --preset 1080p --encoder vp9.net --codec vp9 --json ``` ## Output diff --git a/src/SIPSorcery.Cli/benchmarks/run-video-bench.ps1 b/src/SIPSorcery.Cli/benchmarks/run-video-bench.ps1 index f4a0c983c..64cbc0be2 100644 --- a/src/SIPSorcery.Cli/benchmarks/run-video-bench.ps1 +++ b/src/SIPSorcery.Cli/benchmarks/run-video-bench.ps1 @@ -29,7 +29,7 @@ h264.net, the managed OpenH264 port, is for educational use only and is never packaged, so the published tool leaves it out. This script publishes the CLI from source with -p:IncludeH264Net=true to measure it; -SkipH264Net leaves it out. vp9.net, the managed libvpx VP9 - port, isn't packaged yet either: -p:IncludeVp9Net=true puts it in, and -SkipVp9Net leaves it out. + port, is in the published tool; -SkipVp9Net leaves its columns out. -Codecs limits the encode and decode tables to some codecs (vp8, vp9, h264, h265, av1), to re-measure those columns only. @@ -88,7 +88,7 @@ param( [string] $OutputDir = (Join-Path $PSScriptRoot 'results'), # Leaves out the h264.net columns, and builds the CLI as it is published, without SIPSorcery.H264. [switch] $SkipH264Net, - # Leaves out the vp9.net columns, and builds the CLI without SIPSorcery.VP9. + # Leaves out the vp9.net columns. [switch] $SkipVp9Net, # Only these codecs' encoders and decoders (vp8, vp9, h264, h265, av1); all of them when empty. [string[]] $Codecs = @() @@ -147,7 +147,6 @@ $binDir = Join-Path ([System.IO.Path]::GetTempPath()) 'sipsorcery-vbench-bin' Write-Host "Publishing CLI (Release) ..." -ForegroundColor Cyan $publishArgs = @($proj, '-c', 'Release', '-o', $binDir, '--nologo') if (-not $SkipH264Net) { $publishArgs += '-p:IncludeH264Net=true' } -if (-not $SkipVp9Net) { $publishArgs += '-p:IncludeVp9Net=true' } dotnet publish @publishArgs | Out-Null if ($LASTEXITCODE -ne 0) { throw "Publishing the CLI failed." } $exe = Join-Path $binDir 'SIPSorcery.Cli.exe' diff --git a/src/SIPSorcery/CompatibilitySuppressions.xml b/src/SIPSorcery/CompatibilitySuppressions.xml index ff88a1bb3..3da4dbc48 100644 --- a/src/SIPSorcery/CompatibilitySuppressions.xml +++ b/src/SIPSorcery/CompatibilitySuppressions.xml @@ -17,363 +17,12 @@ --> - - - - - CP0001 - T:SIPSorcery.Net.RTSPConstants - true - - - CP0001 - T:SIPSorcery.Net.RTSPEntityHeaders - true - - - CP0001 - T:SIPSorcery.Net.RTSPHeader - true - - - CP0001 - T:SIPSorcery.Net.RTSPHeaderError - true - - - CP0001 - T:SIPSorcery.Net.RTSPHeaderParserError - true - - - CP0001 - T:SIPSorcery.Net.RTSPHeaders - true - - - CP0001 - T:SIPSorcery.Net.RTSPMessage - true - - - CP0001 - T:SIPSorcery.Net.RTSPMessageTypesEnum - true - - - CP0001 - T:SIPSorcery.Net.RTSPMethods - true - - - CP0001 - T:SIPSorcery.Net.RTSPMethodsEnum - true - - - CP0001 - T:SIPSorcery.Net.RTSPRequest - true - - - CP0001 - T:SIPSorcery.Net.RTSPRequestParserError - true - - - CP0001 - T:SIPSorcery.Net.RTSPResponse - true - - - CP0001 - T:SIPSorcery.Net.RTSPResponseParserError - true - - - CP0001 - T:SIPSorcery.Net.RTSPResponseStatusCodes - true - - - CP0001 - T:SIPSorcery.Net.RTSPResponseStatusCodesEnum - true - - - CP0001 - T:SIPSorcery.Net.RTSPTransportHeader - true - - - CP0001 - T:SIPSorcery.Net.RTSPURL - true - - - - - - - - - - - - - CP0001 - T:BouncyCastleExtensions - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLS.DtlsAlertEventArgs - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLS.DtlsCertificateUtils - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLS.DtlsClient - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLS.DtlsHandshakeCompletedEventArgs - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLS.DtlsServer - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLS.IDtlsPeer - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLSSRTP.DtlsSessionStartedEventArgs - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLSSRTP.DtlsSrtpClient - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLSSRTP.DtlsSrtpKeys - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLSSRTP.DtlsSrtpProtocol - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLSSRTP.DtlsSrtpServer - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.DTLSSRTP.IDtlsSrtpPeer - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.Authentication.HMAC - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.Encryption.AEAD - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.Encryption.CTR - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.Encryption.F8 - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.ISrtpContext - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.Readers.RtcpReader - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.Readers.RtpReader - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpAuth - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpCiphers - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpContext - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpContextExtensions - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpContextType - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpCryptoSuites - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpKeys - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpProtectionProfileConfiguration - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpProtocol - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SrtpSessionContext - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.SsrcSrtpContext - true - - - CP0001 - T:SIPSorcery.Net.SharpSRTP.SRTP.ThreadSafeSrtpSessionContext - true - - - - - CP0002 - M:SIPSorcery.Net.DtlsSrtpTransport.#ctor(SIPSorcery.Net.SharpSRTP.DTLSSRTP.IDtlsSrtpPeer) - true - - - CP0002 - M:SIPSorcery.Net.DtlsSrtpTransport.get_Context - true - - - CP0002 - M:SIPSorcery.Net.DtlsSrtpTransport.get_Keys - true - - - CP0002 - M:SIPSorcery.Net.SrtpHandler.get_Context - true - - - - - CP0009 - T:SIPSorcery.Net.DtlsSrtpTransport - true - - - - - CP0002 - F:SIPSorcery.Media.VideoTestPatternSource.SupportedFormats - true - + diff --git a/src/SIPSorcery/SIPSorcery.csproj b/src/SIPSorcery/SIPSorcery.csproj index 39cbb9b30..3f40378ac 100644 --- a/src/SIPSorcery/SIPSorcery.csproj +++ b/src/SIPSorcery/SIPSorcery.csproj @@ -115,9 +115,11 @@ + breaks are listed in CompatibilitySuppressions.xml with a reason. Restore downloads the + baseline package from nuget.org, so it must be a version that's already published: move + it up once a release is out, not in the commit that bumps . --> true - 10.0.21 + 10.0.20-pre