从librtmp连接到red5“firstApp”的问题

时间:2011-05-11 13:29:39

标签: red5 rtmp

我正在尝试从libRTMP客户端连接到Red5教程“firstApp”应用程序。 请注意,我可以从flex客户端连接到它,如教程所述:

...
//from flex client 
NetConnection nc = new NetConnection();
nc.connect("rtmp://localhost/firstApp"); - connected, works

//from libRTMP

RTMP* r = RTMP_Alloc();
retVal = RTMP_SetupURL(r, "rtmp://localhost/firstApp");
retVal = RTMP_Connect(r, NULL); - no connection

retVal = RTMP_SetupURL(r, "rtmp://localhost:1935/firstApp");
retVal = RTMP_Connect(r, NULL); - still no connection

//The same thing works fine for Red5 "live" application

retVal = RTMP_SetupURL(r, "rtmp://localhost:1935/live/instance");
retVal = RTMP_Connect(r, NULL); - works, connected

任何想法可能是什么问题? 谢谢, -V

5 个答案:

答案 0 :(得分:0)

你能看看日志吗?也许librtmp仍然将“live”作为应用程序的名称发送。

答案 1 :(得分:0)

在red5 webapps目录中是否有一个名为“firstApp”的已安装和配置的应用程序?

答案 2 :(得分:0)

尝试“rtmp:// localhost / firstApp / definst ”作为网址

答案 3 :(得分:0)

RTMP网址格式的格式为

rtmp[t][e|s]://hostname[:port][/app[/playpath]]

参考:http://rtmpdump.mplayerhq.hu/librtmp.3.html

答案 4 :(得分:0)

最终用另一个开源RTMP项目“crtmpserver”(http://www.rtmpd.com)解决了我的问题,这个项目似乎设计,记录,实施和维护得更好。