1. Gstreamer 1.2 with nginx rtmp module
Result: Good for FPV
Quality: 720p@15fps, bitrate 1000000
CPU usage %: 17 - 22
CPU usage %: 17 - 22
Notes: Compiling Gstreamer with plugins and nginx with rtsp module will take over 8 hours. I overclocked my RPi with "Medium 900MHz ARM, 250MHz core, 450MHz SDRAM, 2 overvolt" -setting to shave some time off. I'm not sure it helped a lot...
I used these blogs, forums, guides, examples:
1.1. Compile and install Gstreamer 1.2 and gst-rpicamsrc
I used this as a guide: http://www.onepitwopi.com/raspberry-pi/gstreamer-1-2-on-the-raspberry-pi/
The gstremer.sh file provided gave some errors, so I used all the commands manually. also added gst-rpicamsrc compile and install. Removed libschroedinger-dev from install, since it fails. Ran all ./autogen.sh and make commands with sudo. Without sudo, some give permission errors.
Commands used: http://pastebin.com/S1zGK9kP
remember to add this to your .profile:
1.2 Compile and install nginx and rtmp-module
I used this guide with some modifications: http://pkula.blogspot.co.uk/2013/06/live-video-stream-from-raspberry-pi.html.
I used /home/pi/www instead of /var/www and cleaned conf file
Commands used: http://pastebin.com/gpBKrUt2
and my /etc/nginx/nginx.conf -file: http://pastebin.com/nRFp3gjR
Reboot raspberry pi and then start nginx:
sudo service nginx start
First I din't have gst-rpicamsrc installed and tried to pipe raspivid to gstreamers fdsrc like this:
raspivid -t 0 -w 640 -h 480 -b 1000000 -fps 25 -o - | gst-launch-1.0 fdsrc ! h264parse config-interval=2 ! video/x-h264, framerate=25 ! flvmux ! rtmpsink location='rtmp://127.0.0.1/rtmp/live live=1' THIS CODE DOES NOT WORK
That did not work and it caused a weird harware lock in the gpu or cameramodule. I had to wait some time to get raspivid working again.
Luckily gst-rpicamsrc fixed this issue and here is the working command:
gst-launch-1.0 rpicamsrc bitrate=1000000 ! video/x-h264,width=1280,height=720,framerate=15/1,profile=high ! h264parse ! flvmux ! rtmpsink location='rtmp://localhost/rtmp/live live=1'
Now you can access the stream with VLC from your computer. Note that VLC will add couple of seconds of lag because of buffering. I'm planning to use android to watch the live stream from my quad, so I tried to open the stream on MXPlayer for Android. I found that you can bypass the buffering by opening the rtmp stream on MXPlayer, then shutting it on the raspberry pi and after 5 seconds start the streaming again from the rpi. The bitrate parameter (currently 1000000 = 1mb) can be set to 4mb or 5mb without affecting cpu usage. Atleast with LAN connection this is ok.
My intention was to research different streaming methods, but the first one turned out to be so good, I didn't bother to continue.