How to install Octave video tools on CentOS 5

This post describes how to get GNU Octave up and running on a CentOS 5 Linux system for use in reading, processing, and writing video files.  You will need to use the EPEL and DAG/rpmforge repositories, but I won’t explain how to do that here.

NOTE: I had to go through some trial and error to get this working.  I tried to summarize only the necessary steps, but I can’t guarantee I got it completely right until I try a fresh install on another system which does not have any of the dependencies already installed.  Please leave a comment if you encounter any problems.

As a superuser, use yum to install octave.  You need octave-devel and ncurses-devel in order to install any Octave packages.  You will need to have the EPEL repository enabled:

yum install octave octave-devel ncurses-devel

As a superuser, use yum to install ffmpeg and ffmpeg-devel from the rpmforge repo.  The video package for octave uses the ffmpeg libraries (avilib) to perform the actual video processing.  You will need the ffmpeg-devel package, because Octave builds the video package from source.

  1. Since ffmpeg and ffmpeg-devel are only available from DAG/rpmforge, I suggest disabling EPEL before installing these packages.  This will ensure that all the dependencies are installed from rpmforge, instead of mixing packages from EPEL and rpmforge.  Mixing dependencies from different repositories might lead to incompatibilities and bugs that can be hard to trace.
  2. yum install ffmpeg ffmpeg-devel

Install the video package for Octave.  I prefer to do this as an ordinary user (not root) so that the packages will be installed in my home directory (I have a “rule” that only the package manager is allowed to put files into system locations).  You will need to set the CXX flags environment variable to work around a bug in the C++ headers for the ffmpeg libraries.  If you are going to build other packages that link to ffmpeg’s libraries, you should probably set CXXFLAGS in your .bashrc.  I think this bug was fixed in later versions of ffmpeg, but they haven’t made it into EPEL or rpmforge yet.

  1. Download video package
  2. Unpack the archive: tar xfz video-1.0.2.tar.gz
  3. Change to the unpacked directory: cd video-1.0.2
  4. Temporarily set C++ flags and configure: CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure
  5. Temporarily set C++ flags and build: CXXFLAGS=-D__STDC_CONSTANT_MACROS make
  6. Install: make install

If you don’t set the C++ flags this way, you will get an error like this:

/usr/include/libavutil/common.h: In function ‘int32_t av_clipl_int32(int64_t)’:
/usr/include/libavutil/common.h:154: error: ‘UINT64_C’ was not declared in this scope


One thought on “How to install Octave video tools on CentOS 5

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s