PDA

View Full Version : Trying to save ustream, sometimes the resulting file is empty


BoD
01-29-2013, 08:12 AM
Hi!

I have followed the instructions on this page:
http://www.tech-juice.org/2012/05/20/how-to-play-ustream-channels-in-vlc/
to find the rtmp address of some ustream channels, and save a few seconds in a file.

Sometimes it works with no problem.
But sometimes, it seems I receive no data, and the resulting file is empty.

Here is an example that works:

$ rtmpdump -v -r "rtmp://ustreamlivefs.fplive.net/ustream1live-live/stream_live_1_1_13027422" -W "http://www.ustream.tv/flash/viewer.swf" --live -o ~/tmp/test.flv --stop 4
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
ERROR: RTMP_HashSWF: couldn't contact swfurl http://www.ustream.tv/flash/viewer.swf (HTTP error 302)
Connecting ...
WARNING: HandShake: client signature does not match!
INFO: Connected...
Starting Live Stream
For duration: 4.000 sec
INFO: Metadata:
INFO: author
INFO: copyright
INFO: description
INFO: keywords
INFO: rating
INFO: title
INFO: presetname Custom
INFO: creationdate Mon Jan 28 14:22:36 2013
INFO: videodevice XSplitBroadcaster
INFO: framerate 30.00
INFO: width 1280.00
INFO: height 720.00
INFO: videocodecid avc1
INFO: avclevel 31.00
INFO: avcprofile 100.00
INFO: videodatarate 390.62
INFO: videokeyframe_frequency0.10
INFO: audiodevice VHAudioCustom
INFO: audiosamplerate 44100.00
INFO: audiochannels 1.00
INFO: audioinputvolume 100.00
INFO: audiocodecid mp4a
INFO: audiodatarate 93.75
INFO: bufferSize 1200k
INFO: maxBitrate 1200k
INFO: xsplitBroadcasterVersion1.3.0.85
INFO: xsplitCoreVersion 1.2.1301.1501 Version 1.2
INFO: xsplitGameSourceVersion1.1.1.26
INFO: xsplitMediaLibVersion 2.0.0.195
1061.349 kB / 2.95 sec
Download complete



Here is an example that does NOT work:


$ rtmpdump -v -r "rtmp://ustreamlivefs.fplive.net/ustream1live-live/stream_live_1_1_2298576" -W "http://www.ustream.tv/flash/viewer.swf" --live -o ~/tmp/test.flv --stop 4
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
ERROR: RTMP_HashSWF: couldn't contact swfurl http://www.ustream.tv/flash/viewer.swf (HTTP error 302)
Connecting ...
WARNING: HandShake: client signature does not match!
INFO: Connected...
Starting Live Stream
For duration: 4.000 sec
0.000 kB / 0.00 sec
Download complete


As you can see it downloaded 0 bytes.

Any idea what could be the problem?

Thanks a lot!

BoD
01-31-2013, 10:44 AM
No clue?

AmazingMatze
01-31-2013, 12:40 PM
ERROR: RTMP_HashSWF: couldn't contact swfurl http://www.ustream.tv/flash/viewer.swf (HTTP error 302)

What is the pageURL for the streams you cannot access?

chap
01-31-2013, 03:08 PM
No clue?
try
rtmpdump -v -r "rtmp://ustreamlivefs.fplive.net/ustream1live-live/stream_live_1_1_2298576" -W "http://static-cdn1.ustream.tv/swf/live/viewer.rsl:368.swf" -y "stream_live_1_1_2298576" -o "live.flv"

>rtmpdump -v -r "rtmp://ustreamlive
fs.fplive.net/ustream1live-live/stream_live_1_1_2298576" -W "http://static-cdn1.
ustream.tv/swf/live/viewer.rsl:368.swf" -y "stream_live_1_1_2298576" -o "live_1.
flv"
RTMPDump v2.4-80-g5b6f677
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting Live Stream
INFO: Metadata:
INFO: framerate 30.00
INFO: width 512.00
INFO: height 384.00
INFO: videocodecid avc1
INFO: videodatarate 500.00
INFO: videokeyframe_frequency120.00
INFO: audiocodecid mp4a
INFO: audiosamplerate 44100.00
INFO: audiochannels 2.00
INFO: audiodatarate 96.00
1511.473 kB / 15.90 sec
-

BoD
02-01-2013, 04:02 AM
Thanks a lot for your help!
I just tried your command, Chap, but it still does the same for me:


$ rtmpdump -v -r "rtmp://ustreamlivefs.fplive.net/ustream1live-live/stream_live_1_1_2298576" -W "http://static-cdn1.ustream.tv/swf/live/viewer.rsl:368.swf" -y "stream_live_1_1_2298576" -o ~/tmp/live.flv
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting Live Stream
0.000 kB / 0.00 sec
Download complete


It stays ~10 seconds after "Starting Live Stream" and then it stops with the rest of the message.

I realized there was a problem with the -W parameter, but I think it is not related to my issue since it works with other streams even with this warning.

I am wondering if maybe the stream is simply not available at times... Ustream indicates certain channels as "offline", but it is weird because the original page (http://www.ustream.tv/ffrc warning: video of cats :)) is NOT "offline" right now, and I can watch the video in the broswer, so it must be something else...

Thanks again for your help.

AmazingMatze
02-01-2013, 08:45 AM
This one should do the trick...
rtmpdump -r "rtmp://flash51.xo.tcdn.ustream.tv:1935/ustreamCdn/flash57/2298576" -a "ustreamCdn/flash57/2298576" -f "WIN 11,5,502,146" -W "http://static-cdn1.ustream.tv/swf/live/viewer.rsl:369.swf" -p "http://www.ustream.tv/ffrc" -y "streams/live_1" -o "some_cats_here.flv

Accidentally deleted my previous post here.

BoD
02-01-2013, 08:48 AM
Hey thanks for the reply. How did you get this url and parameters? I'm guessing using wireshark or something similar?

AmazingMatze
02-01-2013, 08:56 AM
I used to use Wireshark for tricky stuff. For this one I used RTMPDumpHelper & RTMPSuck. Enjoy your kitty cats! I'm a dog fan btw :)

BoD
02-01-2013, 09:05 AM
Ahah :) thanks man.
Actually I am looking for a "general" solution to the problem of grabbing a frame from any UStream channel. That's where the python script I mentioned comes in. But I guess I'll just have to accept that it doesn't always work (plus this script will inevitably break when UStream changes their html code...)