I tried to retrieve a stream where i constantly got ping messages in the process and it just stopped, so i looked for alternative ways.
The one i found was this huge script, which did crash on me: http://ubuntuforums.org/showthread.php?t=1159309
I was unwilling to search for the error or analyze the stream myself, so i came up with the following solution:
- capture stream with tcpdump
- extract streaming data with tcpflow
- pipe data through netcat
- connect rtmpdump to netcat
- ???
- profit!
sudo tcpdump -i ~device~ -p -s 0 -w ~dumpfile~ -v tcp src port 1935 tcpflow ~dumpfile~ # or use wireshrack like that http://www.youtube.com/watch?v=hNe70CbTlng cat ~streamfile~ |netcat -l 1935& rtmpdump -r "rtmp://localhost/streamer/stream.flv" -o
Works quite reliable for me and is not as much code as the script which does not work.
If you end up downloading huge masses of files you can check them using flvtool2 with this script:
#!/bin/sh if [ "$1" = "" ] then echo "no filename given" exit fi if [ $(stat -c%s "$1") -eq 0 ] then echo false exit fi if [ $(stat -c%s "$1") -eq `flvtool2 -P $1 /dev/null|grep filesize|sed 's/[^0-9]//g'` ] then echo true else echo false fi
It returns "true" or "false", depending if projected filesize and actual filesize are equal, which means an incomplete file returns "false".
source: http://my.opera.com/dduenker/blog/show.dml/21695332
Hello,
ОтветитьУдалитьI got "ERROR: RTMP_Connect0, failed to connect socket. 61 (Connection refused)", any idea?
Hi,
ОтветитьУдалитьIf you get this error on command
cat ~streamfile~ |netcat -l 1935&
rtmpdump -r "rtmp://localhost/streamer/stream.flv" -o
then check that you have "netcat" installed and that after you start "cat ~streamfile~ |netcat -l 1935&" port 1935 is open and listening, for example "netstat -tna"