Raspberry Pi: camera video stream to host

While playing with the raspberry pi camera I found it hard to know if the camera was working or trying to tweak settings. I was using raspivid -f to preview the video. This was limited with being open for 5 seconds ( can be adjusted using the -t flag and passing it seconds in milliseconds ). The solution was to open a streaming video from the raspberry pi and view it on my host ( mac ).

On the mac install mplayer ( I used brew )

brew install mplayer

Then run netcat on port 2222 ( or whatever other port you would like )

nc -l 2222 | mplayer -fps 200 -demuxer h264es -

Now that the netcat stream is listening, let’s start broadcasting that stream on the py ( note the IP of the client and the port we selected )

/opt/vc/bin/raspivid -t 0 -w 300 -h 300 -hf -fps 20 -o - | nc <IP-OF-THE-CLIENT> 2222

If all was done correctly a video should pop up on your mac with your camera.

Streaming help source

Raspberry Pi camera help

Jon

Innovative, entrepreneurial and positively unsatisfied mind that constantly pushes the tech boundaries to create new solutions and devices that change people’s lives. Throughout my career, I have had the opportunity of having a multi-disciplinary experience, which led me to wear the hats of: Architect, IoT Consultant (Internet of Things Consultant), Developer, Designer, Engineer, Server Admin, Consultant and Project Manager – to name a few. Based on this diversified background, I get projects done by following smart ideas and well-planned goals. In a world which is getting more unconventional by the day, I use unconventional ways, and a very healthy dose of integrity, to create devices and solutions that help companies go from a steady present to a dynamic future.

You may also like...