0

I am getting an error (-215) ssize.area() > 0 in function resize when I am trying to resize a frame from a .avi video. I've deduced that this means the frame cannot be read. I have FFmpeg installed as well. Why is this not valid? The video is in the same folder as the python file.

Also, playing .m4v video works fine. So it is just .avi.

Here is the beginning of the code before I start messing with the images and whatnot.

from __future__ import print_function
import numpy as np, cv2
import datetime
cap = cv2.VideoCapture("video2.avi")

ret = cap.set(3,320)
ret = cap.set(4,240)
f = open('cars','w')

carCount = 0
while True:
    stuff in here

    cv2.imshow('Video', frame)
    if cv2.waitKey(1) == ord('q'):
        break

f.close()
cap.release()
cv2.destroyAllWindows()
cdipaolo
  • 219
  • 2
  • 9
  • possible duplicate of [why can't i open avi video in opencv?](http://stackoverflow.com/questions/8414947/why-cant-i-open-avi-video-in-opencv) – GPPK Dec 10 '14 at 15:49
  • if the area was 0 then your frame was empty / invalid. check the return values from cap.read() and cap.isOpened() – berak Dec 10 '14 at 16:05

0 Answers0