SRS is a dedicated server project, please use librtmp instead, please read #32.
SRS不再维护srs-librtmp,原因请看#32。
Winlin 2021.05
The client library srs-librtmp of SRS(https://github.com/ossrs/srs)
SRS中srs_generate_normal_tc_url定义如下:
string srs_generate_normal_tc_url(string ip, string vhost, string app, int port, string param)
srs-librtmp中定义:
string srs_generate_normal_tc_url(string ip, string vhost, string app, int port)
对比两者发现,srs-librtmp中的URL不支持带参数的。目前需要使用srs-librtmp的srs_rtmp_bandwidth_check做带宽测试,由于SRS需要key参数,而srs-librtmp由于上述函数限制没有提供key参数。请问如何解决?
vhost=www.abc.com&autkey=afkdajdk, vhost 会被解析成www.abc.com&autkey 。其中"&"字符不能识别成分隔符, 在 srs_vhost_resolve 函数中。
客户端连接上srs后,发布流到SRS了,过程中如果超时了,srs会自动断开客户端的连接,但是客户端无法自动重连,并推流到SRS
After downloading last version of srs-librtmp library can't connect to any rtmp:// (ERROR_SOCKET_CONNECT on srs_rtmp_connect_server).
Hi, is it possible use your lib, with cgo ?
Actually i have a problem with it.
code sample:
package main
/*
#include "srs_librtmp.h"
*/
import "C"
func test(){
var url *C.char = C.CString("rtmp://a.rtmp.youtube.com/live2")
r:= C.srs_rtmp_create(url)
C.srs_rtmp_handshake(r)
}
func main(){
test()
}
output:
# command-line-arguments
Undefined symbols for architecture x86_64:
"_srs_rtmp_create", referenced from:
__cgo_c2568fdecd5f_Cfunc_srs_rtmp_create in main.cgo2.o
(maybe you meant: __cgo_c2568fdecd5f_Cfunc_srs_rtmp_create)
"_srs_rtmp_handshake", referenced from:
__cgo_c2568fdecd5f_Cfunc_srs_rtmp_handshake in main.cgo2.o
(maybe you meant: __cgo_c2568fdecd5f_Cfunc_srs_rtmp_handshake)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
目前我基于srs-v2.0-r3 做了一个Windows可以编译的 cmake工程。供参考
https://github.com/onvejon/srs-librtmp-cmake.git
Hi.` I'm not able to publish an audio file from windows . I have used code from srs_audio_raw_publish.c , but it always fails at
if ((nb_read = read(raw_fd, audio_raw, file_size)) != file_size) { srs_human_trace("buffer %s failed, expect=%dKB, actual=%dKB.", raw_file, (int)(file_size / 1024), (int)(nb_read / 1024)); goto rtmp_destroy;
Thank you
I don't know if I'm saying a stupid thing. Is it possible to convert srs-librtmp to WebAssembly?
So the problem of streaming in browsers would be solved once and for all ...
Application using srs-librtmp push rtmp to antmedia server failed when creatstream.
The application can work well with Youtube, Nginx rtmp. Please check it. Thanks.
目前 srs-librtmp 库是否支持编译为 Android 可以使用的 .so 的动态链接库 和 iOS可以使用的 .a 的静态链接库呢?
发现发送一个视频帧,有时候调用几百上千次send。这样会有性能问题吗?
Many thanks for cool library. I'm using it to create node C++ addon and it's working very well.
Now I have a problem, I try to publish flv file to rtmp server (nginx-rtmp). Our abstract flow is in below:
while(!eof) {
1. read tag headers by srs_flv_read_tag_header
2. read tag data by srs_flv_read_tag_data
3. send tag via srs_rtmp_write_packet (return 0, sent successfully)
}
But seem nginx-rtmp does not understand onMetadata
. I have tried OBS to publish same flv file to nginx-rtmp and I see in the log, it receive @setDataFrame
So do we need encode our data to AMF0 before sending (I have tried and same result)? Or how can send @setDataFrame
. Thanks so much!
Hi, thank you for your work.
Is it possible to set flashVer using this lib?
string srs_dns_resolve(string host, int& family)
{
addrinfo hints;
memset(&hints, 0, sizeof(hints));
hints.ai_family = family;
addrinfo* r = NULL;
SrsAutoFree(addrinfo, r);
if(getaddrinfo(host.c_str(), NULL, NULL, &r)) {
return "";
}
char saddr[64];
char* h = (char*)saddr;
socklen_t nbh = sizeof(saddr);
const int r0 = getnameinfo(r->ai_addr, r->ai_addrlen, h, nbh, NULL, 0, NI_NUMERICHOST);
if(!r0) {
family = r->ai_family;
//freeaddrinfo(r);
return string(saddr);
}
//freeaddrinfo(r);
return "";
}
这里使用SrsAutoFree(addrinfo, r); 会导致内存泄漏
其中 if ((fd = ::open(p.c_str(), O_RDONLY )) < 0) 没有以二进制打开
我自己编译了一份librtmp 在android上使用的库,效果不是很稳定
请问下这个库如何在android上使用呢?
握手成功,使用 srs_h264_write_raw_frames 发送几帧之后,会被服务器断开连接,收到 netstream.bad.request;
同样的地址,使用librtmp 推流则没有问题
返回的 error code, 在哪里找到定义,
比如 返回1007,代表什么错误?
hi,
Error 23 error C2664: 'int setsockopt(SOCKET,int,int,const char *,int)' : cannot convert argument 4 from 'timeval *' to 'const char *' c:\users\david\downloads\srs-librtmp-srs2.0\src\srs\srs_librtmp.cpp 35523
这个要怎么解决?
我是用 C 语言去调用 srs-librtmp 的
1) 调用 srs_rtmp_read_packet(rtmp, &type, ×tamp, &data, &size) 拉流时,data 没有相应的释放接口,在 c++ 时有 delete
2)同时多个拉流时,外部 epoll 之类没有得到相对应的socket 的句柄的接口,如果有这样的接口, 是不是要另外提供,play, play2 请求接口, 以及与之对应的srs_rtmp_read_packet 接口。
00 00 00 01 67 64 00 2a ad 84 01 0c 20 08 61 00 43 08 02 18 40 10 c2 00 84 2b 50 3c 01 13 f2 a0
00 00 00 01 68 ee 3c b0 00 00 00 01 06 e5 01 e9 80 00 00 00 01 65 b8 00 00 0c 9d 70 67 d6 81 af
SRS is a dedicated server project, please use librtmp instead.
srs-librtmp是从SRS服务器中导出的一个客户端库,当初做这个库的原因:
决定开源项目正义的绝对不是技术多好,而是能跑多久。技术很牛,性能很强,代码风格很好,固然是个好事,但是这些都顶不上一个“不维护”的大罪过,代码放出来不维护,怎么跟进业内技术的不断发展呢。
而决定能跑多久的,首先是技术热情,然后是维护者的领域背景。SRS的维护者都是服务器背景,大家的工作都是在服务器,客户端经验太少了,无法长久维护客户端的库。
因此,SRS决定果断放弃srs-librtmp,不再维护客户端库,聚焦于服务器的快速迭代。客户端并非不重要,而是要交给专业的客户端的开源项目和朋友维护,比如FFmpeg也自己实现了librtmp。
由于pion的出现,压测工具完全可以用Go来写,比如RTC的压测就是用pion写的,所以这个理由也不再存在。
知错就改,善莫大焉。
srs-librtmp的srs_audio_write_raw_frame可不可以支持48k采样率
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.