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

streamEye是一个用于Linux的简单MJPEG流服务器,能够同时为多个客户端提供服务。它接受输入的JPEG帧,并以MJPEG流的形式发送给所有连接的客户端。你可以通过指定或自动检测分隔符来处理JPEG帧。文章提供了安装、使用示例以及与其他工具如ffmpeg的结合使用方法。
摘要由CSDN通过智能技术生成

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值