In this little snippet / howto I’m going to show how I got a regular Logitech webcam streaming over the internet.
So let’s start with the problem:
I have a fishtank, I wanted to create a “fish cam” :)
Step 1 - Hardware
So I have a regular Logitech HD Webcam C910, and a standard Debian stretch sitting on a PC next to my fishtank.
Pretty straight forward so far, I do have contrib and non-free repos enabled
Step 2 - The streaming software
Motion - link
Here’s a wee quote from the website
Motion is a highly configurable program that monitors video signals from many types of cameras. Set it up to monitor your security cameras, watch birds, check in on your pet, create timelapse videos and more.
Wow, that’s what I want to do - check in on my pets :)
So let’s install it:
TADA !!!!
No let’s configure it.
I don’t want to keep images, I just want to stream, so the steps I need to do are:
- Create a conf directory in my home directory
- Create a config file in the created config directory
So let’s create a directory by doing
mkdir ~/.motion
No let’s create a config file by doing
vi ~/.motion/motion.conf
Note: probably don’t do this as user root
Let’s look at my config
Basically, the needed bits are stream_port 9091
, stream_localhost off
, and output_pictures off
.
This sets the tcp port you want to use, disables “localhost” only, and turns off saving images.
Run the server
Here’s the fun bit.
motion
That’s it, you have a streaming server up and running. You can view it by open a browser and going to http://your.ip.address:9091/
Wrapping up
So to get this all up and running (and public if you want that) you have to open a tcp port on your firewall.
I use Mikrotik, so here is what I do:
and of course you want to see it running, so here’s a link:
Fishcam (webcam streaming)
A wee note: I built a small php proxy script that looks like this:
1 Comment