0 Votes

Kurento

Last modified by Jeff McDonald on 2021/11/26 15:42

Install on Oracle Linux

Quick instructions for Oracle Linux 7.7.

sudo systemctl stop firewalld
sudo systemctl disable firewalld
sudo yum install -y yum-utils
sudo yum-config-manager --enable ol7_addons
sudo yum -y install docker-engine
sudo systemctl enable docker
sudo systemctl start docker
sudo docker run -d \
     --net=host --restart always \
     -v /media:/media \
     -v /etc/kurento:/etc/kurento \
     --name kms kurento/kurento-media-server:latest

Performance Tuning

Docker

Additional Docker parameters to improve performance:

--privileged
--security-opt apparmor=unconfined
-e GST_DEBUG="*:2"

Linux Tuned

Several predefined tuning profiles are available on Oracle Linux to improve performance.

See: https://www.certdepot.net/rhel7-apply-tuning-profile-server/

https://docs.oracle.com/en/operating-systems/oracle-linux/7/monitoring/tuned-install.html

Example

sudo tuned-adm profile latency-performance

Tickless Mode

Oracle Linux 7+ operates in 'tickless' mode. This can foul-up streaming realtime applications.

Modify Kernel parameters:

sudo vi /etc/default/grub

GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=ol_linux77/root rd.lvm.lv=ol_linux77/swap rhgb quiet nohz=off"

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo reboot now

Install on MacOS

docker run -d --network host --restart always --name kms kurento/kurento-media-server:latest

docker run --name kms -d -p 8888:8888 -p 10000-10025:10000-10025 -e KMS_EXTERNAL_ADDRESS=192.168.1.16 -v /Users/jeff/Documents/Projects/vorpalnet/docker/kurento/etc/kurento:/etc/kurento kurento/kurento-media-server:latest

Note: The Docker option "--network host" is not supported on MacOS.

Also, the "-e KMS_EXTERNAL_ADDRESS=<IP Address>" does not seem to work for (S)RTP.

https://doc-kurento.readthedocs.io/en/6.13.2/

Ubuntu Local Installation

Local Installation

sudo apt-get update && sudo apt-get install --no-install-recommends --yes gnupg
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5AFA7A83
source /etc/upstream-release/lsb-release 2>/dev/null || source /etc/lsb-release
sudo tee "/etc/apt/sources.list.d/kurento.list" >/dev/null <<EOF
# Kurento Media Server - Release packages
deb [arch=amd64] http://ubuntu.openvidu.io/6.13.2 $DISTRIB_CODENAME kms6
EOF
sudo apt-get update && sudo apt-get install --no-install-recommends --yes kurento-media-server
sudo service kurento-media-server start
sudo service kurento-media-server stop

Ubuntu Docker Installation

https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04

Disable firewall:

sudo ufw disable
sudo apt-get update

--Notes--

https://www.kurento.org/blog/rtp-i-intro-rtp-and-sdp

https://github.com/Kurento/kurento-tutorial-java

Kurento Javadoc:

https://doc-kurento.readthedocs.io/en/6.7.1/_static/client-javadoc/index.html

WebSocket API:
https://docs.oracle.com/middleware/1213/wls/WLPRG/websockets.htm#WLPRG988

--Notes--

I do not like the Kurento Java client. It seems to be blocking and the callback functions cannot be serialized. This makes it really annoying to save attributes in context data. It would be better to use the Java EE websocket client and send JSON data.

Kurento recommends creating your own client: https://doc-kurento.readthedocs.io/en/6.14.0/features/kurento_protocol.html#creating-a-custom-kurento-client

They created a proprietary IDL format. You're supposed to use Apache Freemarker to convert the IDL files into a Java client. (Not easy!)

I would prefer to convert the IDL files into JSON Schema files. Then run them through something like http://www.jsonschema2pojo.org.

Ok... It's Monday, June 22, 2020... Let's see if I can get this accomplished this week!

Step 1) Install the Kurento Module Creator.

sudo apt-get update && sudo apt-get install --yes kurento-module-creator
To use it:
kurento-module-creator -c <CODEGEN_DIR> -r <ROM_FILE> -r <TEMPLATES_DIR>

Where:

  • CODEGEN_DIR: Destination directory for generated files.
  • ROM_FILE: A space-separated list of Kurento Media Element Description (kmd files), or folders containing these files. For example, you can take a look to the kmd files within the Kurento Media Server source code.
  • TEMPLATES_DIR: Directory that contains template files. As an example, you can take a look to the internal Java templates and JavaScript templates directories.

Ok, we have to get the Kurento source:

git clone https://github.com/Kurento/kurento-media-server.git

git clone https://github.com/Kurento/kurento-java.git

kurento-module-creator -c kclient1 -r kurento-media-server/scaffold -r kurento-java/kurento-client/src/main/resources/templates/

No kmd files found in paths: [kurento-media-server/scaffold, kurento-java/kurento-client/src/main/resources/templates/]

ugh! won't compile on Java 11

sudo apt-get install openjdk-8-jdk

update-java-alternatives -l

java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64

java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64

jeff@kurento:~/kurento-java$ sudo update-java-alternatives -s java-1.8.0-openjdk-amd64