New submission from B Kaser <[email protected]>:
I was publishing 1600x1200 FLV screen video using RTMP to FMS 3.5. FMS closes
the connection with the error: Bad network data; terminating connection.
Command Line:
ffmpeg -i scr1612.flv -re -f flv -sameq rtmp://fmshost/live.scr2
$ ffmpeg -v 9 -loglevel 99 -i ../scr1612.flv -re -f flv -sameq
rtmp://10.200.210.196/live/scr2
FFmpeg version SVN-r24140, Copyright (c) 2000-2010 the FFmpeg developers
built on Jul 9 2010 07:50:13 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
configuration:
libavutil 50.21. 0 / 50.21. 0
libavcodec 52.80. 0 / 52.80. 0
libavformat 52.73. 0 / 52.73. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.22. 0 / 1.22. 0
libswscale 0.11. 0 / 0.11. 0
[NULL @ 0xe30f470] Probed with size=2048 and score=100
[flashsv @ 0xe310740] image: 1600x1200 block: 64x64 num: 25x18 part: 0x48
[flv @ 0xe30f470] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from '../scr1612.flv':
Duration: 00:00:55.18, start: 0.000000, bitrate: N/A
Stream #0.0, 47, 1/1000: Video: flashsv, bgr24, 1600x1200, 1/1000, 1k tbr,
1k tbn, 1k tbc
Handshaking...
Server version 3.5.2.1
Proto = rtmp, path = /live/scr2, app = live, fname = scr2
Client bandwidth = 2500000
Releasing stream...
FCPublish stream...
Creating stream...
Sending publish command for 'scr2'
[ffmpeg_output @ 0xe316e40] auto-inserting filter 'auto-inserted scaler 0'
between the filter 'src' and the filter 'out'
[scale @ 0xe317130] w:1600 h:1200 fmt:bgr24 -> w:1600 h:1200 fmt:yuv420p
flags:0xa0000004
Output #0, flv, to 'rtmp://10.200.210.196/live/scr2':
Metadata:
encoder : Lavf52.73.0
Stream #0.0, 0, 1/1000: Video: flv, yuv420p, 1600x1200, 1/1000, q=2-31, 200
kb/s, 1k tbn, 1k tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[flashsv @ 0xe310740] image: 1600x1200 block: 64x64 num: 25x18 part: 0x48
$
I have found a candidate fix for this issue. There is a bug in
rtmp_write() (libavformat/rtmpproto.c).
When a 32k byte packet has multiple video tags and the second tag
spans into the next packet, size_temp is used as the size left. But it has not
been updated and is larger than the actual data remaining.
This causes garbage data to be copied and the next tag is then
misaligned.
I will be glad to share my modified version of the file.
>
----------
messages: 11170
priority: normal
status: new
substatus: new
title: Corrupt data when publishing large FLV screen image over RTMP
topic: avformat
type: bug
________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/issue2084>
________________________________________________