Introduction: Streaming Video Over a Network
This is my first instructable, So please bear with me.
There are lot of ways to get video over a network such as pre-built software, the catch with using pre-built software is that you are limited to what you can do with the software, So in this tutorial we will be building a video streaming program with python and a webcam.
Step 1: Step 1: Materials
In this section we are going to go over the parts needed to build our program. Since this tutorial was tested on a linux Machine (Xubuntu), I will assume that a linux machine is been used, it might work on a windows or mac machine.
- Linux Computer
Python is the programming Language that we will be using because of it small development time and its easy to learn for people just starting to head into the programming field. OpenCV is a open source computer vision library. In this tutorial we wouldn't be doing any image processing, we will just be using opencv to capture images from our webcam, numpy is a library that is needed for but OpenCV and we will also use it to help us manipulate our image a bit to make it ready for transport.
Step 2: Step 2: Software Installations
Now we going to installed the softwares that we will need for our streaming app. Lets start with python.
Most linux comes install with python but in case u don't have python install, open a terminal and type
sudo apt-get install python python-dev sudo pip install numpy
The are lot of ways to install opencv, So google will be your friend here. Just make sure u install opencv 2 and not opencv 3.
The next step is to download Cam_Streamer from Github. This is the link Cam Streamer. Cam Streamer is a python script that is use to streamer video from a webcam over a LAN. After downloading the Cam_Streamer from github navigate into the folder and start the server.py program.
open a terminate and type
It will ask your for your IP address and the port number you want to use. If no input where given it will use 'localhost' as the IP address and use port 5000.
Now start the client program on the computer you want to stream your video from. Move the client program on that computer and open a terminal and type
It will ask you for the IP address and port number on which the server program is been run. If no input is given it will assume that the IP address is 'localhost' and that port is 5000.
If you want to close the program click on the image and then press the letter 'q'. That will close the client program and also close the alert the server to shutdown.
This is just a bear minimum streaming program. You can use it as a stepping stone to create your own programs.
Things I will like to add later is threading and an authentication function. You can also add encryption. If anyone wants does features lemme know and I will see what I can do.