.exe file fails to read a VideoStream from a camera connected via rtsp?

asked 2018-11-15 19:29:53 -0500

voo_doo gravatar image

I have a little project that should read VideosStream from rtsp camera to do some other tasks. I could run its original hc_yolo_all.py file without any issue. However, after making an executable file with pyinstaller --onefile hc_yolo_all.py, it couldn't derive VideoStream and gave the error

 Traceback (most recent call last):
  File "hc_yolo_all.py", line 60, in <module>
cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

[7340] Failed to execute script hc_yolo_all.

It is seen that frame = cv2.resize(frame, (416,416)), line 60, of hc_yolo_all.py is receiving an empty frame and therefore, output an error.

Where do you think the issue lies in?

I, to be honest, don't know whether it is related to opencv or rtsp or pyinstaller, so I've tagged those three.

edit retag flag offensive close merge delete


i've never seen anyone using pyinstaller successful here.

to use an ip stream, you would need opencv_ffmpeg_64.dll, too.

(from the docs, it seems, you need to add it with --add-binary )

berak gravatar imageberak ( 2018-11-16 00:24:16 -0500 )edit

how did you install cv2 in the 1st place ? is it a "static build" (what size is it) ?

berak gravatar imageberak ( 2018-11-16 01:28:01 -0500 )edit