Last week I was trying to make my raspberry stream RTMP. This protocol was created by Macomedia to
real time data transfer over the Internet.
The streams I was trying to play were FLV, in other words H.263 witch I soon realize that could be a problem with omxplayer.
1) I started by compiling ffmpeg:
apt-get source ffmpeg-dmo
sudo make install
2) Put mplayer working by compiling and disabling mencoder:
./configure --target=arm-linux --disable-mencoder
sudo make install
3) Compile and install rtmpdump to download streams...
git clone git://git.ffmpeg.org/rtmpdump
sudo checkinstall --pkgname=rtmpdump --pkgversion="2:$(date +%Y%m%d%H%M)-git" --backup=no
--deldoc=yes --fstrans=no --default
ln -s /usr/local/lib/librtmp.so.0 /usr/lib/arm-linux-gnueabihf/librtmp.so.0
The fun part comes next. To get the stream I can make:
rtmpdump -v -r rtmp://h2j2.rtp.pt/livetv -W http://www.rtp.pt/play/player.swf -p http://www.rtp.pt/services/rtpplay/pub/config_page/rtp.pt/play/direto/tv/rtp1 --playpath "2ch5h264" -R --live -b 20000 -V stream.flv
This saves the realtime stream into a file. Nice if you want to make a recorder!
I need now to convert the FLV into AVI to be able to player in omxplayer.
# lets create a named pipe
rtmpdump -v -r rtmp://h2j2.rtp.pt/livetv -W http://www.rtp.pt/play/player.swf -p http://www.rtp.pt/services/rtpplay/pub/config_page/rtp.pt/play/direto/tv/2ch5h264 --playpath "2ch5h264" -b 20000 | ffmpeg -i pipe:0 -y -loglevel debug -b:v 400k -stats stream.avi;
After this I notice that I could only get 4fps! dammit.... this means that raspberry is not capable of downloading and transcoding the stream....
Even so, if you want to try to play (while running rtmpdump command):
A possible workaround is use another machine to transcode and serve the stream to raspberry, minimizing his work....
Maybe serve it with VLC...Maybe next time.