Stream Play Server (SPS) is a WebRTC-powered media server for real-time video streaming and remote control of Windows applications enabling Remote Gaming in a simple web browser environment.
Small video showing the usage of SPS using a phone with one controller connected to play a game (Biped) remotely
Handles real-time communication and media streaming to/between peers in a WebRTC-based application (Media Processing and Input Management)
Intermediary for WebRTC clients to exchange session information and coordinate the establishment of direct peer-to-peer connections
User-facing part of the WebRTC application that runs in the web browser (User Interface)
Main page | Admin page |
---|---|
http://ip\_address | http://ip\_address/admin/ |
There are 3 tabs available for the media stream, controller setup and connection setup | The 5 log files are checked every 10 seconds to display the subprocesses states |
Prerequisites :
Installation steps :
git clone https://github.com/delcourtfl/stream-play-server.git
cd stream-play-server
go get ./...
go run .
Set the ip address and port used in the config.json file before running (if no window name is provided the app list every visible windows and ask for the user input) :
{
"ip_address": "192.168.68.108",
"port": "3000",
"window_name": ""
}
(optional) Modify the ffmpeg commands to suit your needs (capture.go) :
ffmpegCmdVideo, err = launchCommand(
"ffmpeg",
[]string{
"-stats_period", "10",
"-f", "gdigrab",
"-thread_queue_size", "1024",
"-framerate", "30",
"-i", "title="+windowTitle,
"-vf", "scale=-1:720",
"-c:v", "libx264",
"-preset", "ultrafast",
"-tune", "zerolatency",
"-crf", "25",
"-pix_fmt", "yuv420p",
"-an",
"-f", "rtp", "rtp://127.0.0.1:5004?pkt_size=1200",
},
"../logs/video.log",
)
...
// Adding Audio streaming introduce latency and needs to be fixed
ffmpegCmdAudio, err = launchCommand(
"ffmpeg",
[]string{
"-stats_period", "10",
"-f", "dshow",
"-i", "audio=Mixage stéréo (Realtek(R) Audio)",
"-c:a", "libopus",
"-application", "lowdelay",
"-vbr", "off",
"-compression_level", "0",
"-frame_duration", "20",
"-vn",
"-f", "rtp", "rtp://127.0.0.1:5005",
},
"../logs/audio.log",
)
Start the application :
go run . -ui
Once the application is running some commands are available :
For the user interface multiple steps are also needed :
This project is a work in progress and as such there are areas that are still being refined and improved. This repository is open to any contributions, suggestions and recommendations for improvements and fixes.
Current issues :