Code Monkey home page Code Monkey logo

lcss's Introduction

lcss

low cost streaming stack GitHub Logo

TL;DR:

Use docker!


Dependencies:

apt install -y nginx libnginx-mod-rtmp

Usage:

  1. Use "nginx.conf" on the server machine
  • Read the config and rewrite what is needed
  1. Use "cdn-nginx.conf" on CDN machines
  • Read the config and rewrite what is needed
  1. Broadcast via rtmp:
ffmpeg -hide_banner -fflags +genpts -stream_loop -1 -re -i <video> -c:v h264 -c:a aac -f flv rtmp://<IP>:<RTMP port>/show/<KEY>

Key example (based on the nginx.conf example)

1?pwd=mutansok
  1. Watch it with MPV:
mpv http://<IP>:<nginx port>/1/index.m3u8

or use the browser with the right addon. You need a browser supports MPEG-Dash + HLS playback. Firefox: https://addons.mozilla.org/en-US/firefox/addon/native-mpeg-dash-hls-playback/

Test

On CDN

wget http://localhost:63800/1/index.m3u8

Should give something like this:

# cat index.m3u8 
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:98
#EXT-X-TARGETDURATION:2
#EXTINF:2.000,
98.ts
#EXTINF:2.000,
99.ts
#EXTINF:2.000,
100.ts
#EXTINF:2.000,
101.ts
#EXTINF:2.000,
102.ts

Other:

  • viewer_counter.sh is a slow cost solution to count viewers on the CDN machine
    • start like this for channel 1
 watch -n 1 "./viewer_counter.sh 1 > /usr/share/nginx/html/1/viewer_counter/1_count.html"

TODOs:

  • deployment script
  • better viewer counter, maybe use log-management stuffs

lcss's People

Contributors

bodnartibi avatar elmisto avatar sige11 avatar

Stargazers

Norbert Takacs avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sige11 elmisto

lcss's Issues

Playback autorecords

Autorecords, so called VODs, can be played based on they HLS playlist.
NGINX can serve these playlists.
Served based on so called VOD ID.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.