I don't know if it's the right forum to post this as it seems to fit in three different forums (multimedia, network, media).
Also, please note that English is not my first language. So if something is unclear, please let me know so i can rephrase it.
Anyway, this is a quick tutorial on how to mirror your windows desktop to the raspberry pi using nginx and Open broadcaster software. The latency and quality is dependent on your network and pc but i managed to get a 30@720p stream with audio and 700ms delay running on a 54mbit wifi network and a dual-core laptop so you can probably expect acceptable results.
Here's how it could look: http://youtu.be/jRK9Tmxjc9Y (Sorry for my crappy cam)
Things you need:
- windows machine (Network enabled)
raspberry pi (Network enabled)
monitor or tv connected to the raspberry pi
1. Download, compile and install nginx with the rtmp-module
Code: Select all
sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev
wget http://nginx.org/download/nginx-1.6.2.tar.gz
wget https://github.com/arut/nginx-rtmp-module/archive/master.zip
tar -zxvf nginx-1.6.2.tar.gz
unzip master.zip
cd nginx-1.6.2
./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-master
make
sudo make install
cd ..
rm -R nginx-1.6.2
rm -R rtmp-module-master
Open the nginx config file with:
Code: Select all
sudo nano /usr/local/nginx/conf/nginx.conf
Code: Select all
user pi;
Code: Select all
rtmp {
server {
listen 1935;
chunk_size 128;
application live {
live on;
exec_push omxplayer --live rtmp://localhost:1935/live/stream;
record off;
}
}
}
Code: Select all
sudo bash -c "echo 'sudo /usr/local/nginx/sbin/nginx' > /etc/init.d/nginx"; sudo chmod 775 /etc/init.d/nginx; sudo /usr/sbin/update-rc.d -f nginx defaults
1. Download Open broadcaster software
(For example here: https://obsproject.com/download)
2. Install it
(You know how that's done... next, next, next, i agree, next...

3. Configure it
Open OBS and go to settings -> broadcast settings
Select streaming service -> Custom
FMS URL -> rtmp://<IP-of-your-pi>:1935/live
Playpath /Stream key -> stream
(Play with the encoder settings until you get the results you want)
(For my configuration see the screenshots below)
4. Edit the scene to your liking
(I have mine set for full screen capture)
How to use
1. Start the nginx server
Code: Select all
sudo /usr/local/nginx/sbin/nginx
3. (Optional) You can stop the server with
Code: Select all
sudo /usr/local/nginx/sbin/nginx -s stop
Q: I have no audio / only audio via the analog out!
A: Add "-o hdmi" to the omxplayer line in the nginx config file.
Q: My audio is stuttering /randomly cutting of!
A: Remove "--live" from the omxplayer line in the nginx config file. (Note: This increases latency about 3 seconds)
Q: What's the song in the video?
A: Darude - Sandstorm. Just kidding, it's "Infinite Breeze" by BinaryCounter (me ^^) https://www.youtube.com/watch?v=fwlaB05PpwU
Examples / Screenshots
Latency test

My settings



Outro
I would appreciate any feedback possible. If you have any problems, just ask me.
Also i would welcome it if you could share your results in this thread.
(Warning: Shameless self promotion)
Oh and if it helped you please consider subscribing to my youtube channel "BinaryCounter" for self-made electronic music of all sorts. Thanks!