Create a Live Stream with Nginx and FFmpeg using HLS RTMP and Docker Compose

preview_player
Показать описание
Learn how to create a live stream with Nginx and FFmpeg using HLS, RTMP, and Docker Compose. We will also go over what HLS is, what RTMP is, and how they work.

Dockerfile URL

Become a Better Developer

My Software

Download Code

⌛ Timestamps
0:00 - Introduction
0:08 - Project Demonstration
0:38 - What is RTMP?
1:01 - What is HLS?
1:30 - Environment Variable Setup
2:07 - Configuring Nginx RTMP Server
3:38 - Configuring Nginx HTTP Server
5:03 - Creating the HTML Video Element
5:57 - Creating the FFmpeg Docker Image
8:22 - Installing Nginx RTMP Module
10:04 - Creating Nginx Service with Docker Compose
11:21 - Creating the FFmpeg Service with Docker Compose
11:49 - Running the Application
12:46 - Outro
Рекомендации по теме
Комментарии
Автор

Thank you for sharing this wonderful tutorial. With your guidance I was able to implement a live streaming app in Python. Thanks a lot dude. Keep up the good work.

mr_tpk
Автор

great tutorial.
I do have a question if possible :)
So, you stream the video file live. But how is it possible to stream live while allowing viewers to rewind? For example, YouTube offers the ability to watch a live stream from an earlier timestamp.
As I can guess, it somehow related to your backend implementation rather than to NGINX configuration. So, an ingester will stream its video using RTMP, then our backend will assemble it to a video file and then forward the stream to NGINX/CDN over HLS/DASH?
Hope the question is clear.

matthewdraevich
Автор

How would you stream a "playlist" of MP4 files in a folder to play sequentially?

mrmelo
Автор

is the nginx-proxy-manger in truenas scale the same on what you used?

shaun
Автор

Was this a re-upload? You mention flash, which doesn't work any more?

shaun
Автор

so.. this is a live stream.. what about if you just want to serve a youtube like service, on-demand videos ?.. and how many dockers should I create then ? one for each video ?

terfy
Автор

Hey, I wanted to ask how I can use an RTMP link as the input instead of a video file?

danliciousxs
Автор

Good video, do you have the repository with all the files you used?

SunHouse-APTO
Автор

Thank you for the video and the comprehensive blog. I've deployed this code on a vps server, but unfortunately I can't get it to work.

I have
The media could not be loaded, either because the server or network failed or because the format is not supported.

Maybe someone else also had this error and managed to solve it.

romeocaillon
Автор

to change the video file to an RTMP camera input?

GMNNATBR
Автор

Hello, I'm getting an error like this whenever I start. Is there any fix for this?

! ffmpeg Warning pull access denied for ffmpeg-i, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
! nginx Warning pull access denied for nginx-i, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

scratchguy
Автор

Can I stream a live screen share with sound?

vkeychaudhari
Автор

now how can i host this live thats i want to stream the live in my host web site how can or is possible

Ayoubz
Автор

how is this a live streaming.. this is streaming a file, it's not a live streaming

weekipi