[FFmpeg-devel] [PATCH] rtmpproto.c: Fixed RTMP Stream output issue

Chiranjeevi Melam cmelam at rgbnetworks.com
Wed Sep 7 18:44:54 CEST 2011


Hi Removed the tabs. Attached is the patch with the modifications suggested. The issue can be reproduced only if we use the high bit rates & resolution (i.e.: Resolutions greater than 720x576 and bitrates greater than 600 kbps for h.264 video codec in flv container).

-----Original Message-----
From: ffmpeg-devel-bounces at ffmpeg.org [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of Michael Niedermayer
Sent: Tuesday, September 06, 2011 3:35 PM
To: FFmpeg development discussions and patches
Subject: Re: [FFmpeg-devel] [PATCH] rtmpproto.c: Fixed RTMP Stream output issue

Hi Chiru

On Thu, Sep 01, 2011 at 07:18:09PM +0000, Chiranjeevi Melam wrote:
> Hi ,
> Attached is the patch for an RTMP stream output issue.
> "Original code had the assumption of only one FLV packet per RTMP packet. But that assumption is incorrect for higher bit rates. Made changes to the code to accommodate more than one FLV packet per RTMP packet."
> Thanks,
> Chiru

Content-Description: rtmp.patch
>  rtmpproto.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> a348e6a9db635b9c59308640ec0a48757f981774  rtmp.patch diff --git 
> a/ffmpeg_base/libavformat/rtmpproto.c b/ffmpeg/libavformat/rtmpproto.c 
> old mode 100644 new mode 100755 index e3fce2e..7bf7c90
> --- a/ffmpeg_base/libavformat/rtmpproto.c
> +++ b/ffmpeg/libavformat/rtmpproto.c
> @@ -925,7 +925,7 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
>      uint32_t ts;
>      const uint8_t *buf_temp = buf;
>  
> -    if (size < 11) {
> +    if (!rt->flv_off && size < 11) {
>          av_log(s, AV_LOG_DEBUG, "FLV packet too small %d\n", size);
>          return 0;
>      }
> @@ -966,20 +966,22 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
>          if (rt->flv_size - rt->flv_off > size_temp) {
>              bytestream_get_buffer(&buf_temp, rt->flv_data + rt->flv_off, size_temp);
>              rt->flv_off += size_temp;
> +			size_temp -= size_temp;

tabs are forbidden in git
also x -= x makes no sense, thats x=0

and how can we reproduce the problem this patch fixes ?

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtmp_flv.patch
Type: application/octet-stream
Size: 1473 bytes
Desc: rtmp_flv.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110907/8f103115/attachment.obj>


More information about the ffmpeg-devel mailing list