Empty output video
mankoff opened this issue · 5 comments
Output files all seem to have zero size. I get this error when running the code:
eulerian_magnify.py:144: ComplexWarning: Casting complex values to real discards the imaginary part
img[:] = g_video[x]
System: OS X, Enthought Canopy Python, Python 2.7.3, 64-bit, OpenCV 2.4.2
Video (*_magnified.avi) size is 28 KB.
So on further inspection, that line isn't the issue. I can wrap it in "numpy.real()" to make the error message go away.
Viewing res
(with imshow
) immediately before writer.write(res)
shows that it looks good. So this is a bug with writer
, from the line writer = cv2.VideoWriter(save_filename, fourcc, fps, (width, height), 1)
that for some reason is not properly writing out the (apparently) valid data in res
Meh. Nothing specific to this code. Same problem with simple test code as http://stackoverflow.com/questions/10605163/opencv-videowriter-under-osx-producing-no-output No solution yet.
I'm having this same issue. Did you ever figure out a solution?
I did solve it. I forget the details but the issue was in openCV / CV2 when installed via Canopy (Enthought) or Homebrew. One solution is here: http://stackoverflow.com/questions/16952315/enthought-canopy-python-and-opencv
Hmm, that looks like the module wasn't in your path. I do have OpenCV and CV2 installed with Homebrew, but i have no trouble importing them in Python, so they're definitely in my path. My guess is that it's an issue with the codec.