

nd_header('Cache-Control', 'no-cache, private') nd_header('Content-Length', len(content)) # New frame, copy the existing buffer's content and notify allĬlass StreamingHandler(server.BaseHTTPRequestHandler): # Source code from the official PiCamera package You can find this script at the official PiCamera package documentation.Ĭreate a new file called rpi_camera_surveillance_system.py: :~ $ nano rpi_camera_surveillance_system.pyĬopy the following code to your newly created file: # Web streaming example The script for video streaming is shown below. Make sure the camera is connected in the right orientation with the ribbon blue letters facing up as shown in the next figure. With the Pi shutdown, connect the camera to the Pi CSI port as shown in the following figure. In my case, the RPi IP address is 192.168.1.112.Ĭonnecting the Raspberry Pi Camera Module is easy. You’ll be given a bunch of information, including your Raspberry Pi IP address. For that, use the following command: :~ $ ifconfig To access your video streaming web server, you need to know your Raspberry Pi IP address. You should see the Raspberry Pi software configuration tool. Or, in the Terminal window, type the following command: :~ $ sudo raspi-config In the Desktop environment, go to the Raspberry Pi Configuration window under the Preferences menu, open the Interfaces tab and enable the Camera as shown in figure below. If you’re using the Raspberry Pi Camera Module, you need to enable the camera software in your Raspberry Pi in order to use it.

