Nginx-vod-module is NGINX-based module developed by Kaltura. nginx-vod-module (included in Kaltura-Nginx) Enables On-the-fly repackaging of MP4 files to DASH, HDS, HLS, MSS. There are several other features like DRM, multi-bitrate, subtitles etc. supported by this module.
To check the detail about nginx-vod-module, you can visit kaltura nginx-vod-module github page here
In this tutorial, we will show you how to install nginx-vod-module using built-in Kaltura-Nginx for easy installation.
PREREQUISITES
- Ubuntu 20.04 LTS (Focal Fossa)
- NGINX version 18
- FFMPEG
- Kaltura-Nginx
Optional steps if ubuntu server running using root:
- Regular user with sudo access
We need to create user with sudo access by running the following command:
Change “ubuntu” with your username. You can skip this if you already have user with sudo access.
After that, switch to already created user by running the following command:
Update ubuntu repository and upgrade ubuntu system by running the following command:
INSTALL NGINX
Before we can install nginx-vod-module, we need to install NGINX on ubuntu first, the default NGINX version for ubuntu 20.04 is NGINX 1.18.0. Install using the following command:
Verify installed NGINX version and compiled modules.
INSTALL FFMPEG
Kaltura-nginx use FFmpeg shared library, so we need to install FFmpeg first. Install FFmpeg using the following command:
Verify installed FFmpeg version and compiled modules.
INSTALL KALTURA-NGINX
Before we can install Kaltura-Nginx, we need to add Kaltura-nginx repo first. Use the following command to add repo for Ubuntu focal fossa:
Update ubuntu repo and install Kaltura-Nginx
On Package configuration window, type your desired name for Server name
. For example : kaltura-nginx
For Vhost port to listen on, change to port 80
, make sure the port is open or allow in firewall
For RTMP port to listen on, leave default
Config Nginx with SSL, choose No
Do you intend to use the Nginx VOD module against a Kaltura CE Server? chose No
For Kaltura-nginx Operation mode, choose Local
For base dir for your media files, you can create videos folder on user home directory. For example: /home/ubuntu/videos/
Verify Kaltura-nginx installation by checking the status of kaltura-nginx.
TEST NGINX-VOD-MODULE
To test if nginx-vod-module, we need to add video to /home/ubuntu/videos/
where we have configured as base dir for media files used by kaltura-nginx.
But first, we need to change permission of videos folder to current user (ubuntu)
Lets download three sample videos from google storage bucket.
After you run the above command, there should be three video files named BigBuckBunny.mp4, ElephantsDream.mp4 and ForBiggerBlazes.mp4 on videos folder.
To test the video, you can visit this url:
http://SERVER-IP/hls/VIDEO-NAME.mp4/index.m3u8
For example : http://159.69.115.198/hls/BigBuckBunny.mp4/index.m3u8
Open VLC Media Player, click Media >> Open Network Stream (Ctrl+N) >> Paste video link and click Play button.
That’s how you can install nginx-vod-module for hls media streaming, you can also integrate media files from google cloud storage by mounting gcs to linux using our tutorial, Mount Google Cloud Storage on Compute Engine or Linux.