[rtmpdump] librtmp hang issues

Rafael Cerioli rafael.cerioli at gmail.com
Sun Nov 13 15:53:02 CET 2011


Hi All, 

I'm writing a cocoa os x app that uses librtmp to download some stream. I got the source from the git repo (supposedly 2.4, although rtmp.h still says 2.3) and built the librtmp and linked to in my project.

When I'm reading a stream, I find that curiously the reading "hangs" after a while, and then start again after a minute or so (sometimes just failing with "ERROR: RTMP_ReadPacket, failed to read RTMP packet header"). When I mean hangs, it's just that RTMP_Read doesn't return, as if waiting from the server. Although I tested with the rtmpdump executable from the command line and everything goes fine, so bug is definitely not server side.
I've noticed that it was generally after downloading 7MB of data, and if I change the buffer size to something bigger, then the hanging happens much later, so it's seems to be directly related to the buffer size.

This is the sort of URL I use :
"rtmpe://theserver/thepath buffer=32768"

My code looks like :

char buffer[RTMP_DEFAULT_CHUNKSIZE];
size_t readCount = 0;
while ((readCount = RTMP_Read(rtmp, buffer, RTMP_DEFAULT_CHUNKSIZE)) > 0 ) {
[data appendBytes:buffer length:readCount];
}



Any help ?

Thanks,
Rafael

-- 
Rafael Cerioli
Sent with Sparrow (http://www.sparrowmailapp.com)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20111113/3b4ee97e/attachment.html>


More information about the rtmpdump mailing list