ccrisan / streameye Goto Github PK
View Code? Open in Web Editor NEWA simple MJPEG streamer for Linux
License: GNU General Public License v3.0
A simple MJPEG streamer for Linux
License: GNU General Public License v3.0
When trying out the first example in README.md, as follows:
while true; do
for file in *.jpg; do
cat $file
echo -n "--separator--"
sleep 0.5
done
done | streameye -s "--separator--"
my browser displays one image, but then nothing changes. In the command window I get:
2020-03-29 22:58:28: INFO : streamEye 0.9
2020-03-29 22:58:28: INFO : hello!
2020-03-29 22:58:28: INFO : listening on 0.0.0.0:8080
2020-03-29 22:58:31: INFO : new client connection from 192.168.1.12:59747
2020-03-29 22:58:32: INFO : new client connection from 192.168.1.12:59748
2020-03-29 22:58:42: ERROR: 192.168.1.12:59748: timeout reading from client
2020-03-29 22:58:42: ERROR: 192.168.1.12:59748: failed to read client request
I get the same results on both Raspbian Buster and a VM running Ubuntu 18.04 (x64). Any suggestions?
Do you have any advise for a systemd unit file to keep streameye running? I tried coming up with my own (systemd is on the long list of things I need to get good at :-/ ) the below but it always exits right after starting.
[Unit]
Description=Streameye MJPEG Service
[Service]
ExecStart=/usr/bin/ffmpeg -f video4linux2 -i /dev/video0 -r 30 -s 640x480 -f mjpeg -qscale 5 - 2>/dev/null | /usr/local/bin/streameye
#SuccessExitStatus=255
#Restart=always
#RestartSec=2
[Install]
WantedBy=multi-user.target
status output...
pi@raspberrypi:/lib/systemd/system $ sudo systemctl status -l streameye.service
_ streameye.service - Streameye MJPEG Service
Loaded: loaded (/lib/systemd/system/streameye.service; enabled)
Active: failed (Result: exit-code) since Tue 2017-05-02 16:30:23 UTC; 30s ago
Process: 26803 ExecStart=/usr/bin/ffmpeg -f video4linux2 -i /dev/video0 -r 30 -s 640x480 -f mjpeg -qscale 5 - 2>/dev/null | /usr/local/bin/streameye (code=exited, status=1/FAILURE)
Main PID: 26803 (code=exited, status=1/FAILURE)
May 02 16:30:22 raspberrypi ffmpeg[26803]: libswresample 2. 1.100 / 2. 1.100
May 02 16:30:22 raspberrypi ffmpeg[26803]: libpostproc 54. 0.100 / 54. 0.100
May 02 16:30:23 raspberrypi ffmpeg[26803]: Input #0, video4linux2,v4l2, from '/dev/video0':
May 02 16:30:23 raspberrypi ffmpeg[26803]: Duration: N/A, start: 10526.931131, bitrate: 147456 kb/s
May 02 16:30:23 raspberrypi ffmpeg[26803]: Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
May 02 16:30:23 raspberrypi ffmpeg[26803]: Please use -q:a or -q:v, -qscale is ambiguous
May 02 16:30:23 raspberrypi ffmpeg[26803]: [NULL @ 0x1305d0] Unable to find a suitable output format for '2>/dev/null'
May 02 16:30:23 raspberrypi ffmpeg[26803]: 2>/dev/null: Invalid argument
May 02 16:30:23 raspberrypi systemd[1]: streameye.service: main process exited, code=exited, status=1/FAILURE
May 02 16:30:23 raspberrypi systemd[1]: Unit streameye.service entered failed state.
reading that message would make me think that there is something up with the stderr redirect, but when I copy/paste of the line into my terminal, it works just fine. I also tried removing the redirect and using -loglevel panic
, which also works on the command line, but still fails when executed from systemd.
Great project BTW, super easy way for me to reuse "old" Pi1's that I had in my parts bucket :)
The methods write_response_ok_header() and write_response_auth_basic_header() both follow the following pattern:-
malloc() a buffer
sprintf() into the buffer
return write_to_client(buffer)
which leaks the allocated memory; They should do something like:-
malloc() a buffer
sprintf() into the buffer
rc = write_to_client(buffer)
free( buffer );
return rc;
Hi,
I want to get audio output in the stream along with audio. How do i enable / implement the same?
I have an old Raspberry PI 3 laying around and I thought i might mess with it. I have a FreeNas Server with a special share just for MotionEye. The share is not password protected so that shouldn't be a problem. I am just experimenting for a home camera system before I drop hundreds of dollars on raspi's and hard drives. There are no sub directorys. I have been searching and searching and can't find a solution. Thanks for any help!
Is it possible to add support for on-the-fly conversion & streaming MJPEG over HTTP to LAN from a H264 RTSP Onvif IP Cam? Or how it can be done using FFMpeg and StreamEye instead of using FFServer?
Hi,
when launching raspimjpeg.py
a TypeError is raised on my Raspberry Pi 2 Model B.
This may be a picamera issue.
OS: archlinuxarm
Python version: 3.6.0
picamera version: 1.10 (Tested with 1.13 as well, the issue persists)
INFO:root:raspimjpeg.py 0.8
INFO:root:hello!
DEBUG:root:initializing camera
DEBUG:root:using resolution 800x600
DEBUG:root:using framerate = 10
DEBUG:root:using vflip = false
DEBUG:root:using hflip = false
DEBUG:root:using rotation = 0
DEBUG:root:using brightness = 50
DEBUG:root:using contrast = 0
DEBUG:root:using saturation = 0
DEBUG:root:using sharpness = 0
DEBUG:root:using exposure compensation = 0
DEBUG:root:using video stabilization = false
DEBUG:root:using denoise = false
DEBUG:root:using image effect = none
DEBUG:root:camera initialized
DEBUG:root:starting capture
Traceback (most recent call last):
File "raspimjpeg.py", line 327, in <module>
run()
File "raspimjpeg.py", line 314, in run
use_video_port=not options.stills, thumbnail=None, quality=options.quality)
File "/usr/lib/python3.6/site-packages/picamera/camera.py", line 1680, in capture_sequence
if not encoder.wait(self.CAPTURE_TIMEOUT):
File "/usr/lib/python3.6/site-packages/picamera/encoders.py", line 853, in wait
raise self.exception
File "/usr/lib/python3.6/site-packages/picamera/encoders.py", line 693, in _callback
stop = self._callback_write(buf)
File "/usr/lib/python3.6/site-packages/picamera/encoders.py", line 1443, in _callback_write
super(PiOneImageEncoder, self)._callback_write(buf, key)
File "/usr/lib/python3.6/site-packages/picamera/encoders.py", line 731, in _callback_write
ct.string_at(buf[0].data, buf[0].length))
TypeError: write() argument must be str, not bytes
I've got this error by raspimjpeg:
Traceback (most recent call last):
File "./raspimjpeg.py", line 250, in
run()
File "./raspimjpeg.py", line 237, in run
use_video_port=not options.stills, thumbnail=None, quality=options.quality)
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 1668, in capture_sequence
encoder.wait()
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 853, in wait
raise self.exception
IOError: [Errno 32] Broken pipe
What can I do to solve this?
Hello,
I have successfully installed streameye on my pogoplug running archlinux arm.
However when I run the command:
ffmpeg -f video4linux2 -i /dev/video0 -r 30 -s 640x480 -f mjpeg -qscale 5 - 2>/dev/null | streameye
The video shown on the http://ip_address is terribly slow (maybe 1-2 frames per second) and has a massive delay (somewhere on the order of 1-2 minutes delay)
If I use ctrl+c to kill the process, the webcam becomes unusable and can only be seen/used if I reboot the pogoplug.
The main motivation for using streameye was to get better performance than motion, however, motion is somehow faster...about 5fps, and still not quite useable.
Can you please offer any advice? I cannot find any tips or other examples online.
Thanks!
Please add support for an extended URL path.
Ex: http://localaddress:port/webcam
How do I install streameye? The project page says nothing about it. I tried in Mint 17.3:
sudo pip install streameye
But it says:
Could not find any downloads that satisfy the requirement streameye
Can you add more detail install instructions to main project page? I previously install motioneye via pip and compiled motion-MrDave with all dependencies, but wanted to try streameye standalone.
The streamEye webserver should be able to serve a single JPEG frame (the most current one) at a certain URL (e.g. /snapshot), upon request.
i need the stream to have a .mjpeg ( or something ) extension.
For example, Motioneye need that if i want to use the stream as a mjpeg camera.
ignore please, this was supposed to be posted to gphoto :) not streameye!
I really hate to bother you but I am having trouble with streameye. I had it working for a while but all of sudden it stopped working and I do not know what I did to break it! I assumed that I had broken something so I went back and reloaded a fresh image of Stretch, then loaded streameye as per the instructions on this site.
pi@raspberrypi:~/streameye/extras $ raspimjpeg.py -d -w 640 -h 480 -r 15 | streameye -d
bash: raspimjpeg.py: command not found
2018-04-08 11:46:01: INFO : streamEye 0.8
2018-04-08 11:46:01: INFO : hello!
2018-04-08 11:46:01: DEBUG: installing signal handlers
2018-04-08 11:46:01: DEBUG: initializing thread synchronization
2018-04-08 11:46:01: DEBUG: starting server
2018-04-08 11:46:01: INFO : listening on 0.0.0.0:8080
2018-04-08 11:46:01: DEBUG: input: end of stream
2018-04-08 11:46:01: DEBUG: closing server
2018-04-08 11:46:01: DEBUG: waiting for clients to finish
2018-04-08 11:46:01: INFO : bye!
I have tested the Pi camera and it is working correctly.
What have I forgotten to do?
Thank you
David Cooper
Not sure if it's something important, though.
2018-11-23 08:45:03: INFO : bye!
Traceback (most recent call last):
File "/usr/local/bin/raspimjpeg.py", line 325, in <module>
run()
File "/usr/local/bin/raspimjpeg.py", line 312, in run
use_video_port=not options.stills, thumbnail=None, quality=options.quality)
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 1519, in capture_sequence
encoder.wait()
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 393, in wait
result = self.event.wait(timeout)
File "/usr/lib/python2.7/threading.py", line 614, in wait
self.__cond.wait(timeout)
File "/usr/lib/python2.7/threading.py", line 340, in wait
waiter.acquire()
KeyboardInterrupt
Upon cloning master and installing gcc and make, as per the readme, running make gives the following error message:
streameye.c:20:19: fatal error: stdio.h: No such file or directory
compilation terminated.
Makefile:13: recipe for target 'streameye.o' failed
make: *** [streameye.o] Error 1
I'm assuming that I'm missing a dependency?
I am running tinyCore, kernel 4.1.13-piCore+
Hi, is possible "push" multiple streams to differents paths, like rtmp server? I want to push to http://localhost:8080/camera1;http://localhost:8080/camera2; etc...one port, with multiple paths.
Thanks, great job.
There is often a need to capture MJPEG stream from a USB Cam or analog cam & USB capture tandem in one place by a small Linux running ARM device, and then forward this stream without re-encoding over LAN to a more powerful processing server for analysis, recording, sending notifications, etc. Can you add this feature to StreamEye?
Hi,
When using the following command
raspimjpeg.py -w 1920 -h 1080 -r 15 -q 20 | streameye
I am getting the following errors and it even loosing the connection, any idea what the cause of this is?
2016-10-30 23:07:36: INFO : new client connection from 192.168.1.30:38437
2016-10-30 23:07:36: ERROR: 192.168.1.30:38437: connection closed
2016-10-30 23:07:36: ERROR: 192.168.1.30:38437: failed to read client request
2016-10-30 23:07:36: INFO : new client connection from 192.168.1.30:55639
2016-10-30 23:07:43: ERROR: 192.168.1.14:43488: not all data could be written
2016-10-30 23:07:43: ERROR: 192.168.1.14:43488: failed to write jpeg data
packet_write_wait: Connection to 192.168.1.25 port 22: Broken pipe
First: With streameye i get the fastest video stream with my rpi zero w - top!
Can i edit the 'html-streaming-page' to display another image
(generated from sensor readings) or from a textfile?
Alternative: Is it possible with an image overlay?
Sorry - i am a beginner in this section -
Hi,
I'm testing a stripped back version of Motioneyeos by using the streameye package, which is the Fast Network Camera as you described in https://github.com/ccrisan/motioneyeos/wiki/Fast-Network-Camera.
Via HDMI streameye is instant. But over Wifi there's a 2 second delay.
When using MotioneyeOs in Fast Network Camera mode the wifi is almost instant.
I've taken the exact settings from MotioneyeOs and used in this command, so it seems something else is amiss. What else is Motioneyeos doing...or streameye NOT doing?
--- MOTIONEYEOS Settings ---
Layout Columns
3
Fit Frames Vertically
On
Layout Rows
1
Frame Rate Dimmer
100
Resolution Dimmer
100
Network Link Watch
ON
Network Link Timeout
20 seconds
Connectivity Watch
OFF
GPU Memory
128
Camera Name
Camera1
Camera ID
1
Camera Type
Simple MJPEG Camera
Brightness
50%
Contrast
50%
Saturation
50%
Sharpness
50%
MJPEG Video Resolution
640x480
Video Rotation
0o
Flip Vertically
OFF
Flip Horizontally
OFF
Frame Rate
15
Image Quality
25
Bitrate
100000 bps
Zoom X
0%
Zoom Y
0%
Zoom Width
100%
Zoom Height
100%
HDMI Preview
OFF
ISO
400
Shutter Speed
0 microseconds
Exposure Mode
Auto
Exposure Compensation
0
Automatic White Balance
Auto
Metering Mode
Average
Dynamic Range Compensation
Off
Video Stabilization
OFF
Denoise
OFF
Image Effect
None
Streaming Protocol
MJPEG
Streaming Port
8081
Authentication Mode
Disabled
--- StreamEye Settings ---
./raspimjpeg.py --brightness 50 --contrast 50 --saturation 50 --sharpness 50 --width 640 --height 480 --rotation 0 --vflip --hflip --framerate 15 --quality 25 --zoom 0.0,0.0,1.0,1.0 --preview --iso 400 --shutter 0 --exposure auto --ev 0 --awb auto --metering average --drc off --vstab --denoise --imxfx none | streameye -p 8081
Hey !
Is it possible to transfer an audio stream along with the video?
If I read the code correctly, shouldn't it be:
line 94:
type=int, dest='contrast', default=0)
line 126:
type=str, dest='imxfx', default=None,
The raspimjpeg.py script uses the picamera library to capture frames. Would it be possible to implement OpenCV to process the JPEG frames and send them to the Streameye server?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.