1

Hello: I am developing on Linux trying to use Python/OpenCV to process videos. I have tried using Python2 and Python3 but no results.

import cv2
video = cv2.VideoCapture("myvideo.mp4")
status = video.isOpened()

In this case, status is a boolean and it is always false.

A quick search online pointed to the problem as Python OpenCV module is compiled with FFMPEG library turned on. As a result, it is cannot handle video. But I am unable to find any solution to it.

Any help much appreciated.

Vince Yau
  • 515
  • 1
  • 5
  • 16

1 Answers1

0
  1. See if you can use ffmpeg from command line and the video (with exactly the same path) as an input for some kind of simple manipulation or conversion.
  2. Doing that, output it as an .avi file with a different coding and see if that makes any difference for OpenCV as an input.
  3. Check if maybe you're able to use the feed from your webcam by modifying the script just a little bit.
  4. Check if the path you provide is correct. Try putting the video in your home folder and providing an absolute path.
  5. Try reinstalling ffmpeg according to these instrcutions.
  6. If none of above work, follow this guide.
Community
  • 1
  • 1
Michał Gacka
  • 2,935
  • 2
  • 29
  • 45