yubolong / mylive Goto Github PK
View Code? Open in Web Editor NEWA java rtmp server implementation
License: Apache License 2.0
A java rtmp server implementation
License: Apache License 2.0
Hi 兄弟, 对你些的东西很感兴趣,这个实时推流直播要如何测试,能有一个推流的测试类吗? 请赐教。
首先,非常感谢作者开源的项目,给了我很大的启发。
在这里,想向作者请教一个问题:
我使用OBS推流,然后VLC播放推上去的流,对比测试了MyLive与nginx-http-flv-module、pingos,发现MyLive的延迟比较高,约在10s以上,而nginx-http-flv-module和pingos在没有开启GOP缓存的模式下延迟约3s,开启后约5秒
请问作者知道这个吗,要降低这个延迟的话,有什么思路吗?
It appears you are not handling the handshake correctly.
Below is the correct method.
You are not verifying that the received handshake client sends s1 is correct and you are not sending back c1...
`
public static final int HANDSHAKE_LENGTH = 1536, VERSION_LENGTH = 1;
public static boolean startHandshake(InputStream in, OutputStream out)throws IOException {
if(in.available() < HANDSHAKE_LENGTH+VERSION_LENGTH){
return false;
}
in.read();
//C0&1
byte[] clientHandshake = new byte[HANDSHAKE_LENGTH];
in.read(clientHandshake);
//S0&1
byte[] serverHandshake = new byte[HANDSHAKE_LENGTH];
serverHandshake[0] = ((byte) (0xff & (0 >> 24)));
serverHandshake[1] = ((byte) (0xff & (0 >> 16)));
serverHandshake[2] = ((byte) (0xff & (0 >> 8)));
serverHandshake[3] = ((byte) (0xff & 0));
serverHandshake[4] = ((byte) (0xff & (0 >> 24)));
serverHandshake[5] = ((byte) (0xff & (0 >> 16)));
serverHandshake[6] = ((byte) (0xff & (0 >> 8)));
serverHandshake[7] = ((byte) (0xff & 0));
byte[] random = generateRandomData(HANDSHAKE_LENGTH-8);
System.arraycopy(random, 0, serverHandshake, 8, random.length);
out.write(0x03);
out.write(serverHandshake);
out.write(clientHandshake);
byte[] s1 = new byte[HANDSHAKE_LENGTH];
in.read(s1);
if(!Arrays.equals(serverHandshake, s1)){
return false;
}
return true;
}
public static byte[] generateRandomData(int size){
Random random = new Random();
byte[] bytes = new byte[size];
random.nextBytes(bytes);
return bytes;
}
`
使用rtsp流转换出现没有声音情况
直播为啥是从头播放的?
您好,目前我自己也想實作一個 RTMP 直播 server,但苦於看不太懂 RTMP Specification,現在只實作完成 handshake 的部分。
您只留下了 QQ 群的聯絡方式,但在我在台灣 創 QQ 帳號不成功,希望能透過信件聯絡,如果 email 您不想公開,且您願意交流的話再請您寄第一封信給我。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.