Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Streaming Videos using Webcam- (Part 10/12)

By Prabakaran P.M October 26, 2020

This article is to provide step by step instructions for making Raspberry Pi as a webcam server where we can live stream video over a local network using python scripts and some required packages. A software package used in this tutorial is Motion which is an open source software with a number of configuration options which can be changed according to our needs. Here configurations are to be made so that it allows you to create a remote webcam for your Raspberry Pi so that you can view it from any computer on the local network.


 

Prerequisites & Equipment:

You are going to need the following:

  1. A Raspberry Pi Model B or greater.

  2. A USB WiFi Adapter (Edimax – Wireless 802.11b/g/n nano USB adapter is used here).

  3. A USB webcam with microphone / USB microphone (Logitech USB Webcam is used here).

  4. An SD Card flashed with the Raspbian OS (Here is a guide if you need)

  5. Access to the Raspberry either via a keyboard and a monitor or remotely.

Make sure you’re up-to-date:

To check for update and to install them enter the following command:

sudo apt-get update

Step 1: Installing the Motion.

Now, We need to install Motion package using the command line, Following Command can be used

sudo apt-get install motion

Installation of Motion Package for Raspberry Pi

Fig. 2: Installation Of Motion Package For Raspberry Pi

This will take a few minutes to download and install. Just type “y” to proceed with the installation since some supporting packages will be installed during the installation process.

Note: If you are going to use Raspberry Pi camera module, since current version of motion does not yet support the Raspberry Pi camera module, we need to download and install a special build with support for this camera module by using these commands.

cd /tmp

sudo apt-get install -y libjpeg62 libjpeg62-dev libavformat53 libavformat-dev libavcodec53 libavcodec-dev libavutil51 libavutil-dev libc6-dev zlib1g-dev libmysqlclient18 libmysqlclient-dev libpq5 libpq-dev

Step 2: Configure the software.

After installation of the package next step is to edit some of the config files so that the motion service will start to run up and be available on the local network.

First thing we have to edit is the motion.conf file. Type the below command

sudo nano /etc/motion/motion.conf

This is quite a large conf file but the points you need to edit are:

Configuring Motion Software for Raspberry Pi

Fig. 3: Configuring Motion Software For Raspberry Pi

DAEMON = OFF (change to ON)

Editing Motion Configuration File

Fig. 4: Editing Motion Configuration File

Webcam_localhost = ON (Change to OFF)

Next we need to enable the Daemon (service):

sudo nano /etc/default/motion

Command to enable Daemon Service for Raspberry Pi

Fig. 5: Command To Enable Daemon Service For Raspberry Pi

start_motion_daemon = no (change to yes)

Step 3: Start the webcam server.

 Start the Webcam Server for Raspberry Pi

Fig. 6: Start The Webcam Server For Raspberry Pi

Ensure your webcam is plugged into the USB port on your Raspberry Pi and start the service:

sudo service motion start

If you want to stop the service, then use the command:

sudo service motion stop

To restart the service, then use the command:

sudo service motion restart

With the service started you can now open a web page on your normal computer and by going to the IP of the Raspberry Pi on port 8081 (in the address bar) you should be able to view your webcam.

You may also like:


  • What are the top development boards for AI and ML?

  • What is the role of embedded software in electric vehicles?

  • What are the top open-source software systems for home automation?

  • Insight: A look inside the components of a webcam

  • How Is Internet Of Things Transforming The World Of Retail?

  • What is USB 3.0?

Filed Under: Electronic Projects, Raspberry pi

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Voltage mode pushpull is a nonsense SMPS?
  • Input impedance matching network
  • High Side current sensing
  • The comparison of different Tcl script checkers
  • Reducing "shoot-through" in offline Full Bridge SMPS?

RSS Electro-Tech-Online.com Discussions

  • Is AI making embedded software developers more productive?
  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe