Fixing VLC does not support the audio or video format error

2009 June 16 at 02:16 » Tagged as :video, javafx,

When you try to run VLC does it give you this disheartening error message?
No suitable decoder module:

VLC does not support the audio or video format "MP42". Unfortunately there is no way for you to fix this.

Have no fear. This is something that is quite easily fixed! First step is to run VLC in verbose mode you will then see a more informative error message.
[0x1adb098] main libvlc warning: cannot load module `/usr/lib64/vlc/codec/libavcodec_plugin.so' (libavcodec.so.52: cannot open shared object file: No such file or directory) [0x1adb098] main libvlc warning: cannot load module `/usr/lib64/vlc/demux/libavformat_plugin.so' (libavcodec.so.52: cannot open shared object file: No such file or directory) [0x1adb098] main libvlc warning: cannot load module `/usr/lib64/vlc/video_filter/libopencv_wrapper_plugin.so' (libcxcore.so.1: cannot open shared object file: No such file or directory) [0x1adb098] main libvlc warning: cannot load module `/usr/lib64/vlc/video_filter/libopencv_example_plugin.so' (libcxcore.so.1: cannot open shared object file: No such file or directory) [0x1be4c88] main demux warning: no access_demux module matching "file" could be loaded
I found out through 'yum whatprovides' that the libavcodec files are supposed to be provided by ffmpeg-libs (which is installed). In fact, I have already, removed this and reinstalled it because earlier yum was throwing an error while installing vlc. Apparently despite the re-installation, the required symbolic links had not been created. So I did the old rpm2cpio trick. Similarly, i found that the libcxcore files are provided by opencv and did the same again with it. So what exactly is this rpm2cpio trick? it's a method to manually install files from an rpm. It's usefull if you have a corrupt rpmdb or want to install an RPM but not it's dependencies.
rpm2cpio /var/cache/yum/./fedora/packages/opencv-1.0.0-15.fc.x86_64.rpm > opencv.cpio cat opencv.cpio | cpio -idv rsync  lib65/ /usr/lib64/  -avz

Now try to open that video again and you will see that it plays without any errors. We have quite easily fixed the error that VLC said we wouldn't be able to fix. But what exactly caused it in the first place? In my case it was upgrading from Fedora 10 to Fedora 11 - Some of the RPMs had not been installed properly.