Docker container of nginx build with rtmp module, using ffmpeg with nvidia hardware acceleration.
871
A Dockerfile installing NGINX, nginx-rtmp-module and FFmpeg from source with default settings for HLS live streaming, with NVIDIA hardware acceleration. Built on Ubuntu.
docker pull jhamlin96/nginx-rtmp-nvidia
docker run -it -p 1935:1935 -p 8080:80 -e RTMP_PORT=1935 -e HTTP_PORT=80 --rm jhamlin96/docker-nginx-rtmp
or
docker build -t nginx-rtmp-nvidia .
docker run -it -p 1935:1935 -p 8080:80 -e RTMP_PORT=1935 -e HTTP_PORT=80 --rm nginx-rtmp-nvidia
rtmp://<server ip>:1935/stream/$STREAM_NAME
To enable SSL, see nginx.conf and uncomment the lines:
listen 443 ssl;
ssl_certificate /opt/certs/example.com.crt;
ssl_certificate_key /opt/certs/example.com.key;
This will enable HTTPS using a self-signed certificate supplied in /certs. If you wish to use HTTPS, it is highly recommended to obtain your own certificates and update the ssl_certificate and ssl_certificate_key paths.
I recommend using Certbot from Let's Encrypt.
This Docker image uses envsubst for environment variable substitution. You can define additional environment variables in nginx.conf as ${var} and pass them in your docker-compose file or docker command.
Custom Streaming Serverrtmp://localhost:1935/streamhellohttp://<server ip>:8080/live/$STREAM_NAME.m3u8
http://localhost:8080/live/hello.m3u8ffplay -fflags nobuffer rtmp://localhost:1935/stream/hello$ ffmpeg -buildconf
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=/usr/local --enable-version3 --enable-gpl --enable-nonfree --enable-small --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libtheora --enable-libvorbis --enable-libopus --enable-libfdk-aac --enable-libass --enable-libwebp --enable-postproc --enable-avresample --enable-libfreetype --enable-openssl --disable-debug --disable-doc --disable-ffplay --extra-libs='-lpthread -lm' --enable-nvenc --enable-cuda --enable-cuvid --enable-libnpp --extra-cflags='-I/usr/local/include -I/usr/local/include/ffnvcodec -I/usr/local/cuda/include/' --extra-ldflags='-L/usr/local/lib -L/usr/local/cuda/lib64'
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
configuration:
--prefix=/usr/local
--enable-version3
--enable-gpl
--enable-nonfree
--enable-small
--enable-libmp3lame
--enable-libx264
--enable-libx265
--enable-libvpx
--enable-libtheora
--enable-libvorbis
--enable-libopus
--enable-libfdk-aac
--enable-libass
--enable-libwebp
--enable-postproc
--enable-avresample
--enable-libfreetype
--enable-openssl
--disable-debug
--disable-doc
--disable-ffplay
--extra-libs='-lpthread -lm'
--enable-nvenc
--enable-cuda
--enable-cuvid
--enable-libnpp
--extra-cflags='-I/usr/local/include -I/usr/local/include/ffnvcodec -I/usr/local/cuda/include/'
--extra-ldflags='-L/usr/local/lib -L/usr/local/cuda/lib64'
Content type
Image
Digest
Size
3.8 GB
Last updated
almost 6 years ago
docker pull jhamlin96/docker-nginx-rtmp