Why does OpenCV VideoCapture using a URL not work on Heroku?

asked 2020-08-08 14:59:38 -0500

falalala gravatar image

updated 2020-08-08 19:31:47 -0500

I'm trying to open a videoURL using cv2.VideoCapture on Heroku, and it consistently fails to open. I've called the same code on my local machine (Windows 10) and it ran with no problems. Does anyone have recommendations/buildpacks/alternatives to resolve this?

OpenCV Version:

Python: 3.7

Current Buildpacks:

Open Cv Build info (Video) from the Heroku Dyno

Video I/O:
DC1394:                      NO
FFMPEG:                      YES
avcodec:                   YES (ver 58.21.104)
avformat:                  YES (ver 58.17.101)
avutil:                    YES (ver 56.18.102)
swscale:                   YES (ver 5.2.100)
avresample:                NO
GStreamer:                   NO
libv4l/libv4l2:              NO
v4l/v4l2:                    linux/videodev.h linux/videodev2.h
gPhoto2:                     NO

Edit: Here is our code that's running into problems:

cap = cv.VideoCapture(video_url)

With this code, we noticed the print statement consistently says False when using a URL similar to one provided by youtubeDL.

edit retag flag offensive close merge delete