Code Monkey home page Code Monkey logo

streameye's Introduction

streamEye

streamEye is a simple MJPEG streamer for Linux. It acts as an HTTP server and is capable of serving multiple simultaneous clients.

It will feed the JPEGs read at input to all connected clients, in a MJPEG stream. The JPEG frames at input may be delimited by a given separator. In the absence of a separator, streamEye will autodetect all JPEG frames.

Installation

streamEye was tested on various Linux machines, but may work just fine on other platforms. Assuming your machine has git, gcc and make installed, just type the following commands to compile and install:

git clone https://github.com/ccrisan/streameye.git
cd streameye
make
sudo make install

Usage

Usage: <jpeg stream> | streameye [options] Available options:

  • -d - debug mode, increased log verbosity
  • -h - print this help text
  • -l - listen only on localhost interface
  • -p port - tcp port to listen on (defaults to 8080)
  • -q - quiet mode, log only errors
  • -s separator - a separator between jpeg frames received at input (will autodetect jpeg frame starts by default)
  • -t timeout - client read timeout, in seconds (defaults to 10)

Examples

The following shell script will serve the JPEG files in the current directory, in a loop, with 2 frames per second:

while true; do
    for file in *.jpg; do
        cat $file
        echo -n "--separator--"
        sleep 0.5
    done
done | streameye -s "--separator--"

The following command will stream your camera (assuming it's at /dev/video0), with 30 frames per second at 640x480:

ffmpeg -f video4linux2 -i /dev/video0 -r 30 -s 640x480 -f mjpeg -qscale 5 - 2>/dev/null | streameye

Extras

raspimjpeg.py

This script continuously captures JPEGs from a Raspberry PI's CSI camera and writes them to standard output. It works out-of-the-box on Raspbian. The following command will make a simple MJPEG streamer out of your Raspberry PI:

raspimjpeg.py -w 640 -h 480 -r 15 | streameye

Why not raspivid or raspistill? Well, at the time of writing raspivid doesn't output JPEGs and raspistill only works in stills mode.

Why Python and not C? Because most of the stuff is done by the GPU, so the insignificant performance gain would not make it worth writing C code. And of course because picamera is an amazing library.

streameye's People

Contributors

ccrisan avatar chemingway avatar doughadfield avatar irichter avatar aalaesar avatar gulinux avatar popoviciri 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.