Immersive Visualization / IQ-Station Wiki
This site hosts information on virtual reality systems that are geared toward scientific visualization, and as such often toward VR on Linux-based systems. Thus, pages here cover various software (and sometimes hardware) technologies that enable virtual reality operation on Linux.
The original IQ-station effort was to create low-cost (for the time) VR systems making use of 3DTV displays to produce CAVE/Fishtank-style VR displays. That effort pre-dated the rise of the consumer HMD VR systems, however, the realm of midrange-cost large-fishtank systems is still important, and has transitioned from 3DTV-based systems to short-throw projectors.
Janus
Janus by MeetEcho is a software tool suite for serving WebRTC communication streams for web browsers.
This entry only covers aspects of the Janus tool that were needed for this page's author's particular needs — one-way real-time video streaming. It certainly could be useful for others to at least get started with their needs, especially the building and configuring sections.
Building Janus
There are a handful of dependencies required, some of which are optional, depending on which Janus plugins are needed for a particular application. These instructions include the dependencies for nearly all of the Janus options.
These instructions have been most recently tested with Janus version 1.3.0 on a Ubuntu 22.04 system, but prior to that have worked fine with Janus version 1.2.4 on a Rocky 8.10 (RHEL branch) OS.
Ubuntu dependency list
The four primary dependencies required for a basic Janus build on Ubuntu are:
- libnice-dev
- libsrtp2-dev — may also hand-build, depending on available version
- NOTE: The version of LibSRTP2 is important, and can't be too new (at least at the time of this writing). Presently, the version available on my Ubuntu 22.04 system (Janus v2.4.2) works, but v2.6.0 may be too new. (On my previous installation I manually built v2.2.0.)
- libjansson-dev
- libconfig-dev (and maybe libconfig++-dev)
The other packages that might be required, depending on how Janus will be used, are:
- libmicrohttpd-dev — Needed for my video streaming
- libpaho-mqtt-dev / libpaho-mqttpp-dev
- nanomsg-dev — I do not use the NanoMsg plugin
- libopus-dev — for "Audio bridge" plugin (and maybe audio streaming?)
- libsofia-sip-ua-dev — maybe for "Audio bridge" and "SIP"
- python3-paho-mqtt — installed just in case I want to interface MQTT in Python3
- libusrsctp-dev / libusrsctp-examples — for "DataChannels" (which I am not yet using)
- libwebsockets-dev — for WebSockets, obviously (also not yet using, but maybe)
- libwebsockets-test-server / libwebsockets-test-server-common — two bonus packages for possible debugging/prototyping needs
- NPM — for the
--enable-javascript-common-js-module
feature (which I do NOT install)
Rocky/RHEL dependency list
This list may not be complete, as I no longer have access to a Rocky Linux system, but these are the names of the packages I installed (or built) for the Rocky Linux installation:
- libnice &mash; manually built version
libnice-0.1.22
- libsrtp &mash; manually built version
libsrtp-2.2.0
with--enable-openssl
- libmicrohttpd-devel.x86_64
- paho-c-devel.x86_64 / paho-cpp-devel.x86_64
- nanomsg-devel.x86_64
NOTE: it's possible I had some needed packages previously installed on the system for other projects, and thus are in my notes documenting the required steps to build.
Build steps
In this build, I maximized the number of plugins that would work to provide
flexibility in using Janus.
However, I do not have NPM (the JavaScript NodeJS Package Manager) on the system,
so I did not include that option.
For my build, I minimally need the --enable-libsrtp2
and --enable-rest
features.
Other possible options (that I do NOT use) are --enable-javascript-common-js-module
Here are the build steps (for Janus version 1.3.0):
$ cd <utilities-directory>/Janus
$ wget https://github.com/meetecho/janus-gateway/archive/refs/tags/v1.3.0.tar.gz
$ tar -zxf v1.3.0.tar.gz
$ mkdir janus-gateway-1.3.0_u22
$ cd janus-gateway-1.3.0
$ sh autogen.sh
$ ./configure --prefix=<utilities-directory>/Janus/janus-gateway-1.3.0_u22 --enable-libsrtp2 --enable-websockets --enable-rest --enable-mqtt --enable-nanomsg --enable-plugin-textroom --enable-plugin-audiobridge --enable-data-channels
$ make
$ make install
$ vi Modules/u22/janus/1.3.0
NOTE: that I always use the Modules system for controlling the shell environment to allow for the use of multiple versions of specific tools. Hence the need to create the "janus/1.3.0" module file.
Configuring Janus
Again, these steps for configuring Janus will focus on video (and audio) streaming, but there are some steps that are generic, so we will start with those:
- Copy (or rename) all
<janus-feature>.jcfg.sample
files to just….jcfg
:
$ for file in *.jcfg.sample
> do base="${file%.jcfg.sample}"
> cp -p $base.{jcfg.sample,jcfg}
> done
Next, edit the particular "jcfg" files required for the desired output.
Ports
But first! It's important to choose what options, especially what ports will be used for communicating with Janus, with sending audio/video to Janus, and receiving WebRTC streams from Janus. These are the ports I am using (some of which are the defaults), and which will be used for the rest of the examples in this page:
8000
— Python3-based (or other) HTTP server8088
— Internal Janus HTTP webserver port (default) (defined injanus.transport.http.jcfg
)7088
— Internal Janus HTTP webserver port for Janus administration (default)8188
— Janus WebSockets interface (default) (I'm not yet using this)8004
— Incoming (to Janus) video port8005
— Incoming (to Janus) video port
Configuring Janus for Video (and Audio) Streaming
For the configuration where we will be ingesting h.264 video streams (possibly also audio streams), and streaming them to WebRTC client pages, three Janus-configuration files will need to be altered:
- janus.jcfg
- janus.transport.http.jcfg
- janus.plugin.streaming.jcfg
janus.jcfg
Presently,
I believe the only changes you may want to make to the janus.jcfg
configuration file is the debug-level and the password.
Both values are set in the general:
section at the top of
the sample version of the file.
Thus you may want to amend that section with:
general: {
debug_level = 3 # "4" is the default
admin_secret = "myword"
...
}
janus.transport.http.jcfg
As the (default) primary means by which components communication with Janus
is through it's internal HTTP webserver, that port must be set in
janus.transport.http.jcfg
.
The same is true for the Janus administrative port.
TODO
janus.plugin.streaming.jcfg
TODO
Running Janus
TODO
$ module load janus
$ janus --version
$ janus
Confirming Basic Operation
TODO
http://localhost:8088/janus/info
http://localhost:8088/admin/streaming