[FFmpeg-devel] [PATCH/RFC] Detecting EOF in RTMP

Martin Storsjö martin
Thu Dec 10 15:37:59 CET 2009


I tried out the new and fancy RTMP support recently, against a slightly 
customized Wowza setup.

When the live broadcast ends, the current rtmp protocol handler doesn't 
detect this as an eof, and thus sits and waits for more data on the 

When the broadcast is terminated, the last packet either contains a single 
NetStream.Publish.UnpublishNotify status, or sometimes it contains a 
series of four status codes:

The attached patch is an attempt at fixing this case. The if clause in 
rtmp_parse_result is needed since the packet that contained 
UnpublishNotify also could contain a new Start status code.

On the other hand, that particular behaviour (sending a new Start code 
even if no more data is sent) perhaps should be regarded as a server 
misbehaviour? But I think at least the single UnpublishNotify should 
trigger an eof in some way.

Kostya, what do you think about this approach? How is the eof condition 
handled in other setups?

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-rtmp-eof.patch
Type: text/x-diff
Size: 1767 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091210/64b50dcb/attachment.patch>

More information about the ffmpeg-devel mailing list