Using MATLAB 2012a VideoReader function on Fedora 17 and Ubuntu 12.04

I update my Linux distribution at least once a year. As detailed in my previous post, I always encounter a problem when using a recent MATLAB version on my updated Linux distribution: the VideoReader (mmreader) function does not work "out of the box" (this is also true for the VideoWriter function). To open compressed video on Matlab, you need to have the proper gstreamer plugins installed.  Otherwise, you'll get an error message when opening the video file with the VideoReader function: 

>> video = mmreader('videofile.avi')
??? The file requires the following codec(s) to be installed on your system:

The message will be slightly different depending on the codec used by the video file you are trying to open.

Matlab 2012a now ships with a version of libstdc++ that seems to be compatible with the one found on recent Linux distribution such as Fedora 17 and Ubuntu 12.04. This means that it is no longer necessary to change the Matlab's version of libstdc++ for the system's one (see my previous post). The only thing that has to be done is to install the proper plugins for gstreamer (the backend used by the Linux version of Matlab to read and write compressed videos):

  • On Ubuntu 12.04
    sudo apt-get install gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly
  • On Fedora 17
    sudo yum install gstreamer-ffmpeg gstreamer-plugins-bad gstreamer-plugins-bad-free gstreamer-plugins-bad-nonfree gstreamer-plugins-base gstreamer-plugins-good gstreamer-plugins-good-extras gstreamer-plugins-ugly
I hope this will help!