[rtmpdump] Using librtmp library to publish a live stream to Wowza Media Server

Dhruva T S dhruvats at tataelxsi.co.in
Mon Dec 27 07:57:43 CET 2010


Hi,

How to publish a stream using librtmp library? 
I read the librtmp man page and for publishing , RTMP_Write() is used.

I am using C/C++ for my application.

//Code
//Init RTMP code
RTMP *r;
char uri[]="rtmp://localhost:1935/live/desktop";
r= RTMP_Alloc();
RTMP_Init(r);
RTMP_SetupURL(r, (char*)uri);
RTMP_EnableWrite(r); // To publish a stream, enable write support before connect
RTMP_Connect(r, NULL);
RTMP_ConnectStream(r,0);

Then to respond to ping/other messages from server, I am using a thread to respond like following:

//Thread
While (ThreadIsRunning && RTMP_IsConnected(r) && RTMP_ReadPacket(r, &packet))
{
if (RTMPPacket_IsReady(&packet))
{
if (!packet.m_nBodySize)
continue;
RTMP_ClientPacket(r, &packet); //This takes care of handling ping/other messages
RTMPPacket_Free(&packet);
}
}
 
I am stuck at how to use RTMP_Write() to send the stream.
Please help me.
 
Thanks,
Dhruva
 
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20101227/c3bc053f/attachment.htm>


More information about the rtmpdump mailing list