Due to legal reasons, Ubuntu does NOT include multi-media codecs out-of-the-box for audio and video playback. It’s however easy to install them via a single command.
During the Ubuntu installing process, it provides an option “Install third party software for graphics and Wi-Fi hardware and additional media formats” in the wizard. If you didn’t enable it, Ubuntu refuses to play movie and sound via the default Totem media player and Rhythmbox music player.
Without installing third-party player with bundled codecs, you can simply install the ubuntu-restricted-extras package to fix the issue. The package does not contain anything, but tells to install the following packages for you:
ttf-mscorefonts-installer– Install Microsoft TrueType core fonts.
unrar– non-free package enables ability to extract rar package in Ubuntu.
libavcodec-extra– FFmpeg library with encoder / decoder for audio and video codecs.
chromium-codecs-ffmpeg-extra– FFmpeg codecs for Chromium based web browser.
- And a few gstreamer1.0 plugins for audio / video playback, recording and editing.
How to Install Media Codecs in Ubuntu:
Firstly, open a terminal window either by searching from the ‘Activities‘ overview screen or by pressing Ctrl+Alt+T on keyboard.
When terminal opens, copy and paste the command below into it and hit Enter:
sudo apt update && sudo apt install ubuntu-restricted-extras
Type your password (no visual feedback for security reason) when it prompts and hit Enter
For Ubuntu flavors, e.g, KUbuntu, and LUbuntu, there are relevant package to install the commonly used media codecs and fonts.
For KUbuntu users, open terminal emulator from start menu and run the command below instead:
sudo apt update && sudo install kubuntu-restricted-extras
And for LUbuntu, open terminal from start menu and run the command:
sudo apt update && sudo install lubuntu-restricted-extras
That’s all. Enjoy!