乌班图平台kurento +kurento-one2many-call+videojs-panorama+RICOH THETA实现VR直播

时间:2023-03-09 22:59:14
乌班图平台kurento +kurento-one2many-call+videojs-panorama+RICOH THETA实现VR直播

这个小项目是公司要求的,开发大佬找到的资源,让小弟搭建一下子。第一次体验VR视频效果,感觉很好。

下面将搭建过程简单写出来,有需求的可以参考下。

一.乌班图平台搭建

按照centos7的习惯搞了一下乌班图,之前没怎么用过

.安装虚拟机
这个过程不必描述了,网上一大堆
.修改root密码,能够切换到最大权限操作.以下都在root用户操作
sudu passwd root
.配置网络
vim /etc/network/interfaces auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 10.0.0.133
netmask 255.255.255.0
gateway 10.0.0.2
此处有一个/etc/init.d/network-manager需要注意,这个东西我一般是直接关闭的。 .更换阿里云源
阿里云源地址:https://opsx.alibaba.com/mirror
先备份后修改/etc/apt/sources.list的配置。删除原来的内容,后复制进去
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
.安装vim软件,配置ssh服务
apt install vim -y
apt install openssh-server -y
修改/etc/ssh/sshd_config
# PermitRootLogin prohibit-password
PermitRootLogin yes # 允许root登陆
service ssh restart
6.其他的简单操作不再叙述,修改主机名,防火墙啥乱七八糟的。至此可以实现远程连接就可以了

二.Kurento服务安装

.Kurento安装
官网地址:https://doc-kurento.readthedocs.io/en/6.10.0/
6.1 确保已安装GnuPG:
sudo apt-get update && sudo apt-get install --no-install-recommends --yes gnupg
6.2 定义系统中安装的Ubuntu版本。只运行其中一行:
# Run ONLY ONE of these lines:
DISTRO="xenial" # KMS for Ubuntu 16.04 (Xenial)
DISTRO="bionic" # KMS for Ubuntu 18.04 (Bionic)
.3将Kurento存储库添加到系统配置中。在上一步中使用的同一终端中运行这两个命令:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5AFA7A83
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.10.0 $DISTRO kms6
EOF
.4安装KMS
sudo apt-get update && sudo apt-get install --yes kurento-media-server
这里我遇到了一个问题,如下:解决办法,在乌班图图形界面打开重要更新,和推荐跟新,去掉问题源。
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
6.5 启动,关闭服务
sudo service kurento-media-server start
sudo service kurento-media-server stop
日志在此处:/var/log/kurento-media-server .STUN和TURN服务器
7.1 STUN服务器:
取消注释WebRtcEndpoint配置文件中的以下行/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini:
这里有多个免费IP和Port可供选择:https://doc-kurento.readthedocs.io/en/6.10.0/user/installation.html#check-your-installation
stunServerAddress=<serverIp>
stunServerPort=<serverPort>
7.2 TURN服务器,免费TURN/STUN服务器
取消注释/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini:
turnURL=user:password@66.228.45.110:

三.安装kurento-one2many-call+videojs-panorama

官网:https://doc-kurento.readthedocs.io/en/stable/tutorials/node/tutorial-helloworld.html
安装Node.js和Bower
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g bower
安装kurento-one2many-call
git clone https://github.com/Kurento/kurento-tutorial-node.git
cd kurento-tutorial-node/kurento-hello-world
git checkout 6.10.
npm install
npm start
kurento-one2many-call这个包我们是开发经过二次开发修改给我的,能够直接启动
安装videojs-panorama
官网:https://github.com/yanwsh/videojs-panorama
npm install --save videojs-panorama 在解压包下面启动服务:
npm start -- --ws_uri=ws://192.168.10.178:8888/kurento #这里是主机IP,端口号是kurento的端口号 npm报错
https://blog.csdn.net/peyogoat/article/details/71081914

4.整合nginx转发服务

此服务在浏览器必须带证书才能访问

以下是简单的配置,未经过优化。域名需要在网站上能够解析

server{
listen ;
server_name www.libra.wang; # 域名 return https://$host$request_uri;
} server {
listen ;
server_name www.libra.wang; #域名
ssl on;
ssl_certificate /etc/nginx/test.pem; #密钥路径
ssl_certificate_key /etc/nginx/test.key; #证书路径
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1 TLSv1. TLSv1.;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on; location / {
# root /var/www/html; # index文件路径
# index index.html index.htm;
proxy_redirect off;
proxy_connect_timeout 60s;
proxy_read_timeout 86400s;
proxy_send_timeout 60s;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://192.168.43.239:8443;
} error_page https://$host$request_uri;
}

5.win10配置理光 thera驱动

官网:https://topics.theta360.com/ct/faq/c_06_v/304_1/,直接下载安装这个摄像头驱动

win10连接理光 thera全景摄像机,t同时调节到直播模式

6.打开浏览器观看(务必使用firefox火狐浏览器)

此处开发修改了kurento-one2many-call的index.html页面为中文,去掉了其他多余的东西。

直播共享摄像头选择 RICOH THETA V FullHD 或者下面那个4K都可以。点击直播

在VR眼睛里面打开相同的网页,点击观看,即可享受VR直播。

乌班图平台kurento +kurento-one2many-call+videojs-panorama+RICOH THETA实现VR直播