Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7513

Graphics, sound and multimedia • Display RSTP stream in web page

$
0
0
Hi,

I searched a way to display a RTSP stream inside a webpage, there is several solution like using WebRTC, HLS, MPEG#.
WebRTC is nice but ICE configuration maybe tricky, HLS and MPEG# could hardly reduce buffering below 1s.
go2rtc is a nice tool.

Then I tried another way, since https://developer.mozilla.org/en-US/doc ... Codecs_API allow to decode encoded video like H264/H265, making a light proxy that consume RTSP and forward encoded stream to the webbrowser. Then the webbrowser use webcodec to decode and render the video/audio. It needs webbrowser to support source encoding, but with modern hardware H265 is working , it is still difficult to make it work with WebRTC.

The code is available https://github.com/mpromonet/rtsp2web.git.

Building it is quite straight forward

Code:

cmake . && make
Then to start proxifying could be done with:

Code:

./rtspws -P8080 rtsp://77.110.228.219/axis-media/media.amp
Webstream could be display using http://localhost:8080

As webcodec needs to be executed in https://developer.mozilla.org/en-US/doc ... e_Contexts using remotely needs to enable https and give key & cert material using -c option.

It might be install though snap

Code:

sudo snap install rtsp2ws
Best Regards,
Michel.

Statistics: Posted by mpromonet — Mon Sep 08, 2025 2:51 pm — Replies 1 — Views 350



Viewing all articles
Browse latest Browse all 7513

Trending Articles