Spoon Radio Echo Project, Lightweight and scalable broadcasting server.

Related tags

Command-line echo
Overview

Echo Project

https://medium.com/p/3bd1434a163a

Echo was initiated by a social network platform, Spoon Radio(https://www.spooncast.net). The main goal of this project is to develop a lightweight and scalable broadcasting server.

It is based on Apple's HLS technology enabling large-scale streaming services over CDN networks at low cost. On the other hand, DJs are allowed to publish contents via both a low-latency, reliable, open-source protocol, Secure Reliable Transport (SRT) protocol and Adobe's RTMP protocol, which is most commonly used to work with general-purpose solutions like Open Broadcaster Software (OBS, https://obsproject.com). While it is very simple to scale Echo in many ways, you can demonstrate its capabilities with OBS Studio or FFmpeg.

Thanks to the features above, Echo is composed of two modules: one that receives DJs' broadcasts and the other that stores the contents as HLS respectively. In addition, realtime mp4 archiving is also implemented.

The very Echo environment was equipped with the latest Rust language, which is as fast as C but has no memory risk. In Echo, all the code except a test SRT client is written in Rust to ensure reliable long-term operations on low-end servers without worrying about the CHRONIC MEMORY ERRORS, and it is an outstanding solution that has actually been verified on the Spoon Radio platform for nearly 10 years.

In this project, all the protocols and connectors such as SRT, RTMP, MP4, and HLS (m3u8) are fully Rusty, which will be a good reference for its beginners. The only part dependent on C is client sample code provided specifically for those who are not familiar with development of broadcasting clients or SRT protocol. Using the code, it is easy to create apps with broadcasting on iOS and Android.

Building and Running Echo Project

Requirements

  • rust (as build system)
  • cmake (as build system)
  • pkg-config (as build system)
  • OpenSSL

For Linux:

Install cmake , pkg-config and openssl-devel (or similar name) package.

Ubuntu
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install pkg-config cmake libssl-dev build-essential
CentOS
sudo yum update
sudo yum install pkgconfig openssl-devel cmake gcc gcc-c++ make automake
curl https://sh.rustup.rs -sSf | sh

For Mac

brew install cmake
brew install openssl
curl https://sh.rustup.rs -sSf | sh

Building

cargo build

Running

echo.env example

export LOG4RS_FILE="log4rs.yml"

export ECHO_ENABLED=1
export ECHO_SRT_PRIV_IP="127.0.0.1"

export HLS_ENABLED=1
export HLS_TARGET_DURATION=4
export HLS_WEB_ENABLED=1

export RTMP_ENABLED=1

export RECORD_ENABLED=1

export STAT_ENABLED=1
export STAT_WEB_ENABLED=1

run.sh example

Please see './scripts/run.sh'

Testing

Build and running Echo Server

Refer to the document below to build a RUST build environment.

scripts/README.md

Once you have built a RUST build environment on your system, you can run the Echo Server for testing on your local system by running the script below.

./script/run-dev.sh

Build Test SRT Client

cd scripts
./test-build.sh

Send SRT

cd scripts/echo-client 
./echo-publish.sh 127.0.0.1 demo clip.aac 

Send RTMP

This test requires ffmpeg to be installed. Please check the script contents.

./echo-publish.sh -r 127.0.0.1 demo clip.aac 

Test HLS URL

127.0.0.1:8080/cast/demo/playlist.m3u8

HLS Stream Output Directory

cd scripts/output
You might also like...
Bruteforce connecting to a specific Sea of Thieves server. Useful if you want to be in the same server as your friends.

SoT Server Finder Find which Sea of Thieves server you're connected to. Useful if you want to be in the same server as your friends. Setup Download so

Leptos server signals synced through Server-Sent-Events (SSE)

Leptos Server Sent Events Server signals are leptos signals kept in sync with the server through server-sent-events (SSE). The signals are read-only o

A lightweight but incredibly powerful and feature-rich BitTorrent tracker. Supports UDP + HTTP(S) and a private tracker mode.

Torrust Tracker Project Description Torrust Tracker is a lightweight but incredibly powerful and feature-rich BitTorrent tracker made using Rust. Feat

A lightweight and super fast cli todo program written in rust under 200 sloc
A lightweight and super fast cli todo program written in rust under 200 sloc

todo A lightweight and super fast cli todo program written in rust under 200 sloc installation AUR package: todo-bin use cargo build --release to comp

82 fun and easy to use, lightweight, spinners for Rust, with minimal overhead.
82 fun and easy to use, lightweight, spinners for Rust, with minimal overhead.

Spinners for Rust 82 fun and easy to use, lightweight, spinners for Rust, with minimal overhead, all the way from simple dots, to fun emoji based "spi

A lightweight, opinionated CQRS and event sourcing framework targeting serverless architectures.

cqrs A lightweight, opinionated CQRS and event sourcing framework targeting serverless architectures. Command Query Responsibility Segregation (CQRS)

A simple, lightweight and extensible command line argument parser for rust codebases

A simple, lightweight and extensible command line argument parser for rust codebases. This crate aims to provide you with an easy-to-use and extensibl

Lightweight alternative Discord client with a smaller footprint and some fancy extensible features.
Lightweight alternative Discord client with a smaller footprint and some fancy extensible features.

Dorion Dorion is an alternative Discord client aimed and lower-spec or storage-sensitive PCs that supports themes, plugins, and more! Table of Content

A lightweight and ergonomic rust crate to handle system-wide hotkeys on windows

Windows Hotkeys An opinionated, lightweight crate to handle system-wide hotkeys on windows The windows-hotkeys crate abstracts and handles all interac

Browse and listen to thousands of radio stations across the globe right from your terminal 🌎 📻 🎵✨

TuneIn CLI A command line interface for TuneIn Radio. You can search for stations, play them, and see what's currently playing. ?? Installation Compil

Tsiry Sandratraina 8 Mar 2, 2023
First class, scalable rust project generator with batteries included.

amble First class, scalable rust project generator with batteries included. Amble is in beta ??. Install | User Docs | Crate Docs | Reference | Contri

refcell.eth 13 Oct 23, 2023
Infino - Fast and scalable service to store time series and logs - written in Rust

Infino 〽️ ?? — ?? ?? — ⚖️ ?? Ingest Metrics and Logs — Query and Insights — Scale and Save $$ Infino is an observability platform for storing metrics

null 6 Apr 23, 2023
Write Cross-platform application with React-like decralative UI framework and scalable ECS architecture all in Rust.

bevy_dioxus Dioxus Plugin for Bevy Write Cross-platform application with React-like decralative UI framework and scalable ECS architecture all in Rust

Junichi Sugiura 269 Dec 29, 2022
A truly zero-dependency crate providing quick, easy, reliable, and scalable access to the name "jordin"

jordin Finally! A truly zero-dependency crate providing quick, easy, reliable, and scalable access to the name "jordin". Additionally, this one-of-a-k

jordin 2 Aug 4, 2022
Yet another lightweight and easy to use HTTP(S) server

Raptor Web server Raptor is a HTTP server written in Rust with aims to use as little memory as possible and an easy configuration. It is built on top

Volham 5 Oct 15, 2022
A fast and lightweight HTTP server implementation in Rust.

server_nano A tiny, fast, and friendly web server written in rust and inspired by express. It uses may to coroutines Usage First, add this to your Car

Jonny Borges 5 May 2, 2023
SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project.

SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project. With just a few primary configurations, such as project name, you can get started quickly.

Gabriel Michaliszen 4 May 9, 2023
A lightweight ShareX-compatible image uploader server

Imitari Imitari is a project to provide an easy and lightweight server for images. It is compatible with software like ShareX. The projects goals are

Imitari 12 May 5, 2022
Bracket QOS - a Quality of Service/Experience server system writtin in Rust. Derived from the excellent LibreQOS Project.

Bracket QOS - Open Source Edition This project is based on the excellent LibreQOS project. It is hoped that this can be useful for the upstream projec

Herbert 12 Dec 2, 2022