flash media server - Problem with publishing rtmp stream to FMS with librtmp -


i'm trying video webcam , encoded , publish stream fms. , i'am having problem when try publish rtmp stream fms librtmp.
code:

char uri[]="rtmp://127.0.0.1/live/bolton"; r= rtmp_alloc(); rtmp_init(r);    rtmp_setupurl(r, (char*)uri); r->link.lflags |= rtmp_lf_live; r->link.lflags |= rtmp_lf_bufx; rtmp_enablewrite(r); //rtmp_setbufferms(r, buffertime); rtmp_connect(r, null); rtmp_connectstream(r,0); 

and log:

debug: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 debug: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 debug: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 debug: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 debug: handshake: handshaking finished.... debug: rtmp_connect1, handshaked debug2: rtmp_sendpacket: fd=768, size=85 debug2:   0000:  03 00 00 00 00 00 55 14  00 00 00 00               ......u.....       debug2:   0000:  02 00 07 63 6f 6e 6e 65  63 74 00 3f f0 00 00 00   ...connect.?....   debug2:   0010:  00 00 00 03 00 03 61 70  70 02 00 04 6c 69 76 65   ......app...live   debug2:   0020:  00 04 74 79 70 65 02 00  0a 6e 6f 6e 70 72 69 76   ..type...nonpriv   debug2:   0030:  61 74 65 00 05 74 63 55  72 6c 02 00 15 72 74 6d   ate..tcurl...rtm   debug2:   0040:  70 3a 2f 2f 31 32 37 2e  30 2e 30 2e 31 2f 6c 69   p://127.0.0.1/li   debug2:   0050:  76 65 00 00 09                                     ve...              debug: invoking connect debug2: rtmp_readpacket: fd=768 error: rtmp_readpacket, failed read rtmp packet header debug2: rtmp_sendpacket: fd=-1, size=307 

it seems rtmp_connect connected correctly, failes in function rtmp_connectstream, i'm not familiar rtmp connect sequence, , it's killing me.

what should find problems, much!

i'm dealing same problem, using librtmp ffmpeg. if in function rtmp_readpacket(), you'll see error thrown when trying read packet header method readn():

int rtmp_readpacket(rtmp *r, rtmppacket *packet) {     uint8_t hbuf[rtmp_max_header_size] = { 0 };     char *header = (char *)hbuf;     int nsize, hsize, ntoread, nchunk;     int didalloc = false;      rtmp_log(rtmp_logdebug2, "%s: fd=%d", __function__, r->m_sb.sb_socket);      if (readn(r, (char *)hbuf, 1) == 0)     {         rtmp_log(rtmp_logerror, "%s, failed read rtmp packet header", __function__);         return false;     } 

that error throws if readn returns 0. haven't figured out on end why that's happening yet, though.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -