[rtmpdump] Malformed FLV file from RTMPdump of Flash Camera

Steffen Tiedemann Christensen steffen at 23company.com
Fri Sep 9 17:12:12 CEST 2011


Hi everyone,

I'm working on an application to record from a camera/microphone through
first Flash (tested with 10.2), then Flash Media Server (tested with 3.5.7)
and finally RTMPdump (tested with 2.4). The end problem is that the
dumped/recorded FLV is malformed, our at least doesn't have the necessary
headers to play anywhere -- or to be converted through ffmpeg.

That's the short version, there's a long one too. The flow is this:
a) I start a Flash application, which connects to FMS and attaches a
NetStream with the camera and mic. The app publishes to a specific stream on
the media server (sending "live", but alternatives "record" or "append" do
not change the outcome):

    stream.attachCamera(camera);
    stream.attachAudio(microphone);
    stream.publish('mp4:myvideo.f4v?awesomelysecret', 'live');

b) Anywhere else, I can connect to the FMS stream and play back the
video/audio from the live stream from a Flash player.

c) In order to record video from the stream, I use RTMPdump:

    rtmpdump -V -v -r "rtmp://
fml.4407.edgecastcdn.net/204407/mp4:myvideo.f4v" -o output.flv

(I know there's some confusion in formats here, but that's mostly for
setting the recording container within FMS. The stream itself is
Sorensen/H.263 and FLV)

The resulting FLV does not seem to have correct headers and cannot be
played/read anywhere. I'm wondering either how have RTMPdump write correct
headers? Or how to reconstruct the video correctly from from the dump? (This
flow, btw, works beautifully when I'm not using the built-in Adobe Flash
encoder. When streaming through FMLE or Wirecast, dumps are well-formed.
Debug information below.)

Any help is greatly appreciated -- thank you so much,
Steffen




HEX DUMP OF HEADERS
00000000  46 4c 56 01 01 00 00 00  09 00 00 00 00 09 00 1e
 |FLV.............|
00000010  1b 00 00 00 00 00 00 00  12 00 00 84 f3 00 9e 72
 |...............r|
00000020  25 d5 37 ea 84 b5 57 c3  fb 60 1d ad 5e 02 96 50
 |%.7...W..`..^..P|
00000030  2c cf 98 ce 19 55 07 01  ec c1 80 34 06 00 54 4a
 |,....U.....4..TJ|
00000040  06 00 40 4b 06 01 a4 7c  25 17 04 01 ff 84 bf 7c
 |.. at K...|%......||
00000050  49 55 e0 60 61 47 e0 a1  53 6f cb b0 74 a9 5a 9c
 |IU.`aG..So..t.Z.|
00000060  fd 50 3a b0 7a 22 9b 51  06 00 84 18 04 1b ef 78
 |.P:.z".Q.......x|
00000070  18 00 d0 60 1a 74 21 89  02 32 a1 27 41 81 79 12
 |...`.t!..2.'A.y.|
00000080  37 04 6f d1 1f dc c0 3d  fd 98 d2 8a 75 50 1c 07
 |7.o....=....uP..|
00000090  ab 06 01 88 03 87 e0 c0  12 2a 08 00 18 01 aa 82
 |.........*......|
000000a0  18 21 89 31 5c 8a bf 97  de a3 ef 97 76 37 e0 60
 |.!.1\.......v7.`|
000000b0  7e af 17 f5 6c f4 7f c7  72 d6 24 bb ad b4 18 45
 |~...l...r.$....E|
000000c0  00 70 30 03 20 c0 36 83  00 2c 0c 03 48 40 a3 e5  |.p0. .6..,..H@
..|
000000d0  6a d5 84 01 f8 96 ab df  12 4b a7 3e 3e 96 fd 59
 |j........K.>>..Y|
000000e0  70 07 97 35 b6 72 17 ed  8a 73 2a 93 4f 7f 7f fd
 |p..5.r...s*.O...|
000000f0  73 f5 82 1c 15 bf 86 72  71 57 c9 de 4f be 04 33
 |s......rqW..O..3|
00000100  84 fb 5f 4e 52 0b 78 22  f7 c2 7d ac 02 f0 43 01
 |.._NR.x"..}...C.|
00000110  52 5e 55 57 18 bd 50 cd  f0 99 00 5c 22 c5 78 02
 |R^UW..P....\".x.|

OUTPUT VIDEO FROM RTMPDUMP
http://refresh.dk/rtmpdump/output.flv

DEBUG INFO FROM RTMPDUMP
http://refresh.dk/rtmpdump/rtmpdump-output.txt

FLASH/FLEX CLASS USED TO PUBLISH
http://refresh.dk/rtmpdump/VisualCamera.as
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20110909/c92fe179/attachment.html>


More information about the rtmpdump mailing list