Wednesday, August 26, 2009

Ubuntu OpenCV FFMPEG error

If you are in Ubuntu 9.04 and attempting to write a video using OpenCV you may encounter an error such as:

OpenCV Error: Bad argument (codec not found) in CvVideoWriter_FFMPEG::open

The only solution that I have found is to install the following
sudo apt-get install libavcodec-unstripped-52

It seems to remove a bunch of packages but everything I do (reading/writing videos) seems to be working. So proceed with caution on installing this, but it may fix what ails you.

2 comments:

  1. Trying this removed my ability to compile my OpenCV programs. I did however solve my codec-problems with the programs I had already compiled, so this is quite a nuisance. If I want to be able to compile my programs, I have to keep my packages as is, but if I want to be able to run my programs, I have to use this fix.

    ReplyDelete
  2. What kind of errors were produced by your compiler? Also, what linux environment are you using? I was using sabayon and had no issues with the OpenCV side of things.

    ReplyDelete