A browser cannot open an rtsp:// URL. The two usual ways to put an IP camera on a web page are to transcode it to HLS — several seconds of delay, plus a decoder and an encoder per camera — or to run a separate media server next to your application.
This post takes a third route: the .NET application itself becomes a WebRTC server, the camera's H.264 goes to the browser exactly as the camera sent it, and the camera's audio goes with it as Opus.
IP camera --RTSP, H.264 + AAC--> [ RTSPRAWSourceBlock --H.264, not decoded------------------> WHEPServerSinkBlock ] --WebRTC--> browsers [ RTSPRAWSourceBlock --AAC/G.711--> DecodeBinBlock --PCM--> WHEPServerSinkBlock ] (your .NET application)
Enter fullscreen mode
Exit fullscreen mode
What that buys you:
Sub-second latency — the browser plays WebRTC, not segments.
Almost no CPU for the video, for any number of viewers — the video is never decoded or encoded. The audio is decoded once per camera and encoded to Opus for each viewer.…