stream for linux,GitHub - ccrisan/streameye: A simple MJPEG streamer for Linux

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: | 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值