In ubuntu open Synaptic software manager, search and install "ubuntu-restricted-extras". Or if you want to do it in command line, execute:
sudo apt-get install ubuntu-restricted-extras
Give your user password when prompted. You can then enjoy all the restricted format media files.
For RedHat, I think its better to enable dag repo. See instructions here: http://dag.wieers.com/rpm/FAQ.php#B
After installing repo, update the system as root with
. For Glib, if it is not installed as dependency, then may be