saimj7 / People-Counting-in-Real-Time

People Counting in Real-Time with an IP camera.
MIT License
528 stars 263 forks source link

Stream over http MJPEG error #54

Closed lwaelti closed 1 year ago

lwaelti commented 1 year ago

Dear All I have an old phone with an app that streams the camera feed to the local network under the address http://192.168.1.174:8081/video I can see the feed via the browser but when I fill in this info in the config file, the program outputs the following error:

C:\Users\Administrator\Downloads\People-Counting-in-Real-Time>python run.py --prototxt mobilenet_ssd/MobileNetSSD_deploy.prototxt --model mobilenet_ssd/MobileNetSSD_deploy.caffemodel
[INFO] Starting the live stream..
[ERROR:0@0.815] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap.cpp (166) cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): http://192.168.1.174:8081/video in function 'cv::icvExtractPattern'

Traceback (most recent call last):
  File "C:\Users\Administrator\Downloads\People-Counting-in-Real-Time\run.py", line 353, in <module>
    run()
  File "C:\Users\Administrator\Downloads\People-Counting-in-Real-Time\run.py", line 100, in run
    frame = imutils.resize(frame, width = 500)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\imutils\convenience.py", line 69, in resize
    (h, w) = image.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'

Can anyone help me with this error?

lukeeey commented 1 year ago

I've also got this error

CapacitorDev commented 1 year ago

I've also got this error did you set the url = 0 in config.py ? https://github.com/saimj7/People-Counting-in-Real-Time/issues/27#issuecomment-893431259

lwaelti commented 1 year ago

Well you should only set the url = 0 in config.py if you use your webcam as the camera. If you use an actual IP Camera you need to put in the URL where the live video feed is accessible.

I've also got this error did you set the url = 0 in config.py ? https://github.com/saimj7/People-Counting-in-Real-Time/issues/27#issuecomment-893431259

CapacitorDev commented 1 year ago

yes, after setting up url = 0, its working.

saimj7 commented 1 year ago

@lwaelti Strange, this project works fine with 'IP Webcam' app and your url format also seems to be correct