Install Janus Gateway and Nginx with rtmp module

Tram Ho

Janus is an open source webRTC, providing many utilities for Chat, Videos / Audio call, Recorder or streamming. It is really a useful library for those who want to develop applications based on webRtc or websocket. In this article I would like to guide the steps to install janus on ubuntu / centos as well as macos. For more useful features of this library, you can refer to it here:

Install the necessary lib

In centos

Run the following command to install:

Sometimes we need to install epel-release by command yum install epel-release

In ubuntu

In macos

Install lib for websocket

Libsrtp

Libwebsockets

Coming here is considered to be the necessary libraries, now you need to download janus to install on your computer

Install Janus

In linux (ubuntu and centos)

Run the following commands:

Generate config:

In Macos

Run the following commands:

Generate config:

Note:

prefix is where janus will be installed, you are free to change the installation location as you like

After installation is complete, you need to change a little config file to be able to call videos:

Change in /opt/janus/etc/janus/janus.cfg file as follows:

This stun information is from google, you can easily find it online or you can install your own server for security.

Run Janus server

Enter cd into the installed janus directory (linux / centos at /opt/janus and macos at /usr/local/janus ) and run the following command:

For dev environment:

Each production field:

/tmp/janus.log is a /tmp/janus.log file, janus will save all logs here

Besides janus there are many other configurations, you can go to github to see more configuration.

janus requires nginx rtmp module to be able to run livestream as well as other features, the next part i will guide you to install nginx with rtmp module

Install Nginx with rtmp module

This section must be built separately, not just install a command is done as usual nginx.

Install libs

Install ngixn and hls

Install the Nginx init scripts.

This section allows you to use the command like service nginx start ... as usual:

Refer

And other sources on the internet

Share the news now

Source : Viblo