[FFmpeg-user] rtmpdump works / ffmpeg fails - swf verification and saving a stream

Roger Morton ttguy1 at gmail.com
Sat Sep 1 14:42:00 CEST 2012


I have a rtmpdump command that succeeds in downloading a stream from
ABCtv Austalias iView service


rtmpdump -V --rtmp rtmp://cp53909.edgefcs.net:1935 --app
'ondemand?auth=daEd5bbb.djagdyb5cNcNblcidmb0b3atbV-bqqFvX-8-qlm_tHAnL&aifp=v001' --playpath mp4:flash/playback/_definst_/catalyst_13_15.mp4 --swfVfy http://www.abc.net.au/iview/images/iview.jpg  -o /home/god/Videos/catalyst3.mp4

The above command downloads the whole file. But when I try and convert
it to a similar command for use with ffmpeg [below] it fails. (I need to
use ffmpeg because I am writing a plugin for the Serviio media server)

ffmpeg -report -i
"rtmp://cp53909.edgefcs.net:1935/mp4:flash/playback/_definst_/catalyst_13_15.mp4 app='ondemand?auth=daEbQaza1aTbSa7dZbXdTavcLa9dVcEdhdX-bqqFHH-8-lkq_uEwoJ&aifp=v001' playpath=mp4:flash/playback/_definst_/catalyst_13_15.mp4 swfUrl=http://www.abc.net.au/iview/images/iview.jpg swfVfy=1" /home/god/Videos/catalyst3.mp4

I few points about these commands. I need to to swfVerification on these
streams and I am using http://www.abc.net.au/iview/images/iview.jpg as
the .swf file to verify against. The syntax in rtmpdump for --swfVfy
switch is "--swfVfy|-W url URL to player swf file, compute hash/size
automatically" Normally the swfVfy URL would be a .swf file. But I
believe this service has renamed a .swf file to a .jpg to obfuscate a
bit. 

There are 3 reasons why I believe the verification URL is the iview.jpg 
1. The file is not really a jpg - will not display in the browser as one
2. Using it works in rtmpdump
3. Not using it but using a swfsize and swfhash matching it also works.

To reproduce this issue you might need to live in Australia (geo
blocking on the iView stuff). And you need to get auth tokens from
http://tviview.abc.net.au/iview/auth/?v2

Is this difference in behavior between rtmpdump and ffmpeg an issue with
my translation of the commands  - annoyingly it appears the parameter
named swfVfy is a URL in rtmpdump but a true/false switch in ffmpeg - so
I might have stuffed up something.

Or does this difference reflect some sort of issue with ffmpeg - perhaps
how it behaves when ask to do swf verification on a file without a .swf
file extension?

* * * * * * * * * *
Successful rtmpdump command 
rtmpdump -V --rtmp rtmp://cp53909.edgefcs.net:1935 --app
'ondemand?auth=daEd5bbb.djagdyb5cNcNblcidmb0b3atbV-bqqFvX-8-qlm_tHAnL&aifp=v001' --playpath mp4:flash/playback/_definst_/catalyst_13_15.mp4 --swfVfy http://www.abc.net.au/iview/images/iview.jpg  -o /home/god/Videos/catalyst3.mp4 

RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license:
GPL
DEBUG: Parsing...
DEBUG: Parsed protocol: 0
DEBUG: Parsed host    : cp53909.edgefcs.net
WARNING: No application or playpath in URL!
DEBUG: Protocol : RTMP
DEBUG: Hostname : cp53909.edgefcs.net
DEBUG: Port     : 1935
DEBUG: Playpath : mp4:flash/playback/_definst_/catalyst_13_15.mp4
DEBUG: tcUrl    :
rtmp://cp53909.edgefcs.net:1935/ondemand?auth=daEd5bbb.djagdyb5cNcNblcidmb0b3atbV-bqqFvX-8-qlm_tHAnL&aifp=v001
DEBUG: swfUrl   : http://www.abc.net.au/iview/images/iview.jpg
DEBUG: app      :
ondemand?auth=daEd5bbb.djagdyb5cNcNblcidmb0b3atbV-bqqFvX-8-qlm_tHAnL&aifp=v001
DEBUG: live     : no
DEBUG: timeout  : 30 sec
DEBUG: SWFSHA256:
DEBUG: 96 cc 76 f1 d5 38 5f b5 cd a6 e2 ce 5c 73 32 3a
DEBUG: 39 90 43 d0 bb 6c 68 7e dd 80 7e 5c 73 c4 2b 37
DEBUG: SWFSize  : 2122
DEBUG: Setting buffer time to: 36000000ms
Connecting ...
DEBUG: RTMP_Connect1, ... connected, handshaking
DEBUG: HandShake: Client type: 03
DEBUG: HandShake: Client digest offset: 430
DEBUG: HandShake: Initial client digest: 
DEBUG: 09 ef b9 33 72 d1 96 9b c5 65 de e8 09 3c 3d b3
DEBUG: a2 d7 c5 9f 40 d2 3e aa c6 3c 90 eb ee 8d a3 26
DEBUG: HandShake: Type Answer   : 03
DEBUG: HandShake: Server Uptime : 1014319344
DEBUG: HandShake: FMS Version   : 3.5.7.1
DEBUG: HandShake: Calculated digest key from secure key and server
digest: 
DEBUG: a0 77 7e ff 5a 97 8e 29 38 ab 2a 4d 4f 62 da ff
DEBUG: 42 4e 37 e6 55 77 23 d5 d9 e9 ff 93 1a f1 86 b6
DEBUG: HandShake: Client signature calculated:
DEBUG: 05 5e 2a 23 cd bc 9c 9a 60 ef 38 ed 6b 65 5d f9
DEBUG: c3 a9 35 58 f9 e5 4f 1b 71 23 57 83 58 2f 0e 60
DEBUG: HandShake: Server sent signature:
DEBUG: f5 de e4 87 8d 2c 94 f6 d6 fe 10 7b bc df 90 c3
DEBUG: b4 e1 04 cb 88 1d 26 e4 69 67 3d 1d 80 00 3c a8
DEBUG: HandShake: Digest key: 
DEBUG: 62 fc 85 f4 c9 b7 64 fe df 0f 11 c4 2f 89 c0 36
DEBUG: 01 1d 09 85 0f c7 03 cd c7 3c ff 30 53 7f 69 41
DEBUG: HandShake: Signature calculated:
DEBUG: f5 de e4 87 8d 2c 94 f6 d6 fe 10 7b bc df 90 c3
DEBUG: b4 e1 04 cb 88 1d 26 e4 69 67 3d 1d 80 00 3c a8
DEBUG: HandShake: Genuine Adobe Flash Media Server
DEBUG: HandShake: Handshaking finished....
DEBUG: RTMP_Connect1, handshaked
DEBUG: Invoking connect
INFO: Connected...
DEBUG: HandleServerBW: server BW = 1250000
DEBUG: HandleClientBW: client BW = 1250000 2
DEBUG: HandleCtrl, received ctrl. type: 26, len: 3
DEBUG: HandleCtrl, SWFVerification ping received: 
DEBUG: sending ctrl. type: 0x001b
DEBUG: Sending SWFVerification response: 
DEBUG: 00 1b 01 01 00 00 08 4a 00 00 08 4a 91 b0 91 20
DEBUG: 8f 46 07 c4 32 5c 71 e9 a3 43 a0 89 8b fc cf f0
DEBUG: ec 85 6c d8 55 35 1d 21 91 28 2e 07 
DEBUG: RTMP_ClientPacket, received: invoke 242 bytes
DEBUG: (object begin)
DEBUG: (object begin)
DEBUG: Property: <Name:             fmsVer, STRING:	FMS/3,5,7,7024>
DEBUG: Property: <Name:       capabilities, NUMBER:	127.00>
DEBUG: Property: <Name:               mode, NUMBER:	1.00>
DEBUG: (object end)
DEBUG: (object begin)
DEBUG: Property: <Name:              level, STRING:	status>
DEBUG: Property: <Name:               code, STRING:
NetConnection.Connect.Success>
DEBUG: Property: <Name:        description, STRING:	Connection
succeeded.>
DEBUG: Property: <Name:     objectEncoding, NUMBER:	0.00>
DEBUG: Property: <Name:               data, OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name:            version, STRING:	3,5,7,7024>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_result>
DEBUG: HandleInvoke, received result for method call <connect>
DEBUG: sending ctrl. type: 0x0003
DEBUG: Invoking createStream
DEBUG: RTMP_ClientPacket, received: invoke 21 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onBWDone>
DEBUG: Invoking _checkbw
DEBUG: RTMP_ClientPacket, received: invoke 29 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_result>
DEBUG: HandleInvoke, received result for method call <createStream>
DEBUG: SendPlay, seekTime=0, stopTime=0, sending play:
mp4:flash/playback/_definst_/catalyst_13_15.mp4
DEBUG: Invoking play
DEBUG: sending ctrl. type: 0x0003
DEBUG: RTMP_ClientPacket, received: invoke 10275 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_onbwcheck>
DEBUG: Invoking _result
DEBUG: HandleChangeChunkSize, received: chunk size change to 4096
DEBUG: HandleCtrl, received ctrl. type: 4, len: 6
DEBUG: HandleCtrl, Stream IsRecorded 1
DEBUG: HandleCtrl, received ctrl. type: 0, len: 6
DEBUG: HandleCtrl, Stream Begin 1
DEBUG: RTMP_ClientPacket, received: invoke 228 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object begin)
DEBUG: Property: <Name:              level, STRING:	status>
DEBUG: Property: <Name:               code, STRING:
NetStream.Play.Reset>
DEBUG: Property: <Name:        description, STRING:	Playing and
resetting flash/playback/_definst_/catalyst_13_15.mp4.>
DEBUG: Property: <Name:            details, STRING:
flash/playback/_definst_/catalyst_13_15.mp4>
DEBUG: Property: <Name:           clientid, STRING:	i1RINWlS>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onStatus>
DEBUG: HandleInvoke, onStatus: NetStream.Play.Reset
DEBUG: RTMP_ClientPacket, received: invoke 222 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object begin)
DEBUG: Property: <Name:              level, STRING:	status>
DEBUG: Property: <Name:               code, STRING:
NetStream.Play.Start>
DEBUG: Property: <Name:        description, STRING:	Started playing
flash/playback/_definst_/catalyst_13_15.mp4.>
DEBUG: Property: <Name:            details, STRING:
flash/playback/_definst_/catalyst_13_15.mp4>
DEBUG: Property: <Name:           clientid, STRING:	i1RINWlS>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onStatus>
DEBUG: HandleInvoke, onStatus: NetStream.Play.Start
Starting download at: 0.000 kB
DEBUG: RTMP_ClientPacket, received: notify 24 bytes
DEBUG: (object begin)
DEBUG: (object end)
DEBUG: ignoring too small audio packet: size: 0
DEBUG: RTMP_ClientPacket, received: notify 44 bytes
DEBUG: (object begin)
DEBUG: (object begin)
DEBUG: Property: <Name:               code, STRING:
NetStream.Data.Start>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: RTMP_ClientPacket, received: invoke 57 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onBWDone>
DEBUG: RTMP_ClientPacket, received: invoke 20 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_result>
DEBUG: HandleInvoke, received result id 0 without matching request
DEBUG: RTMP_ClientPacket, received: notify 592 bytes
DEBUG: (object begin)
DEBUG: (object begin)
DEBUG: Property: <Name:           duration, NUMBER:	1624.33>
DEBUG: Property: <Name:       moovPosition, NUMBER:	36.00>
DEBUG: Property: <Name:              width, NUMBER:	640.00>
DEBUG: Property: <Name:             height, NUMBER:	360.00>
DEBUG: Property: <Name:       videocodecid, STRING:	avc1>
DEBUG: Property: <Name:       audiocodecid, STRING:	mp4a>
DEBUG: Property: <Name:         avcprofile, NUMBER:	77.00>
DEBUG: Property: <Name:           avclevel, NUMBER:	31.00>
DEBUG: Property: <Name:             aacaot, NUMBER:	2.00>
DEBUG: Property: <Name:     videoframerate, NUMBER:	25.00>
DEBUG: Property: <Name:    audiosamplerate, NUMBER:	44100.00>
DEBUG: Property: <Name:      audiochannels, NUMBER:	2.00>
DEBUG: Property: <Name:          trackinfo, OBJECT>
DEBUG: (object begin)
DEBUG: (object begin)
DEBUG: Property: <Name:             length, NUMBER:	974616.00>
DEBUG: Property: <Name:          timescale, NUMBER:	600.00>
DEBUG: Property: <Name:  sampledescription, OBJECT>
DEBUG: (object begin)
DEBUG: (object begin)
DEBUG: Property: <Name:         sampletype, STRING:	avc1>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object begin)
DEBUG: Property: <Name:             length, NUMBER:	71632858.00>
DEBUG: Property: <Name:          timescale, NUMBER:	44100.00>
DEBUG: Property: <Name:  sampledescription, OBJECT>
DEBUG: (object begin)
DEBUG: (object begin)
DEBUG: Property: <Name:         sampletype, STRING:	mp4a>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object begin)
DEBUG: Property: <Name:             length, NUMBER:	600.00>
DEBUG: Property: <Name:          timescale, NUMBER:	600.00>
DEBUG: Property: <Name:  sampledescription, OBJECT>
DEBUG: (object begin)
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object begin)
DEBUG: Property: <Name:             length, NUMBER:	600.00>
DEBUG: Property: <Name:          timescale, NUMBER:	600.00>
DEBUG: Property: <Name:  sampledescription, OBJECT>
DEBUG: (object begin)
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object end)
INFO: Metadata:
INFO:   duration              1624.33
INFO:   moovPosition          36.00
INFO:   width                 640.00
INFO:   height                360.00
INFO:   videocodecid          avc1
INFO:   audiocodecid          mp4a
INFO:   avcprofile            77.00
INFO:   avclevel              31.00
INFO:   aacaot                2.00
INFO:   videoframerate        25.00
INFO:   audiosamplerate       44100.00
INFO:   audiochannels         2.00
INFO: trackinfo:
INFO:   length                974616.00
INFO:   timescale             600.00
INFO: sampledescription:
INFO:   sampletype            avc1
INFO:   length                71632858.00
INFO:   timescale             44100.00
INFO: sampledescription:
INFO:   sampletype            mp4a
INFO:   length                600.00
INFO:   timescale             600.00
INFO: sampledescription:
INFO:   length                600.00
INFO:   timescale             600.00
INFO: sampledescription:
131117.779 kB / 1622.16 sec (99.8%)
DEBUG: ignoring too small audio packet: size: 0
DEBUG: RTMP_ClientPacket, received: notify 102 bytes
DEBUG: (object begin)
DEBUG: (object begin)
DEBUG: Property: <Name:               code, STRING:
NetStream.Play.Complete>
DEBUG: Property: <Name:              level, STRING:	status>
DEBUG: Property: <Name:           duration, NUMBER:	161.00>
DEBUG: Property: <Name:              bytes, NUMBER:	134444129.00>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleCtrl, received ctrl. type: 1, len: 6
DEBUG: HandleCtrl, Stream EOF 1
DEBUG: RTMP_ClientPacket, received: invoke 232 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object begin)
DEBUG: Property: <Name:              level, STRING:	status>
DEBUG: Property: <Name:               code, STRING:	NetStream.Play.Stop>
DEBUG: Property: <Name:        description, STRING:	Stopped playing
flash/playback/_definst_/catalyst_13_15.mp4.>
DEBUG: Property: <Name:            details, STRING:
flash/playback/_definst_/catalyst_13_15.mp4>
DEBUG: Property: <Name:           clientid, STRING:	i1RINWlS>
DEBUG: Property: <Name:             reason, STRING:	>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onStatus>
DEBUG: HandleInvoke, onStatus: NetStream.Play.Stop
DEBUG: Invoking deleteStream
DEBUG: Got Play.Complete or Play.Stop from server. Assuming stream is
complete
131293.627 kB / 1624.33 sec (100.0%)
DEBUG: RTMP_Read returned: 0
Download complete
DEBUG: Closing connection.

* * * ** * * ** * * ** * * ** * * ** * * ** * * ** * * ** * * ** * * ** 
failing ffmpeg command

ffmpeg -report -i
"rtmp://cp53909.edgefcs.net:1935/mp4:flash/playback/_definst_/catalyst_13_15.mp4 app='ondemand?auth=daEbQaza1aTbSa7dZbXdTavcLa9dVcEdhdX-bqqFHH-8-lkq_uEwoJ&aifp=v001' playpath=mp4:flash/playback/_definst_/catalyst_13_15.mp4 swfUrl=http://www.abc.net.au/iview/images/iview.jpg swfVfy=1" /home/god/Videos/catalyst3.mp4


libavutil      51. 70.100 / 51. 70.100
  libavcodec     54. 54.100 / 54. 54.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 11.101 /  3. 11.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Parsing...
Parsed protocol: 0
Parsed host    : cp53909.edgefcs.net
Parsed app     : mp4:flash/playback
RTMP_Connect1, ... connected, handshaking
HandShake: Client type: 03
HandShake: Client digest offset: 430
HandShake: Initial client digest: 
f1 01 dc 10 3f 74 4c 08 93 bd b8 eb 05 d4 31 f7
90 f5 98 f6 03 d5 1b 86 18 ca 88 84 b0 b6 e0 2c
HandShake: Type Answer   : 03
HandShake: Server Uptime : 1014766743
HandShake: FMS Version   : 3.5.7.1
HandShake: Calculated digest key from secure key and server digest: 
13 60 f5 58 84 85 ec 1f a8 a0 53 71 26 69 d5 8b
c1 5d 50 67 7b 8a 0e 9f 7c 7c a7 70 91 1c 32 57
HandShake: Client signature calculated:
9c 48 ce 3b 6d 78 07 c9 56 a2 87 f0 d9 3b 96 35
f4 2e 5d 7a c1 fa c0 92 8c 7b 2a da 7e e5 9a fe
HandShake: Server sent signature:
da 57 70 71 63 d8 09 62 d1 17 6a 26 28 d0 39 8c
60 50 38 50 e8 28 4d 1a 24 13 eb 75 3e 1a af 2d
HandShake: Digest key: 
0e 18 1d b5 0b b1 ef 45 3c b3 e9 98 d2 8c 4f 54
9c 74 e7 a9 fa 63 a7 d2 2b b0 8e fc 5d 3d 16 b2
HandShake: Signature calculated:
da 57 70 71 63 d8 09 62 d1 17 6a 26 28 d0 39 8c
60 50 38 50 e8 28 4d 1a 24 13 eb 75 3e 1a af 2d
HandShake: Genuine Adobe Flash Media Server
HandShake: Handshaking finished....
RTMP_Connect1, handshaked
Invoking connect
RTMP_ClientPacket, received: invoke 134 bytes
(object begin)
Property: <Name:           no-name., STRING: _error>
Property: <Name:           no-name., NUMBER: 1.00>
Property: NULL
Property: <Name:           no-name., OBJECT>
(object begin)
Property: <Name:              level, STRING: error>
Property: <Name:               code, STRING:
NetConnection.Connect.Rejected>
Property: <Name:        description, STRING: [ AccessManager.Reject ] :
Access denied!>
(object end)
(object end)
HandleInvoke, server invoking <_error>
rtmp server sent error
RTMP_ClientPacket, received: invoke 18 bytes
(object begin)
Property: <Name:           no-name., STRING: close>
Property: <Name:           no-name., NUMBER: 0.00>
Property: NULL
(object end)
HandleInvoke, server invoking <close>
rtmp server requested close
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20120901/70e355a9/attachment.asc>


More information about the ffmpeg-user mailing list