diff --git a/README.md b/README.md index 30404ce..7023b93 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -TODO \ No newline at end of file +TODO +- https://www.hostwinds.com/guide/live-streaming-from-a-vps-with-nginx-rtmp/ +- https://stackoverflow.com/questions/44507032/how-to-generate-an-rtmp-test-stream-using-ffmpeg-command diff --git a/bin/test_rtmp b/bin/test_rtmp index 033f9f2..e80d2b9 100755 --- a/bin/test_rtmp +++ b/bin/test_rtmp @@ -1 +1 @@ -ffmpeg -r 30 -f lavfi -i testsrc -vf scale=1280:960 -vcodec libx264 -profile:v baseline -pix_fmt yuv420p -f flv rtmp://localhost:1935/stream/live +ffmpeg -r 30 -f lavfi -i testsrc -vf scale=1280:960 -vcodec libx264 -profile:v baseline -pix_fmt yuv420p -f flv rtmp://localhost:1935/stream/$1 diff --git a/nginx-rtmp/Dockerfile b/nginx-rtmp/Dockerfile index 169417a..7766add 100644 --- a/nginx-rtmp/Dockerfile +++ b/nginx-rtmp/Dockerfile @@ -145,9 +145,13 @@ COPY --from=build-nginx /usr/local/nginx /usr/local/nginx COPY --from=build-ffmpeg /usr/local /usr/local COPY --from=build-ffmpeg /usr/lib/libfdk-aac.so.2 /usr/lib/libfdk-aac.so.2 +RUN apk add stunnel +ADD stunnel.conf /etc/stunnel/stunnel.conf + # Add NGINX path, config and static files. ENV PATH "${PATH}:/usr/local/nginx/sbin" ADD nginx.conf /etc/nginx/nginx.conf +ADD streams.conf /etc/nginx/streams.conf RUN mkdir -p /opt/data && mkdir /www ADD static /www/static diff --git a/nginx-rtmp/nginx.conf b/nginx-rtmp/nginx.conf index abeb483..53d9cd5 100644 --- a/nginx-rtmp/nginx.conf +++ b/nginx-rtmp/nginx.conf @@ -20,8 +20,7 @@ rtmp { -c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 750k -f flv -g 30 -r 30 -s 640x360 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_360p878kbs -c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 400k -f flv -g 30 -r 30 -s 426x240 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_240p528kbs -c:a libfdk_aac -b:a 64k -c:v libx264 -b:v 200k -f flv -g 15 -r 15 -s 426x240 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_240p264kbs; - - push rtmp://live-sea.twitch.tv/app/live_485882788_fJBYc5AbXnuiZgWRzQK5nDSE25ob6c; + include streams.conf; } application hls {