PDA

View Full Version : Help with rtmpdump


bearey
01-05-2015, 12:28 AM
I am trying to record a portion of the stream located here http://www.livestream.com/wilsonjj.

I was using a tutorial from askubuntu.com here (http://askubuntu.com/questions/262248/record-live-stream) as I am running ubuntu 14.04.

I installed rtmpdump from the ubuntu software center as the version compiled for ubuntu seems to be up to date (version 2.4).

rtmpsuck seems to work but it loops infinitely and will crash the terminal if I don't kill it quickly after it starts.

I redirected the rtmp traffic and used rtmpsuck to get the data below:
Processing connect
app: mogulus-edge/wilsonjj
flashVer: LNX 11,2,202,425
swfUrl: http://cdn.livestream.com/chromelessPlayer/v21/playerapi.swf?hideInfo=true&jsEnabled=false&showMoreVideos=false&hideChannelBranding=true&lschannel=true&allowchat=false&textLines=2&t=124446&browseMode=false&time=&mode=false&autoPlay=true
ERROR: RTMP_ReadPacket, failed to read RTMP packet header
Closing connection... done!

tcUrl: rtmp://xwilsonjjx.e.channel.livestream.com/mogulus-edge/wilsonjj
pageUrl: http://www.livestream.com/embed/wilsonjj?showMoreVideos=false&hideInfo=true&autoPlay=true&lschannel=true&browseMode=false&textLines=2&hideChannelBranding=true&mode=false&allowchat=false&layout=4&t=124446

I then tried rtmpdump with the following parameters:
rtmpdump -V -r "rtmp://xwilsonjjx.e.channel.livestream.com/mogulus-edge/wilsonjj" -a "mogulus-edge/wilsonjj" -f "LNX 11,2,202,425" -W "http://cdn.livestream.com/chromelessPlayer/v21/playerapi.swf?" -p "http://www.livestream.com/embed/wilsonjj?" -o ~./savedstreams/test.flv

Below is the output:
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
DEBUG: Parsing...
DEBUG: Parsed protocol: 0
DEBUG: Parsed host : xwilsonjjx.e.channel.livestream.com
DEBUG: Parsed app : mogulus-edge
DEBUG: Protocol : RTMP
DEBUG: Hostname : xwilsonjjx.e.channel.livestream.com
DEBUG: Port : 1935
DEBUG: Playpath : wilsonjj
DEBUG: tcUrl : rtmp://xwilsonjjx.e.channel.livestream.com:1935/mogulus-edge/wilsonjj
DEBUG: swfUrl : http://cdn.livestream.com/chromelessPlayer/v21/playerapi.swf?
DEBUG: pageUrl : http://www.livestream.com/embed/wilsonjj?
DEBUG: app : mogulus-edge/wilsonjj
DEBUG: flashVer : LNX 11,2,202,425
DEBUG: live : no
DEBUG: timeout : 30 sec
DEBUG: SWFSHA256:
DEBUG: 10 00 79 4e aa 2b 4e 55 52 54 a6 17 bd e6 ae ce
DEBUG: ac 78 85 39 a8 9a dd 15 5a ee a4 ea a1 16 a4 e7
DEBUG: SWFSize : 872168
DEBUG: Setting buffer time to: 36000000ms
Connecting ...
ERROR: RTMP_Connect0, failed to connect socket. 111 (Connection refused)
DEBUG: Closing connection.


I feel like I'm almost there, but I could use some pointers if anyone has any. Thanks.

peterpan
01-05-2015, 01:12 AM
1st Solution

Note that this code will only be valid for the current video/clip playing. You would have to sniff out the stream again for other videos or clips you'd like to record/download.

rtmpdump -r "rtmp://204.77.214.17/mogulus-stream-edge/wilsonjj" -a "mogulus-stream-edge/wilsonjj" -f "WIN 16,0,0,235" -W "http://cdn.livestream.com/chromelessPlayer/v21/playerapi.swf" -p "http://www.livestream.com/embed/wilsonjj?showMoreVideos=false&hideInfo=true&autoPlay=true&lschannel=true&browseMode=false&textLines=2&hideChannelBranding=true&mode=false&allowchat=false&layout=4&t=519283" -y "rtmp://212-94.livestream.com/affiliateStream/wilsonjj/6c69766572657065617465723a72746d703a2f2f3231322d39 342e6c69766573747265616d2e636f6d2f6d6f67756c75732f 77696c736f6e6a6a2f6c69766573747265616d" -o "2015-01-05_12-06-03_va07092.flv"




c:\>rtmpdump -r "rtmp://204.77.214.17/mogulus-stream-edge/wilsonjj" -a "mogulus-
stream-edge/wilsonjj" -f "WIN 16,0,0,235" -W "http://cdn.livestream.com/chromele
ssPlayer/v21/playerapi.swf" -p "http://www.livestream.com/embed/wilsonjj?showMor
eVideos=false&hideInfo=true&autoPlay=true&lschannel=true&browseMode=false&textLi
nes=2&hideChannelBranding=true&mode=false&allowchat=false&layout=4&t=519283" -y
"rtmp://212-94.livestream.com/affiliateStream/wilsonjj/6c69766572657065617465723
a72746d703a2f2f3231322d39342e6c69766573747265616d2 e636f6d2f6d6f67756c75732f77696
c736f6e6a6a2f6c69766573747265616d" -o "2015-01-05_12-06-03_va07092.flv"
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL


Connecting ...
INFO: Connected...
Starting download at: 0.000 kB
INFO: Metadata:
INFO: duration 0.00
INFO: fileSize 0.00
INFO: width 512.00
INFO: height 288.00
INFO: videocodecid avc1
INFO: videodatarate 436.00
INFO: framerate 25.00
INFO: audiocodecid mp4a
INFO: audiodatarate 64.00
INFO: audiosamplerate 44100.00
INFO: audiosamplesize 16.00
INFO: audiochannels 2.00
INFO: stereo TRUE
INFO: encoder Open Broadcaster Software v0.638b
INFO: lsChannelName wilsonjj
2019.104 kB / 42.54 sec
Caught signal: 2, cleaning up, just a second...
2023.015 kB / 42.58 sec
Download may be incomplete (downloaded about 0.00%), try resuming
Terminate batch job (Y/N)?

http://i.imgur.com/iV1LN4ll.png


2nd Solution --well not really coz the video you end-up with has some weird resolution :(

You can try using Livestreamer...

livestreamer --http-no-ssl-verify "http://www.livestream.com/wilsonjj" best -o JapClip.flv


Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

c:\livestreamer>livestreamer --http-no-ssl-verify "http://www.livestream.com/wilsonjj" best -o JapClip.flv
[cli][info] Found matching plugin oldlivestream for URL http://www.livestream.com/wilsonjj
[cli][info] Available streams: 0, 250k (worst, best)
[cli][info] Opening stream: 250k (hls)
Written 1390072 bytes

P.S. I'm sure some livestreamer experts on this forum can suggest additional commands/parameters to fix/adjust the resolution... ;)

Cheers!

bearey
01-05-2015, 05:19 PM
So, was there something I was doing wrong? I'm confused by why there would be a problem with my use of rtmpsuck where I get a infinite scrawl of text.

Thanks.

bearey
01-05-2015, 09:37 PM
So I tried the command as you indicated but it errored out. I've attached the code and output below, edited for ease of reading:
rtmpdump -r "rtmp://204.77.214.17/mogulus-stream-edge/wilsonjj"
-a "mogulus-stream-edge/wilsonjj"
-f "LNX 11,2,202,425"
-W "http://cdn.livestream.com/chromelessPlayer/v21/playerapi.swf"
-p "http://www.livestream.com/embed/wilsonjj?showMoreVideos=false&hideInfo=true&autoPlay=true&lschannel=true&
browseMode=false&textLines=2&hideChannelBranding=true&mode=false&allowchat=false&layout=4&t=519283"
-y "rtmp://212-94.livestream.com/affiliateStream/wilsonjj/6c69766572657065617465723a72746d703a2f2f3231322d39 342e6c69766573747265616d2e636f6d2f6d6f67756c75732f 77696c736f6e6a6a2f6c69766573747265616d"
-o "tst1.flv"
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
ERROR: RTMP_Connect0, failed to connect socket. 111 (Connection refused)

Any help is appreciated.