<HTML dir=ltr><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18999"></HEAD>
<BODY>
<DIV><FONT color=#000000 size=2 face=Arial>
<DIV><FONT color=#000000>Hi,<BR><BR>How to publish a stream using librtmp library? <BR>I read the librtmp man page and for publishing , RTMP_Write() is used.<BR><BR>I am using C/C++ for my application.<BR><BR><FONT size=2 face="Courier New">//Code<BR>//Init RTMP code<BR>RTMP *r;<BR>char uri[]="rtmp://localhost:1935/live/desktop";<BR>r= RTMP_Alloc();<BR>RTMP_Init(r);<BR>RTMP_SetupURL(r, (char*)uri);<BR>RTMP_EnableWrite(r); // To publish a stream, enable write support before connect<BR>RTMP_Connect(r, NULL);<BR>RTMP_ConnectStream(r,0);<BR><BR></FONT>Then to respond to ping/other messages from server, I am using a thread to respond like following:<BR><BR><FONT size=2 face="Courier New">//Thread<BR>While (ThreadIsRunning && RTMP_IsConnected(r) && RTMP_ReadPacket(r, &packet))<BR>{<BR>if (RTMPPacket_IsReady(&packet))<BR>{<BR>if (!packet.m_nBodySize)<BR>continue;<BR>RTMP_ClientPacket(r, &packet); //This takes care of handling ping/other messages<BR>RTMPPacket_Free(&packet);<BR>}<BR>}</FONT></FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV>I am stuck at how to use RTMP_Write() to send the stream.</DIV>
<DIV>Please help me.</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>Dhruva</DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV></FONT></DIV><font face="monospace"></font></BODY></HTML>