Coder Social home page Coder Social logo

pi-camera-stream-flask's People

Contributors

ebenkouao avatar flipthedog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pi-camera-stream-flask's Issues

Flip not working ?

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

Instructions for headless operation

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.

Issue

No module named cv2. Open cv installed correctly

Items not supported any more

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

Port

How can i change the Port?

Use cron instead of editing /etc/profile

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

how to use camera options?

  1. I would like to use raspivid --roi (region of interest) option.
  2. the stream is to dark , is there a way to control the brightness?
    Thanks

AttributeError

File "/home/pi/Desktop/04_Flask_App/app/webcam.py", line 18, in del
self.vs.stop()
AttributeError: 'VideoCamera' object has no attribute 'vs'

Dependencies broken as of 2022

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

Stoping Flask Server

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

libqtgui4

E: package libqtgui4 is not available, but is referred to by another package.

I try everything but nothing

Please help me

its not working - what is wrong?

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.

No libjasper-dev on my raspberry pi os on a raspberry pi 3

I do not think the software should differ based on the model this much.... did you enable some extra repos?

`System Information

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

Videocore information

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 information

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

problems with sudo pip3 install opencv-contrib-python

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!

ImportError

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?

from .cv2 import * ImportError: numpy.core.multiarray failed to import >>>

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

Error: missing dependancies

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?

Testing the camera by a picture command issue

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.

Rpi stream images to PC for image recognition

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!

Not working anymore (september 2022)

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.

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.