Welcome to my GitHub

Github.com/zq2599/blog…

Content: all original article classification summary and supporting source code, involving Java, Docker, Kubernetes, DevOPS, etc.;

About the Kurento Series

“Kurento Combat” series is the original audio and video field combat topic, aiming to learn the mainstream real-time audio and video technology through combat. It is a great honor to start this wonderful journey with you.

About Kurento

  • Kurento consists of a WebRTC media server and a series of client applications designed to simplify real-time audio and video development on the Web and smart devices;
  • The official architecture diagram is as follows, the purple area at the top is end-to-end, the red area at the lower left corner is Kurento Media Server(KMS) that provides audio and video services, and the green area at the lower right corner is the business service, which interacts with KMS through APIS and provides signaling and control services to KMS and end-to-end (such as finding each other in peer-to-peer chat). Multiplayer chat is the business logic for providing rooms) :

About WebRTC(Web Real-Time Communication)

WebRTC is a technology that enables real-time video and audio communication within the browser, acquired by Google in 2010 through its $68.2 million acquisition of VoIP software maker Global IT Solutions. Google opened the project to the public on June 3, 2011. Knowledge about WebRTC is not covered in this article, but the following is a typical real-time communication flow that is very important:

This paper gives an overview of

As the beginning of Kurento In Action, today let’s try to deploy the core service Kurento Media Server(KMS), and run a demo application to verify that KMS works.

Version information

  1. Operating system: Ubuntu 16.04.5LTS
  2. KMS: 6.13.0
  3. The JDK: 1.8.0 comes with _191
  4. SpringBoot: 2.3.3. RELEASE
  • Note: The root account will be used in this actual combat
  • Next, deploy KMS;

operation

  1. Turn off the firewall;
  2. Install gnupg:
apt-get install --no-install-recommends --yes gnupg
Copy the code
  1. Setting environment variables:
DISTRO="xenial"
Copy the code
  1. Download keys from the key server to the trusted key list in preparation for the later installation:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5AFA7A83
Copy the code
  1. Add kurentu source address:
Tee "/ etc/apt/sources. List. D/kurento. List" > / dev/null < < EOF deb [arch = amd64] http://ubuntu.openvidu.io/6.13.0 $DISTRO kms6 EOFCopy the code
  1. KMS installation:
apt-get update && apt-get install --yes kurento-media-server
Copy the code
  1. Start the KMS:
service kurento-media-server start
Copy the code
  1. Check the KMS status and the following information indicates that the service is started successfully (active) :
root@docker:~# service kurento-media-server status ● kurento-media-server. service-lsb: Kurento Media Server daemon Loaded: loaded (/etc/init.d/kurento-media-server; bad; vendor preset: enabled) Active: active (running) since Fri 2021-01-01 05:39:24 PST; 2s ago Docs: man:systemd-sysv-generator(8) Process: 4815 ExecStart=/etc/init.d/kurento-media-server start (code=exited, status=0/SUCCESS) Tasks: 24 Memory: 17.3M CPU: 242ms CGroup: / system. Slice/kurento - media - for server service └ ─ 4828 / usr/bin/kurento - media - server Jan 01 05:39:24 docker systemd [1] : Starting LSB: Kurento Media Server daemon... Jan 01 05:39:24 docker kurento-media-server[4815]: * Start Kurento Media Server Jan 01 05:39:24 docker kurento-media-server[4815]: * Configure Kernel resource limits for Kurento Media Server Jan 01 05:39:24 docker kurento-media-server[4815]: ... done. Jan 01 05:39:24 docker systemd[1]: Started LSB: Kurento Media Server daemon.Copy the code
  1. Run the following command to check whether the response is normal:
Curl i-n \ -h "Connection: Upgrade" \ -h "Upgrade: websocket" \ -h "Host: 127.0.0.1:8888" \ -h "Origin: 127.0.0.1 \ "at http://127.0.0.1:8888/kurentoCopy the code
  1. KMS is ready to service if the console responds with the following:
HTTP/1.1 500 Internal Server Error
Server: WebSocket++/0.7.0
Copy the code
  1. Now that KMS deployment and startup is complete, let’s quickly experience the basic capabilities of KMS.

Experience the KMS

  • Next, deploy a SpringBoot application and experience KMS through the application’s web service. This application is deployed on another computer (and KMS is also deployed together with no problems). The overall environment is as follows:

  1. Log in to the 192.168.133.208 computer and turn off the firewall.
  2. Install JDK8 on the 192.168.133.208 PC.
  3. The focus of this article is deployed KMS about SpringBoot application without development, download the jar files, I have prepared the address is: download.csdn.net/download/bo…
  4. Helloworld-0.0.1 -snapshot. jar download helloworld-0.0.1 -snapshot. jar to 192.168.133.208 and run the following command to start the application:
Java - Dkms. Url = ws: / / 192.168.133.207:8888 / kurento - jar helloworld - 0.0.1 - the SNAPSHOT. The jarCopy the code
  1. If the following information is displayed on the console, the startup is successful:
/ root @ centos7 ~ # Java - Dkms. Url = ws: / / 192.168.133.207:8888 / kurento - jar helloworld - 0.0.1 - the SNAPSHOT. Jar. ____ _ __ _ _ / \ \ / ___ '_ __ _ _) (_ _ __ __ _ \ \ \ \ (\ ___ () |' _ | '_ | |' _ \ / _ ` | \ \ \ \ \ \ / ___) | | _) | | | | | | | (_ | |))))  ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.3.3. RELEASE) the 2021-01-03 12:30:56. 702 WARN 24669 - [the main] O.S.B oot. StartupInfoLogger: InetAddress.getLocalHost().getHostName() took 10004 milliseconds to respond. Please verify your network configuration. The 2021-01-03 12:31:06. 24669-719 the INFO [main] C.B.H elloworld. HelloWorldApplication: Starting HelloWorldApplication on centos7 with PID 24669 (/root/ helloWorld-0.0.1 - snapshot.jar started by root in /root) The 2021-01-03 12:31:06. 24669-719 the INFO [main] C.B.H elloworld. HelloWorldApplication: No active profile set, falling back to default profiles: The default 12:31:07 2021-01-03. 24669-970 the INFO/rbeatExec - e1 - t0 O.K.J.C.J sonRpcClientNettyWebSocket: [KurentoClient] Connecting Native Client 2021-01-03 12:31:07.974 INFO 24669 -- [rbeatexec-E1-t0] o.k.j.c.JsonRpcClientNettyWebSocket : [KurentoClient] Creating New NioEventLoopGroup 2021-01-03 12:31:23.159 INFO 24669 -- [ntLoopGroup-2-1] o.k.j.c.JsonRpcClientNettyWebSocket : [KurentoClient] Initiating new Netty channel. Will create new handler too! The 2021-01-03 12:31:23. 267 WARN 24669 - [the main] org. Kurento. Client. KurentoClient: Connected to KMS in 15294 millis (> 5000 millis) 2021-01-03 12:31:24.241 INFO 24669 -- [main] C.B.H elloworld. HelloWorldApplication: Started HelloWorldApplication in 53.092 seconds (JVM running for 53.509)Copy the code
  1. In the browser to access the address: https://192.168.133.208:8443, with the use of the visa, the browser will have safety tips, click on the button below the red box:

  1. Click on the link in the red box below to visit the home page of the SpringBoot application:

  1. This is the official Hello-World project of Kurento. Make sure that the microphone and camera on your current computer are all normal. Then click the Start button in the red box below to Start the WebRTC process:

  1. For security reasons, the browser will pop up a confirmation window, as shown in the red box below. Click “confirm” and the camera will start to capture the picture:

  1. As shown below, WebRTC is working normally:

  1. If you are smart, you should have noticed that the function of this application is to send the data of the local camera to KMS, and then take the video from KMS to local display. The official flow chart is as follows:

  1. If you are using Chrome, open another TAB and enter the address: Chrome :// Webrtc-internals/to view the details of webrTC, as shown below, you can see the details of PeerConnection:

  1. As shown in the red box below, the video stream locally output to KMS is encoded in VP8 format:

  1. You can continue to try, log in to the KMS machine and execute the following command to stop the KMS service. When you return to the web page, the preview window on the left still works normally, but the remote video window on the right has not moved:
service kurento-media-server stop
Copy the code
  • At this point, KMS from deployment to experience operations are completed, I hope this article can help you complete the most basic Kurento experience, the next article we continue to write code to do actual combat, hands-on while learning Kurento;

You are not alone, Xinchen original accompany all the way

  1. Java series
  2. Spring series
  3. The Docker series
  4. Kubernetes series
  5. Database + middleware series
  6. The conversation series

Welcome to pay attention to the public number: programmer Xin Chen

Wechat search “programmer Xin Chen”, I am Xin Chen, looking forward to enjoying the Java world with you…

Github.com/zq2599/blog…