(https://hub.docker.com/r/murderousone/nginx-ffmpeg-rtmp)
THIS DOCKER IMAGE WILL WORK WITH 64 Bit Systems.
DOCKER IMAGE MAY NOT WORK WITH 32bit Systems.
Image can be attached too and is fully customizable.
Image has simple pre-installed bash scripts to make running the server easier.
* COMPILED WITH NGINX RTMP MODULE - NGINX v1.25.4
* COMPILED WITH FFMPEG Version 6.1.1 - use image tag: ubuntu-latest
* EASY INIT SCRIPT FOR NGINX START, RESTART, STOP
* EASY SHELL EXECUTABLE SCRIPTS FOR EDITING, NGINX START, RESTART, STOP AND EASIER MANAGING YOUR RTMP SERVER
* ALL UBUNTU PACKAGES UPDATED
* UBUNTU SERVER LATEST LTS ARM64
* COMPILED WITH NGINX RTMP MODULE - NGINX v1.25.4
* COMPILED WITH FFMPEG 6.1.1 - use image tag: ubuntu-arm64
* EASY INIT SCRIPT FOR NGINX START, RESTART, STOP
* EASY SHELL EXECUTABLE SCRIPTS FOR EDITING, NGINX START, RESTART, STOP AND EASIER MANAGING YOUR RTMP SERVER
* ALL UBUNTU ARM64 PACKAGES UPDATED
* RTMP Video on demand FLV/MP4, playing from local filesystem or HTTP
* Stream relay support for distributed streaming: push & pull models
* Recording streams in multiple FLVs
* H264/AAC support
* Online transcoding with FFmpeg
* HTTP callbacks (publish/play/record/update etc)
* Running external programs on certain events (exec)
* HTTP control module for recording audio/video and dropping clients
* Advanced buffering techniques to keep memory allocations at a minimum level for faster streaming and low memory footprint
* Proved to work with Wirecast, FMS, Wowza, JWPlayer, FlowPlayer, StrobeMediaPlayback, ffmpeg, avconv, rtmpdump, flvstreamer and many more
* Statistics in XML/XSL in machine- & human- readable form
ENJOY!
Docker image is a ubuntu x64 or Debian latest nginx/ffmpeg base os which contains all the configuration created for setting up a streaming server
The docker image is also unlocked and contains pre-made bash scripts to run your streaming server even easier than our manual setup.
Docker also allows better performance and less resources to your computer / server.
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
INSTALL DOCKER FOR OTHER NON-LINUX OS's
sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.7/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
To install Docker Compose on other non-Linux OS's
mkdir nginx-rtmp
(example: docker-compose.yml)
cd nginx-rtmp
nano docker-compose.yml
COPY and PASTE the code below for Ubuntu OS Container and Save
version: "3.8"
services:
nginx-rtmp-streaming-server:
image: murderousone/nginx-ffmpeg-rtmp:ubuntu-latest
volumes:
- nginxconfig:/usr/local/nginx/conf/
container_name: m1gc-nginx-rtmp-server
restart: unless-stopped
stdin_open: true
tty: true
ports:
- "80:80"
- "443:443"
- "1935:1935"
volumes:
nginxconfig:
mkdir nginx-rtmp
cd nginx-rtmp
nano docker-compose.yml
version: "3.8"
services:
nginx-rtmp-streaming-server:
image: murderousone/nginx-ffmpeg-rtmp:ubuntu-arm64
volumes:
- nginxconfig:/usr/local/nginx/conf/
container_name: m1gc-nginx-rtmp-server
restart: unless-stopped
stdin_open: true
tty: true
ports:
- "80:80"
- "443:443"
- "1935:1935"
volumes:
nginxconfig:
# Pull the latest image / update
docker-compose pull
# To Create, Start, Update and Restart the container
docker-compose up -d
Stop containers and removes containers, networks, and images created by up
docker-compose down
Above docker command will pull the image, create, run and start the Docker Container / Streaming Server already configured with ports opened.
IF YOU UPDATE THE DOCKER IMAGE TO A NEW VERSION, DOCKER COMPOSE WILL RECREATE THE DOCKER CONTAINER WITH THE NEW IMAGE UPDATES.
WHEN DOCKER COMPOSE RECREATES THE DOCKER CONTAINER, ANY CONFIGS CHANGES MADE TO THE CONTAINER WILL NOT BE DELETED
VOLUMES WILL BACKUP YOUR CONTAINER NGINX CHANGES AND WILL REQUIRE A VOLUME DELETE TO GO BACK TO DEFAULTS BUT IS OPTIONAL
docker volume ls
docker volume rm volume_name volume_name
docker exec nginx-rtmp-server ./restart-rtmp
NOTE: I LIKE TO KEEP THE IMAGE COMPLETELY TRANSPARENT / INSPECTABLE / ATTACHABLE / SIMPLE / U CAN ACCESS THE ENTIRE FILE SYSTEM IMAGE, EDIT, UPDATE, INSPECT THE FULL OS / MAKE ANY CHANGES OF YOUR OWN.
docker attach nginx-rtmp-server
./upgrade
Stream URL / Key from Restream.io, Youtube, Twitch
(Example: - Change -> push rtmp://live.restream.io/streamkey;)
SETTING RTMP SERVERS STREAM KEY (Can be named anything, No spaces.)
(EXAMPLE: Change -> rtmp://127.0.0.1/live/YOURSTREAMKEY to rtmp://127.0.0.1/live/ANY-KEYNAME-YOU-WANT)
./edit-rtmp
If you wish to use FFMPEG
FFMPEG LOCATION:
/usr/bin/ffmpeg
/usr/share/ffmpeg
./start-rtmp
./stop-rtmp
./restart-rtmp
HOLD: CRTL + p + q
Check the Video Above to View How To Setup. Edit, and Restart Using The Bash Scripts Provided....
Your docker streaming server is now started and running in the background...
You can now connect to it, using your preferred streaming software. (obs studio, xsplit, vmix, streamlabs obs, etc)
Any ol PC with OBS Studio & NVENC encoding.
In OBS, i use NVENC encoding and I use my monitor’s native resolution (1080p).
Using OBS Studio, in your broadcast settings you need to use the “Custom” streaming service.
The Streaming URL will be something like rtmp://192.168.1.100/live (Use your own server’s IP).
Your Stream Key needs to be the same you used in your nginx configuration.
(Example: KEYNAME-YOU-SET)
In the Encoding, use NVIDIA NVENC (Since it doesn’t use a lot of CPU).
Click here for Live encoder best settings for bit-rates, and resolutions
You may need to reduce your bit-rate depending on services bandwidth limits.
You may need to adjust your max bit rate according to your needs and capabilities
As for Audio encoding, I use the AAC codec, 160 bit rate and a Format of 44 or 48 Khz.
- RTMP Video on demand FLV/MP4, playing from local filesystem or HTTP
- Stream relay support for distributed streaming: push & pull models
- Recording streams in multiple FLVs
- H264/AAC support
- Online transcoding with FFmpeg
- HTTP callbacks (publish/play/record/update etc)
- Running external programs on certain events (exec)
- HTTP control module for recording audio/video and dropping clients
- Advanced buffering techniques to keep memory allocations at a minimum level for faster streaming and low memory footprint
- Proved to work with Wirecast, FMS, Wowza, JWPlayer, FlowPlayer, StrobeMediaPlayback, ffmpeg, avconv, rtmpdump, flvstreamer and many more
- Statistics in XML/XSL in machine- & human- readable form
ENJOY!