> Source: https://meetrix.io/blogs/kurento-alvar-irrlicht/
> Markdown copy of that page. Cite the URL above, not this file.

Development

# How to Set Up Kurento with ALVAR and Irrlicht (2018)

[By Buddhika Jayawardhana](https://meetrix.io/blogs/authors/buddhika-jayawardhana/) • November 5, 2018 • 3 min read

Written in 2018

This post was written for Kurento Media Server 6 on Ubuntu 16.04 and is kept as it was published, with small corrections. ALVAR has not been maintained for many years, and building it on a current compiler needs more work than shown here. For a current Kurento setup, start with [installing Kurento Media Server on Ubuntu](https://meetrix.io/blogs/install-kurento-media-server-ubuntu/), and for image processing inside Kurento today, see [creating an OpenCV filter for Kurento](https://meetrix.io/blogs/kurento-opencv-filter/).

ALVAR is an augmented reality library from VTT in Finland. It finds printed markers in a camera image and works out their position and angle, which is what you need to draw a 3D object that sits on the marker as the camera moves.

There was once an interesting demo combining ALVAR with [Kurento](https://github.com/Kurento): it rendered 3D models on detected ALVAR markers in real-time WebRTC video streams, with Irrlicht, an open source 3D engine, doing the drawing. The demo had stopped building years ago. In this post we bring it back to life, as the base for a remote support prototype where a technician can point at real objects in a customer's video.

## Installing ALVAR's dependencies

ALVAR needs OpenCV, GLUT and OpenSceneGraph development packages:

```bash
sudo apt-get install libopencv-dev freeglut3-dev libopenscenegraph-dev
```

## Compiling ALVAR with GCC 5

The original ALVAR sources don't compile with GCC 5, the default compiler on Ubuntu 16.04. We forked a mirror of ALVAR and fixed it; the fork is at [github.com/meetrix/alvar](https://github.com/meetrix/alvar).

```bash
git clone https://github.com/meetrix/alvar.git
cd alvar/build
chmod +x generate*.sh
./generate_gcc5.sh

cd build_gcc5_release
make
sudo make install
```

`make install` puts the ALVAR headers and libraries where a Kurento module can link against them.

## Using ALVAR inside a Kurento module

Kurento modules are C++ plugins for the media server. You describe the module's interface in a `.kmd.json` file, and Kurento's code generator creates the C++ skeleton and the client API from it. Our module was called `MeetrixRemoteSupportAlpha`, so the interface file lived at:

```text
src/server/interface/meetrixremotesupportalpha.MeetrixRemoteSupportAlpha.kmd.json
```

The augmented reality processing goes in the OpenCV implementation class, `MeetrixRemoteSupportAlphaOpenCVImpl.hpp` and its `.cpp`. Kurento hands that class each video frame as an OpenCV matrix. In it, the module:

1.  passes the frame to ALVAR's marker detector,
2.  takes the pose of each detected marker,
3.  renders the 3D model at that pose with Irrlicht, and
4.  draws the rendered model back onto the frame, which Kurento then sends on to the WebRTC viewers.

Add ALVAR and Irrlicht to the module's `CMakeLists.txt` so the build links against them, then build and install the module the same way as any other Kurento filter. The OpenCV filter guide linked above walks through that module build step by step, and [a TURN server](https://meetrix.io/blogs/install-coturn-ubuntu/) is worth setting up before you test with real users, because camera streams from mobile networks rarely connect without one.

If you are choosing a media server for new work rather than reviving Kurento, compare the options in [the best open source WebRTC media servers](https://meetrix.io/blogs/best-open-source-webrtc-media-servers-2026/).

Meetrix Store

Jitsi Meet

Self-hosted video calls for 50 to 500 users

[Deploy it](https://meetrix.io/store/jitsi-meet/)

Meetrix Store New

Deploy what this guide covers, pre-configured.

-    [Jitsi Meet Self-hosted video calls for 50 to 500 users](https://meetrix.io/store/jitsi-meet/)
-    [Coturn TURN/STUN for WebRTC, no per-minute relay fees](https://meetrix.io/store/coturn/)
-    [Mattermost Team chat, a self-hosted Slack alternative](https://meetrix.io/store/mattermost/)
-    [RustDesk Remote desktop AMI, a TeamViewer alternative](https://meetrix.io/store/rustdesk/)
-    [OpenVPN Encrypted remote access, no per-user fees](https://meetrix.io/store/openvpn/)
-    [Plane Issues, cycles and roadmaps, a Jira alternative](https://meetrix.io/store/plane/)

[Browse all products](https://meetrix.io/store/)
