NB: You can vary both number of parallel sessions and number of outputs for each session. Choose the stream you want to transcode and start: ffmpeg -re -i /path/to/stream/stream.mp4 -map 0 -c copy -f flv rtmp://localhost/origin_qsv_1/mystream If you want to create configuration for RTMP module, you need add it to nf file.įor a live streaming example: #user nobody worker_processes 1 #error_log logs/error.log #error_log logs/error.log notice #error_log logs/error.log info #pid logs/nginx.pid events Īfter this, you can launch broadcasting using Nginx. You can find Nginx working configuration in /etc/nginx/nf. If you want Nginx to run every time with system starting, you can enable it: sudo systemctl enable nginx Step 4. If Nginx is going to use any folders, you need to create Nginx-user and group and change owner and group of these folders to Nginx: sudo useradd -r -d /var/cache/nginx/ -s /sbin/nologin -U nginx chown -R nginx:nginx Īs we are going to run Nginx as a service, we need to create rvice file along this path /usr/lib/systemd/system/ with the following content (copy text below to your rvice file): Description=nginx - high performance web server Documentation= After=network-online.target remote-fs.target nss-lookup.target Wants=network-online.target Type=forking PIDFile=/var/run/nginx.pid ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nf ExecStart=/usr/sbin/nginx -c /etc/nginx/nf ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID WantedBy=multi-user.targetĪfter all these steps, you can finally start Nginx: sudo service nginx start Tuning NginxĪfter installing, create the module link to Nginx directory: sudo ln -s /usr/lib64/nginx/modules /etc/nginx/modules
To check Nginx version and installed modules use: nginx -V Step 3.
Quicksync streaming install#
configure -prefix=/etc/nginx -sbin-path=/usr/sbin/nginx -modules-path=/usr/lib64/nginx/modules -conf-path=/etc/nginx/nf -error-log-path=/var/log/nginx/error.log -pid-path=/var/run/nginx.pid -lock-path=/var/run/nginx.lock -user=nginx -group=nginx -build=CentOS -builddir=nginx-1.14.0 -http-log-path=/var/log/nginx/access.log -http-client-body-temp-path=/var/cache/nginx/client_temp -http-proxy-temp-path=/var/cache/nginx/proxy_temp -http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp -http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp -http-scgi-temp-path=/var/cache/nginx/scgi_temp -with-select_module -with-poll_module -with-threads -with-file-aio -with-http_ssl_module -with-http_v2_module -with-http_realip_module -with-http_addition_module -with-http_sub_module -with-http_dav_module -with-http_flv_module -with-http_mp4_module -with-http_gunzip_module -with-http_gzip_static_module -with-http_auth_request_module -with-http_random_index_module -with-http_secure_link_module -with-http_degradation_module -with-http_slice_module -with-http_stub_status_module -with-mail=dynamic -with-mail_ssl_module -with-stream=dynamic -with-stream_ssl_module -with-stream_realip_module -with-stream_ssl_preread_module -with-compat -add-module=./nginx-rtmp-module -with-debugĪfter configurating Nginx, you need to make and install it: sudo make sudo make install Then, go to ‘nginx-1.14.0’ directory and configure Nginx with parameters below: cd nginx-1.14.0/. Next, you need to clone Nginx RTMP module using git: git clone In this example we have chosen version 1.14.0: wget tar -xzvf nginx-1.14.0.tar.gz
Quicksync streaming archive#
InstallationĪfter installing related attributes, we need to download Nginx archive from Nginx official web site: (you can choose version you want) and extract it on your CentOS machine. Preparationīefore we start Nginx installation, we need to install some packages dependencies for its clear work: sudo yum -y groupinstall 'Development Tools' sudo yum -y install epel-release sudo yum install openssl-devel sudo yum install -y pcre-devel Step 2. If you are facing Nginx the first time and you want to install it with RTMP module on CentOS, this tutorial is for you. In this case, we will install compile and tune Nginx using RTMP (Real Time Messaging Protocol) module, which is mainly used for streaming video and audio streams from web cameras over the internet. In this article we will consider Nginx as a video streaming tool. It can be used as load balancer, reverse proxy, mail proxy, HTTP cache and more. Nginx is an opensource web server with a lot of functions.
Photo by Adi Goldstein on Unsplash About Nginx