Low latency point-to-point game streamer & player; best suited for 8-bit computer emulators. Can also capture locally and record streams.
What it do?
Simple Stream uses
ffmpeg to stream a window as low latency MPEG2-TS
(H.246/AAC) via either TCP or UDP. Audio is sourced from all desktop audio
(excluding microphones) or just the audio of emulators Simple Stream is aware
The TCP/UDP streams created are intended for a remote observer to watch or be included in an OBS Studio scene via Media Source.
Video can be encoded using
h264_nvenc are recommended as they are both tuned for low latency.
Simple Stream is currently "aware" of the following emulators, which means it knows how to crop out menus and status areas to optimise the stream and also how to automatically route just their audio.
- Caprice32 - Amstrad CPC Emulator
- Fuse - the Free Unix Spectrum Emulator
- VICE - the Versatile Commodore Emulator
In order to stream point-to-point the receiving party must configure NAT on
their router to allow the appropriate port (4864 by default) to be allowed
through. When streaming via TCP (the default),
play-stream.sh must be started
by the receiving party before the streamer starts
Fred wants to stream game play to his friend Barny.
- Barny configures NAT on his router to accept TCP/UDP on port 4864 and route that to his PC.
- Barny runs
./play-stream.sh -ip 220.127.116.117, where 18.104.22.1687 is his routers Internet facing IP address.
- Barny tells Fred he is ready to receive and his IP address.
- Fred runs
./stream.sh -ip 22.214.171.1247
- When prompted Fred clicks on the window of the game he wants to stream.
- Fred is now streaming to Barny.
- Barny will see a window of Fred's game appear.
- When Barny closes the stream it will automatically disconnect Fred's stream.
Simple Stream is a shell script that uses the following awesome software.
ffmpeg(snap preferred since it enables h264_nvenc and h264_vaapi)
nvidia-settings(optional; required for reliable capture when using nvidia drivers)
nvidia-utils-xyx(optional; required for h264_nvenc)
vainfo(optional; required for h264_vaapi)
Ubuntu 18.04 or newer
install.sh included in this repository.
The scripts in Simple Stream try and do the right thing by default, but if you need to tweak their behaviour this is how to do it.
Video streaming and local capture
stream.sh- Streams the selected window and loopback audio (MPEG2-TS).
capture.sh- Captures the selected window and loopback audio (Matroska).
Usage stream [--ffmpeg /snap/bin/ffmpeg] [--fps 60] [--ip 192.168.0.1] [--mouse] [--port 4864] [--protocol tcp|udp] [--stream-options '?fifo_size=10240'] [--vaapi-device /dev/dri/renderD128] [--vbitrate 640k] [--vcodec libx264] [--vsync] [--help] You can also pass optional parameters --ffmpeg : Set the full path to ffmpeg. --fps : Set framerate to stream at. --ip : Set the IP address to stream to. --mouse : Enable capture of mouse cursor; disabled by default. --port : Set the tcp/udp port to stream to. --protocol : Set the protocol to stream over. [tcp|udp] --steam-options : Set tcp/udp stream options; such as '?fifo_size=10240'. --vaapi-device : Set the full path to the VA-API device; such as /dev/dri/renderD128 --vbitrate : Set video codec bitrate for the stream. --vcodec : Set video codec for the stream. [libx264|h264_nvenc|h264_vaapi] --vsync : Enable vsync in the video encoder; disabled by default. --help : This help.
Video player and recorder
play-stream.sh- Plays a UDP or TCP stream using
record-stream.sh- Records a UDP or TCP stream used
Usage play-stream [--ip 192.168.0.1] [--player [ffplay|mpv] [--port 4864] [--protocol tcp|udp] [--help] You can also pass optional parameters --ip : Set the IP address to play from. --player : Set the player. [ffplay|mpv] --port : Set the tcp/udp port to connect to. --protocol : Set the protocol to play over. [tcp|udp] --help : This help.