Nginx RTMP module on Ubuntu 18.04
Solution 1:
nginx-rtmp module can be installed directly from the Ubuntu 18.04 repository
sudo apt install libnginx-mod-rtmp
The latest version of nginx supports dynamic modules, make sure the statement to load the module is added in the nginx.conf:
load_module "modules/ngx_rtmp_module.so";
reference: https://stackoverflow.com/questions/36554405/how-to-enable-dynamic-module-with-an-existing-nginx-installation
Solution 2:
You cannot install the 'latest' RTMP module without recompiling NGINX at the same time, currently.
However, the RTMP module is available in the repositories already, but it is not called in by any specific NGINX flavor anymore. You will need to install the module with libnginx-mod-rtmp
- this will install the RTMP module that was compiled alongside NGINX when the packages were built, and then you should just need to restart and configure NGINX to use the RTMP module and its settings. (beyond the scope of this question)
sudo apt install libnginx-mod-rtmp
sudo systemctl stop nginx
sudo systemctl start nginx
The three aforementioned commands will be able to install the RTMP module. While it might not be the absolute latest of the code, it should provide most of the features that the RTMP module supports.
Solution 3:
after add the rtmp module
sudo apt install libnginx-mod-rtmp
for restarting nginx as service you can try
sudo service nginx restart