RTMP Server

Setup an RTMP Server (in H264 full res, 30fps) with crtmpserver and FFMpeg

Get a recent version of FFMpeg from http://www.ffmpeg.org/, compile the sources and install the binaries on your RaspberryPi.

Install crtmpserver on the Streaming Server machine and rtmpdump on the client. The server host can be your RaspberryPi itself or a different machine:

server ~ $ sudo apt-get install crtmpserver

Add the crtmpserver log directory:

server ~ $ sudo mkdir /var/log/crtmpserver

Find and change these values in /etc/crtmpserver/applications/flvplayback.lua:

validateHandshake=false,
keyframeSeek=false,
seekGranularity=0.1
clientSideBuffer=30

Restart crtmpserver:

server ~ $ sudo /etc/init.d/crtmpserver restart

Now load the raspicam driver with a real-time priority, set the preferred resolution in H264 and run ffmpeg:

raspberrypi ~ $ sudo uv4l --sched-rr --driver raspicam --auto-video_nr
raspberrypi ~ $ v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=H264 -d /dev/video0
raspberrypi ~ $ dd if=/dev/video0 bs=512K | ./ffmpeg_20130804/bin/ffmpeg -i - -vcodec copy -an -f flv -metadata streamName=myStream tcp://server:6666

Now you can dump the RTMP video on the client and see it:

mypc ~ $ rtmpdump -r "rtmp://server/flvplayback/myStream" --live -o foo.flv
mypc ~ $ vlc foo.flv

Or directly:

mypc ~ $ vlc "rtmp://server/flvplayback/myStream live=1"