2. Who am I?
• Name : Jon Ho
• Occupation : Simcard OneXOX seller
– Buy my prepaid card and top up RM 50, and you
get 2 years validity, FOR FREEEEEEE!
• Part Time : Freelancer/Maker
• Some Time : Busker/Farmer/Fisherman
4. RECIPE
• Hardware
– 1 Command & Control Windows PC
– Nth number of client Pi Camera
• Software
– Raspbian Jessie on Raspberry Pi
– Raspivid
www.raspberrypi.org/documentation/raspbian/applications/camera.md
– Zenmap, Mplayer on Windows PC
5. Linux Streaming
• VLC
– Slowest
– Easiest to set up
• Gstreamer
– So-so speed
– Complex to set up
• Netcat
– Fastest!
– No setup needed! Runs out of the box!
9. What you need (cont)
• 3: PC/Laptop Windows with zenmap/ncat (for
network streaming stuff) and mplayer (for
video stuff) installed
– Both are opensource and freeeeee
10. Step 1: setup the C&C
• First, find out your C&C PC’s ip
– Open a terminal in windows and run ipconfig
– Remember the ip, this is what your raspi will
connect to
11. Step 1: setup the C&C (Cont)
• Second, in the same terminal, run ncat to pipe
the stream to mplayer
– C:Usersjon>ncat -l -p 2222 | "C:Program Files (x86)MPlayer for
Windowsmplayer.exe" -fps 200 -demuxer h264es –
– The -demuxer h264es arguments decode the stream into mpeg 4
12. Step 2: setup the pi camera
• Setup Camera
– There are tons of tutorials of how to setup pi camera, so I will not
cover that. Just make sure it looks something like below.
– Also if possible, try to get an enclosure for the raspi camera. You don’t
want it to die every time somebody sneezes at it
13. Step 2: setup the pi camera (cont)
• Test Camera by running this command in the
terminal
– raspivid -o heuheuheu.h264 -t 10000
– omxplayer heuheuheu.h264
14. Step 3: profit!
• Now put it all together by running this command
on the raspi camera
– raspivid -t 0 -w 1280 -h 720 -hf -ih -fps 20 -o - | nc 192.168.1.4 -k -l -p
2222
The –t 0 argument means raspivid will basically run forever
streamed on port 2222
16. Bonus Points
• SOUND
– The demo had no sound, due to lack of usb mic. It
can stream sound. Try it out as homework.
• NETWORK SPEED
– For best live action speed, use a wireless router
that can transmit on the 5GHz band. 2000++
Mbps means no lag whatsoever!
17. Bonus Points (cont)
• MULTIPLEXING CAMERA
– It is possible to multiplex the camera, although
stability issue may arise.
18. To learn more
• Raspivid
– www.raspberrypi.org/documentation/raspbian/ap
plications/camera.md
• Netcat
– www.binarytides.com/netcat-tutorial-for-
beginners/
19. DONATE
• If you think this is cool beans and would like to send free money
so I don’t starve to death and keep making stuff like this, send it
here:
BITCOIN
1GhVoWnYq21mDEC6nSn2WZkuoPMAAarJrk
LITECOIN
LS1N3L34feg7GwwLWmcTqsmzfoUtzSMME6