e7db/rtmp-nvenc
A docker gateway-container between your PC and streaming services (Twitch, YouTube...)
10K+
A docker gateway container between your PC and streaming services (Twitch, YouTube...), using NVENC as encoder.
To use NVENC, you need a compatible Nvidia card and the NVIDIA Container Toolkit for Docker to be setup properly.
docker run -d --runtime nvidia --name rtmp-nvenc -p 1935:1935 e7db/rtmp-nvenc
In OBS, use the following settings:
Start streaming, then, go to VLC and and test your stream with the URL rtmp://<ip_of_host>/live/test
.
Remember to replace <ip_of_host> with your server IP.
Multiple default NVENC-based configurations are available for the following platforms:
rtmp://<ip_of_host>/facebook
rtmp://<ip_of_host>/mixer
rtmp://<ip_of_host>/periscope
rtmp://<ip_of_host>/restream
rtmp://<ip_of_host>/twitch
rtmp://<ip_of_host>/youtube
You can also use custom settings, to go Live on another platform or with any specific encoder settings you want. you can also use standard CPU-based x264 if you prefer.
For example, you could go live on Twitch with 4MBps bitrate using the following configuration:
application twitch {
live on;
exec_push ffmpeg -hwaccel cuvid -c:v h264_cuvid -i rtmp://localhost/twitch/$name -vsync 0 -c:a copy -c:v h264_nvenc -preset hq -profile high -rc cbr -b 4M -bufsize 4M -f flv rtmp://live.twitch.tv/app/$name >>/dev/stdout 2>&1;
}
You can then use this specific configuration by starting the container like this:
docker run -d --runtime nvidia --name rtmp-nvenc -p 1935:1935 -v /path/to/custom.conf:/etc/nginx/rtmp-conf.d/custom.conf e7db/rtmp-nvenc
docker pull e7db/rtmp-nvenc