This server accepts video and audio via webrtc and converts them in Adaptive HLS
This project is in Progress(ui,cdn integration), Webrtc -> HLS
part is Complete.
Steps for running this Server (I recommend using local-testing branch)
Steps to follow for using this project
- Install or upgrade Golang ver. 1.15 or above
- Install or upgrade Ffmpeg ver. 4.3.1-5(available in
Debian Sid
) and windows ffmpeg v4.3 - Download the project using Git command
git clone https://github.com/mohit810/streamingcdn
- To start the server open the new folder created by Git and use the command
go run main.go
(Use terminal for running the server)
- Congratulations!! Now the server is up and running.
- As a starting point for testing you can use the Web UI
Current State
- Users can connect via
POST
request and start streaming(1.5Mbps speed is hardcoded for the stream). - The Server recieves the stream and converts it into HLS.
Currently in Development
- Integrating FFmpeg.(Completed for now, further optimization will be done later)
- Allowing multiple users to connect and start broadcasting.(not in priority, at this stage.)
- CDN Integration ( Post UI development)
- Front-end UI Development in android, web, ios. (Current priority is android)
Final Goal
To receive the broadcast, Convert it into hls in various quality then push those to cdn to serve to the User.
Before using this solution you should set-up pion/webrtc/v3 (Go Modules are mandatory for using Pion WebRTC. So make sure you set export GO111MODULE=on, and explicitly specify /v3 when importing.).
POST API used by the broadcaster for connecting to the server
{ "sdp":"", "streamKey":"" }
- Playlists and all the
.ts
files are served at /watch/streamkey/
(here streamKey is the string that the broadcaster sends in the POST
request when connecting to the server)
Big Thanks to the following