Skip to content

Stream a video file to multiple RTMP publish points

Notifications You must be signed in to change notification settings

nassah221/rtmp2many

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rtmp2many

Stream a video file to multiple RTMP publish points using GStreamer bindings for Rust

Creating Multiple RTMP Endpoints with nginx

  1. Create multiple RTMP publish points using nginx. Download the software and the config files from here
  2. Extract the downloaded files in root/nginx, in my case C:/nginx
  3. Modify the nginx/conf/nginx.conf to create multiple applications which are going to server as multiple publish points for RTMP streams alt text
  4. Make a copy of viewer.html and change the stream_key. This is to be done for every application created in the conf file. In our case the stream keys are stream1 & stream2
  5. Having created multiple endpoints live1 & live2, start the nginx server by executing start.bat

Publishing to the Endpoints

  1. For slimmed main
    • cargo r --bin main -- -u rtmp://127.0.0.1/live1/stream1 rtmp://127.0.0.1/live2/stream2 -f "path:\\to\\video\\file"
  2. For verbose main
    • cargo r --bin verbose_main -- -u rtmp://127.0.0.1/live1/stream1 rtmp://127.0.0.1/live2/stream2 -f "path:\\to\\video\\file"

Streaming from the Endpoints

Use gst-launch or VLC Media Player to stream the video

  • gst-launch-1.0 uridecodebin uri="rtmp://127.0.0.1/live1/stream1" name=src ! queue ! videoconvert ! autovideosink src. ! queue ! audioconvert ! audioresample ! autoaudiosink
  • gst-launch-1.0 uridecodebin uri="rtmp://127.0.0.1/live2/stream2" name=src ! queue ! videoconvert ! autovideosink src. ! queue ! audioconvert ! audioresample ! autoaudiosink

Demo

alt text

About

Stream a video file to multiple RTMP publish points

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages