ebenkouao / pi-camera-stream-flask Goto Github PK
View Code? Open in Web Editor NEWCreate your own live camera stream using a Raspberry Pi 4
License: MIT License
Create your own live camera stream using a Raspberry Pi 4
License: MIT License
How can i change the Port?
Hi,
Due to changes on how raspberry pi handles its cameras modules this project is broken at the moment.
I was wondering if there any plans to update it for versions Bullseye 11 , and if not I would appreciate if you could tell me what version you were using when this was still working.
I also included bellow the error message I got when I tried to run this code on Bullseye 11 in case anyone has been having the same issue.
If anyone also has a solution I would greatly appreciate it.
Traceback (most recent call last):
File "/home/pi/pi-camera-stream-flask/main.py", line 7, in
from camera import VideoCamera
File "/home/pi/pi-camera-stream-flask/camera.py", line 6, in
from imutils.video.pivideostream import PiVideoStream
File "/usr/local/lib/python3.9/dist-packages/imutils/video/pivideostream.py", line 2, in
from picamera.array import PiRGBArray
File "/usr/lib/python3/dist-packages/picamera/init.py", line 72, in
from picamera.exc import (
File "/usr/lib/python3/dist-packages/picamera/exc.py", line 41, in
import picamera.mmal as mmal
File "/usr/lib/python3/dist-packages/picamera/mmal.py", line 49, in
_lib = ct.CDLL('libmmal.so')
File "/usr/lib/python3.9/ctypes/init.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: libmmal.so: cannot open shared object file: No such file or directory
Hello,
Im following this project for an university project and as I said in the title, im having troubles with that instruction. It is stucked in "running setup.py bdist.wheel for opencv-contrib-python..." for more than an hour. I hope anyone can help me.
Thank you for your time!
I followed this project with a rPi 3B+ and rPi camera module - everything worked great! When I set it up to run headless, it looks like the process starts, grabs one frame, then freezes. I'm not savvy enough to debug the main.py or camera.py files and understand/identify any issues.
Is there a way you can stop the server with a button on the GUI to make sure the camera is turned off? I wanted to use this because when I default the pi bootup to run the main.py script i cant find how to turn off/kill the local server main.py script since I cant see the terminal that started it
Hi there, The "Download Beta image of Raspberry Pi Camera Stream" image returns a 404 error, Was this ever done?
https://github.com/EbenKouao/pi-camera-stream-flask/blob/master/img/readme/%5B%5D.png
Hello, does any one know how to fix the the capturing in my PC VNC viewer? both PC and Pi are connected via VNC Viewer. The VNC shows the the Pi screen my PC. However, once the camera is open and taking picture, this moment doesn't appear on my PC screen.
No module named cv2. Open cv installed correctly
I do not think the software should differ based on the model this much.... did you enable some extra repos?
Raspberry Pi 3 Model B Plus Rev 1.3
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
Raspberry Pi reference 2022-01-28
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, fbe448ccdc995d295d24c7596e5f0ef62cc2488f, stage4
Linux fancypi 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux
Revision : a020d3
Serial : 000000000129845f
Model : Raspberry Pi 3 Model B Plus Rev 1.3
Throttled flag : throttled=0x80008
Camera : supported=0 detected=0, libcamera interfaces=0
Mar 24 2022 13:20:54
Copyright (c) 2012 Broadcom
version e5a963efa66a1974127860b42e913d2374139ff5 (clean) (release) (start)
alloc failures: 0
compactions: 0
legacy block fails: 0
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 14622184 3385152 10586192 25% /
devtmpfs 332832 0 332832 0% /dev
tmpfs 465792 0 465792 0% /dev/shm
tmpfs 186320 912 185408 1% /run
tmpfs 5120 4 5116 1% /run/lock
/dev/mmcblk0p1 258095 30829 227267 12% /boot
log2ram 131072 18964 112108 15% /var/log
tmpfs 93156 28 93128 1% /run/user/1000
Filename Type Size Used Priority
/var/swap file 102396 17408 -2
`
And for me it says no:
Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package libjasper-dev
I'm trying to use the raspi minimal config to install. Everything seems to work until I try to run the main.py from your git. I get the following
root@raspberrypi:/opt# python3 ./pi-camera-stream-flask/main.py
Traceback (most recent call last):
File "./pi-camera-stream-flask/main.py", line 7, in
from camera import VideoCamera
File "/opt/pi-camera-stream-flask/camera.py", line 5, in
import cv2
File "/usr/local/lib/python3.7/dist-packages/cv2/init.py", line 5, in
from .cv2 import *
ImportError: libopenjp2.so.7: cannot open shared object file: No such file or directory
Do you know what dependencies it is looking for?
I am having issues with running this program because of the version of numpy. This project needs a requirements.txt file.
I think it's better to use cron to run main.py instead of doing so in /etc/profile. It looks like every time you log in more than once, it tries to run main.py and errors show up.
$sudo crontab -u root -e
@reboot python3 /home/pi/pi-camera-stream-flask/main.py
Hi! I chanced upon this project while looking for ways to link my rpi ( & pi camera) to send images continuously to my PC. The PC will then run image recognition and processing (yolov5) on it for my project.
However, most guides I came across shows the pi camera just streaming the feed to a website. Is it possible to send the images to a PC instead for processing? Is there a way I can edit your implementation for this use case? If not, are you able to provide any guidance or codes?
Thank you in advance and sorry for the trouble! Really cool project by the way!
OSError: libmmal.so: cannot open shared object file: No such file or directory
Hi. im trying to compiling the codes 'Main and Camera' and im getting the following errors:
Camera error:
Python 3.7.3 (/usr/bin/python3)
%Run camera.py
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
File "/home/pi/pi-camera-stream-flask/camera.py", line 5, in
import cv2
File "/usr/local/lib/python3.7/dist-packages/cv2/init.py", line 5, in
from .cv2 import *
ImportError: numpy.core.multiarray failed to import
Main error:
Python 3.7.3 (/usr/bin/python3)
%Run main.py
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
File "/home/pi/pi-camera-stream-flask/main.py", line 7, in
from camera import VideoCamera
File "/home/pi/pi-camera-stream-flask/camera.py", line 5, in
import cv2
File "/usr/local/lib/python3.7/dist-packages/cv2/init.py", line 5, in
from .cv2 import *
ImportError: numpy.core.multiarray failed to import
Any ideas Please?
How to save the video as an MP4 file at 1 hour intervals while establishing a video stream through flask?
this is a 3 year old project and looked like a good thing for the pi for a rookie to start with. however after following all steps and doing all install i got errors in 3 of 9 items.
sudo apt-get install libjasper-dev
sudo apt-get install libqtgui4
sudo apt-get install libqt4-test
is there any chance of a work around or even an update?..
I follow the instructions last night and there is no libqtgui4 and libqt4-test
And there is a version problem also with numpy.
So, at the end when you start with sudo python3 pi-camera-stream-flask/main.py there are some errors.
hi I try to stream with different wifi connection but the page is not opening kindly do let me know how to access with different wifi connections too
File "/home/pi/Desktop/04_Flask_App/app/webcam.py", line 18, in del
self.vs.stop()
AttributeError: 'VideoCamera' object has no attribute 'vs'
E: package libqtgui4 is not available, but is referred to by another package.
I try everything but nothing
Please help me
Hi, Thanks for your code,
My camera is up side down, I wanted to flip the image using the flip = True but nothing... I tried also to change the value in np.flip(frame,-1) , np.flip(frame,1) .... but nothing....
Any solution to help ?
thanks
mmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
mmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0x1937060 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled
Traceback (most recent call last):
File "/home/pi/pi-camera-stream-flask/main.py", line 12, in
pi_camera = VideoCamera(flip=False) # flip pi camera if upside down.
File "/home/pi/pi-camera-stream-flask/camera.py", line 13, in init
self.vs = PiVideoStream().start()
File "/usr/local/lib/python3.7/dist-packages/imutils/video/pivideostream.py", line 10, in init
self.camera = PiCamera()
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 433, in init
self._init_preview()
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 513, in _init_preview
self, self._camera.outputs[self.CAMERA_PREVIEW_PORT])
File "/usr/lib/python3/dist-packages/picamera/renderers.py", line 558, in init
self.renderer.inputs[0].connect(source).enable()
File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 2212, in enable
prefix="Failed to enable connection")
File "/usr/lib/python3/dist-packages/picamera/exc.py", line 184, in mmal_check
raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources
Exception ignored in: <function VideoCamera.del at 0xac399228>
Traceback (most recent call last):
File "/home/pi/pi-camera-stream-flask/camera.py", line 18, in del
self.vs.stop()
AttributeError: 'VideoCamera' object has no attribute 'vs'
Please help.
Hi Eben, thanks for the video on how to make a remote viewable camera with raspberry pi (Beginner project). However, I've been having issues running the main.py as it keeps giving me an error with regards to numpy. I've uninstalled and installed different versions of numpy to no avail. can you please help?. I get the same error when I run the code for camera.py. Below is the error I receive when I run the main.py code.
python 3.7.3 (/usr/bin/python3)
%Run camera.py
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
File "/home/pi/pi-camera-stream-flask/camera.py", line 5, in
import cv2
File "/usr/local/lib/python3.7/dist-packages/cv2/init.py", line 5, in
from .cv2 import *
ImportError: numpy.core.multiarray failed to import
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.