运行 Kurento Java Tutorial - Hello World 测试
程序员文章站
2022-07-14 20:34:27
...
1、参考链接Kurento Java Tutorial - Hello World搭建环境,下载代码,导入工程项目如图;
里面有很多示例,先运行测试第一个工程kurento-hello-world;
编译成功。
2、设置kurento-hello-world的运行参数如下:
Dkms.url=ws://192.168.0.107:8888/kurento
见图:
3、修改文件
/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini,设置stun,turn服务器地址和端口;
stunServerAddress=210.22.129.139
stunServerPort=3478
turnURL=gmt:aaa@qq.com:3478
4、启动KMS后,运行kurento-hello-world;
aaa@qq.com:/etc/kurento/modules/kurento# service kurento-media-server restart
5、用google chroma 浏览器, 输入地址https://127.0.0.1:8443,360浏览器视频无图(问题正在找)
第一次remote stream 无图,kurento-hello-world 报WARN,
The decoded text message was too big for the output buffer and the endpoint does not support partial messages;
再项目中添加WebSocketConfig 类来修改 textBufferSize=1024000,binaryBufferSize=1024000;问题解决。
package org.kurento.tutorial.helloworld;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.util.WebAppRootListener;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class WebSocketConfig implements ServletContextInitializer {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
System.out.println("org.apache.tomcat.websocket.textBufferSize");
servletContext.addListener(WebAppRootListener.class);
servletContext.setInitParameter("org.apache.tomcat.websocket.textBufferSize","1024000");
servletContext.setInitParameter("org.apache.tomcat.websocket.binaryBufferSize","1024000");
}
}
运行结果如图:
上一篇: 基本TCP套接字编程
下一篇: 3_基本TCP套接字编程