Giter VIP home page Giter VIP logo

ovencam_mjpg_streamer's Introduction

ovencam_mjpg_streamer

The idea behind "ovencam" is to use the Raspberry Pi Zero (v1.3) together with a "camera module" and the "ZeroView" holder to provide a MJPG-Streaming Web application.

Table of Contents

Installation

First of all install the prerequisites:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install g++ curl pkg-config libv4l-dev libjpeg-dev build-essential libssl-dev cmake git-core build-essential libjpeg8-dev imagemagick subversion
$ sudo apt-get autoremove
$ sudo shutdown -r now

Then we can install motion-jpeg (mjpeg):

 $ cd /usr/src
 $ sudo mkdir mjpg-streamer
 $ sudo chown pi:users mjpg-streamer
 $ cd mjpg-streamer
 $ git clone //github.com/jacksonliam/mjpg-streamer.git .
 $ cd mjpg-streamer-experimental
 $ make
 $ sudo make install

After the compilation, shutdown the pi and attach the camera:

 $ cd /usr/src/mjpg-streamer/mjpg-streamer-experimental/
 $ export LD_LIBRARY_PATH=.
 $ ./mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so -x 640 -y 480 -fps 20 -ex night"

My RPi has the following IP address: 192.168.20.83 so you can see the camera at http://192.168.20.83:8080/stream.html

Configuration

⚠️ Warning: keep in mind the following points:

  • NodeJS Web server port: 8080
  • MJPG-Streamer server port: 8081
  • The project is intended to be installed inside "/home/pi" path.

If you want or have to customize the path of the project, the following files must be edited:

  • server.js Line #34:
var path_ovencam = "/home/pi/oven_cam"
  • mjpg-streamer/
  • camera_stop.sh:
echo -n 0 > "/home/odamae/odamaeweb_mjpg-streamer/public/resources/estado_mjpgstreamer.txt"
  • camera_start.sh:
echo -n 1 > "/home/odamae/odamaeweb_mjpg-streamer/public/resources/estado_mjpgstreamer.txt"
./mjpg_streamer -o "output_http.so -w /home/odamae/odamaeweb_mjpg-streamer/mjpg-streamer/www -p 8081 -c <user>:<passwd>" -i "input_raspicam.so -rot 270 -fps 25 -q 50 -x 320 -y 240 ex nig$
  • public/resources/ Just configure the following configuration file:
  • project_path_config.php
<?php
$ovencam_path = '/home/pi/oven_cam';
?>

Additionaly, check that the following lines of "/public/index.html" contains the proper IP address (and MJPG-Streamer PORT):

<div id="arriba">
    <object data="http://192.168.20.83:8081/?action=stream" width="320" height="240">
        <embed src="http://192.168.20.83:8081/?action=stream" width="320" height="240"> </embed>
               Error: No se ha podido cargar el vídeo.
    </object>
</div>

Usage

To be sure that the application is running continously, we will use "Forever" NodeJS module:

$ [sudo] npm install forever -g

⚠️ Note: If you want to use "forever" programmatically you should install forever-monitor.

  $ cd /path/to/your/project
  $ [sudo] npm install forever-monitor

Once "forever" is installed we launch the application:

 $ cd <project_path>
 $ forever start nserver.js

🔧 Troubleshooting:

The "forever" binary file location: /opt/nodejs/bin/forever In order to be globally available the following "EXPORT" line has to be added in ".bashrc":

$ nano /root/.bashrc
	
    export PATH=$PATH:/opt/nodejs/bin

$ exec bash

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

References

The following is a list of useful references used for the development of the application:

ovencam_mjpg_streamer's People

Contributors

etxahun avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.