[FFmpeg-devel] rtmp buffering

Michael Niedermayer michaelni
Mon May 24 21:26:17 CEST 2010

On Mon, May 24, 2010 at 11:02:00AM -0700, Howard Chu wrote:
> Tom Janiszewski wrote:
>> I've been working with the built-in support in ffmpeg for rtmp (not
>> librtmp, but the avformat rtmpproto/pkt implementation), and had a
>> question about buffering:  Currently the rtmp stream reading uses the
>> default IO buffer size of 32768.  Is it possible to reduce this to
>> provide lower-latency on the rtmp read?
>> Depending on the rtmp codec settings, anywhere from 5-20 packets will
>> buffer up before being processed by ffmpeg, which usually translates to
>> latency of 500-1000ms.  Is this something that should be changed in
>> rtmpproto.c (i.e. max_packet_size) or is there a way to set the max
>> buffer size at the application level?
> It looks like IO_BUFFER_SIZE 32768 in aviobuf.c and max_packet_size are the 
> only available settings. Mucking with max_packet_size would probably be a 
> bad idea since RTMP packets can have widely varying sizes.
> Perhaps just change rtmp_read() to return at most 1 packet's worth of data 
> at a time.

returning only the available packet instead of blocking and filling the whole
buffer sounds like the correct solution


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100524/d85f1586/attachment.pgp>

More information about the ffmpeg-devel mailing list