aeddi / aws-lambda-python-opencv

Simple script that builds an AWS Lambda deployment package including OpenCV

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cv2.VideoCapture() not working with this package as I am trying to process my video using lambda function with opencv python.. If you have any solution kindly help me with that, it will be really helpful :)

harshal2802 opened this issue · comments

Hello,
can you give me the code you're trying to run along with the error messages returned by Python ?

When using like this

ret, img = cv2.VideoCapture()

value of ret is coming False every time
Here I am trying to read video as mentioned on Opencv tutorial on official
website using lambda function.

On Tue, Oct 18, 2016 at 9:01 PM, aeddi notifications@github.com wrote:

Hello,
can you give me the code you're trying to run along with the error
messages returned by Python ?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJ44t37jk-fPAzca9wTB2RKRFEPRKUY2ks5q1OZPgaJpZM4KYFy3
.

It's maybe not the cause of your problem but cv2.VideoCapture() seems to return only one value which is not a boolean but an object.
So according to the official documentation, your code should look like this:

cap = cv2.VideoCapture('video.avi')
if cap.isOpened():
      #Do some stuff

According to the doc. again, VideoCapture needs extra dependencies (ffmpeg/gstreamer) that may not be installed on Lambda.
So you could possibly have to include some binary (e.g dynamic libs) in the archive and find a way to link them properly with OpenCV.