Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
983 views
in Technique[技术] by (71.8m points)

html5 video - stream RTSP to HTML website

I would like to display IP cameras streaming in RTSP into a web page.

I've tried many solutions, like using VLC to transcode the stream, but none of them seems to be reliable enough to create a real web service. I'm thinking on using some media server like flussonic or Red5. But I don't know if it will work.

This is why I would like to know what is the best (and the simple) solution to display RTSP streams on a webpage.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

...to create a real web service.

I've been looking for an answer for the past two or three days (I need support on as many browsers as possible, and latency as low as possible, so WebRTC was the way to go (is there anything better?)) and I've finally found it.

Check out this repo.

From the repo's readme + the additional steps I had to take (on Ubuntu 18.04) to make this work:

  1. Install go

    $ sudo snap install go --classic

  2. Get the code on your local device (Could someone enlighten me on what the export is for?).

    $ export GO111MODULE=on

    $ go get github.com/deepch/RTSPtoWebRTC

  3. This step didn't work for me, so I just downloaded the code in a .zip file and extracted it in the given directory and proceeded. (What did I miss? The src directory was not there before I made it)

    $ cd ~/go/src/github.com/deepch/RTSPtoWebRTC

  4. Run from current directory.

    $ go run .

  5. Then I opened the link below a web browser ( I tested on Chrome, iOS Safari, but it also works on Firefox).

    http://127.0.0.1:8083

This took me very little time to implement. Big thanks to the guys making this. All the other stuff I've found is either 5-7 years old and not working or non-WebRTC or a marketed paid service asking for unreasonable amounts of money.

I hope I answered your question.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...