I'm trying to set up a video conferencing system by using two Raspberry Pi boards.
How can I stream the H.264 protocol over a real-time streaming protocol via an Ethernet connection?
Which OS should I use to develop on the Raspberry Pi board?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
EDIT: This is not with RTSP but may help you
You can try with How to stream video and audio from a Raspberry Pi with no latency.
Install gstreamer1.0 on the Raspberry Pi video server:
sudo apt-get update
sudo apt-get install gstreamer1.0
In the Raspberry Pi with command:
raspivid -t 0 -w 1080 -h 720 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=VIDSERVERIP port=5000
On your PC, type the command:
gst-launch-1.0 -v tcpclientsrc host=VIDSERVERIP port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false
There is a custom source called nginx-rtmp - This works really well but you need to do quite allot of things before it works. It is awesome because it has allot of built in features and supports other streaming protocols, like HLS or embedding MPEG-DASH into websites, not just RTMP. It is extremely efficient in repackaging the video stream into flv or mp4.
The only serious prerequisite is ffmpeg needs to be compiled on Rasbpian (Do not use the repo one it is slow) from the newest fork. I think on Arch it has the correct ffmpeg. This takes 5 hours on the Pi. Try and find a compiled version or use qemo to cross compile.
But in a nutshell using nginx 1.4.1 (you can try newer if you need to)
cd /usr/scr #clone the latest version of rtmp module for nginx git clone git://github.com/arut/nginx-rtmp-module.git #download nginx source tested with- 1.4.1 but 1.5.0 is also supported wget http://nginx.org/download/nginx-1.4.1.tar.gz tar xzf nginx-1.4.1.tar.gz cd nginx-1.4.1
You need to get dependencies (check the link to the blog) for building and nginx. Then you configure the build inside the nginx source linking to the rtmp module. The build takes 10 minutes on the Pi.
./configure --prefix=/var/www \ --sbin-path=/usr/sbin/nginx \ --conf-path=/etc/nginx/nginx.conf \ --pid-path=/var/run/nginx.pid \ --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log/nginx/access.log \ --with-http_ssl_module \ --without-http_proxy_module \ --add-module=/usr/src/nginx-rtmp-module \
The latest version of Raspbian includes the UV4L driver that fixes the PSIPS (the time frame embedding for h264 that was broken in the original raspivid drivers.) So that should fix quite allot of streaming issues now.
Here's a recipe to get you started: Sending and receiving PI Camera video over the network