- Install Multimedia Codecs on Ubuntu 22.04
- How to install multimedia codecs on Ubuntu 22.04
- How to remove Multimedia codecs Ubuntu 22.04
- Conclusion
- Мультимедиа кодеки
- Установка мультимедиа кодеков
- Выборочная установка мультимедиа кодеков
- Просмотр информации о медиафайлах
- Решение проблем
- Codecs and containers
- Requirements
- List of codecs
- Audio
- Lossless audio codecs
- Lossy audio codecs
- Image codecs
- Video codecs
- Container format tools
- Backends
- GStreamer
- xine
- libavcodec
- Tips and tricks
- No H264, mpg4 or Musepack (.mpc) in Totem Player
- No H264 in Parole Player
Install Multimedia Codecs on Ubuntu 22.04
Multimedia codecs comprise a set of libraries/dependencies to play audio/video files of various formats. Ubuntu 22.04 comes up with default support for a few codecs. However, it is recommended to install multimedia codecs to get the uninterrupted stream of video and audio files.
Ubuntu 22.04 comes up with updated security features, improved usability, interactive interface and much more. Ubuntu 22.04 is the latest release of the LTS version of Ubuntu. This article provides a step-by-step installation guide of multimedia codecs on Ubuntu 22.04.
How to install multimedia codecs on Ubuntu 22.04
Multimedia codecs not only allow you to play audio video files, but they can also be used to compress/decompress media files for a smooth transmission. Let’s head over to the following steps that leads to installing the multimedia codecs on Ubuntu 22.04:
Step 1: It is recommended to update the system’s package before getting any program/application. Perform the update operation via the following command.
Step 2: Once the packages are updated successfully. You can install the multimedia codecs on your system by issuing the following command. The command will install the package ubuntu-restricted-extras which is equipped with essential media codecs.
Before installation, Ubuntu will ask you to confirm by pressing “y“. Moreover, you would also observe that a few codecs are installed but not required. Whereas there are tens of codecs that will be installed with this command.
As the installation is started, the following interface will appear which states that license agreement is required for Microsoft-core-fonts (a package being installed with the multimedia codecs).
Now, you have to accept the license agreement of Microsoft-core-fonts. To do so, press the “tab” key to navigate to “OK” and hit enter:
The installation may take a while. Once the installation is finished; you can now play all kinds of audio/video files on your Ubuntu 22.04.
How to remove Multimedia codecs Ubuntu 22.04
Although the Multimedia codecs are recommended to be there on your Ubuntu 22.04. However, if you do not want to keep them on your Ubuntu 22.04. You can remove them via the following command.
Moreover, if you want to remove the configuration files as well. You can use the “–purge” option as written below:
Here you go with multimedia codecs!
Conclusion
Ubuntu 22.04 is the latest LTS release of Ubuntu. It is equipped with the updated security features, improved usability, and interface. Multimedia codecs are the essential packages that are recommended to play various audio/video files on Ubuntu. Although Ubuntu 22.04 is equipped with most of them, it is recommended to install multimedia codecs for an uninterrupted stream of media on Ubuntu 22.04.
Мультимедиа кодеки
Для воспроизведения и изменения мультимедиа файлов в систему необходимо установить кодеки, демуксеры и другие библиотеки…
Как это сделать рассмотрим ниже.
Кодеки — мини программы, которые преобразуют звук и изображение в компьютерный код, и наоборот когда нужно воспроизвести или изменить. Пример кодеков: x264, xvid, faac, faad, lame, vorbis.
Демуксеры — мини программы, которые упаковывают мультимедиа данные в контейнер, и распаковывают когда нужно воспроизвести или изменить. Пример медиаконтейнеров, сформированных демуксерами: avi, mp4, mp3, mkv, flv, webm, 3gp.
Установка мультимедиа кодеков
ubuntu-restricted-extras — мультимедиа кодеки, флеш плеер, шрифты от Microsoft, распаковщик rar архивов.
sudo apt-get update && sudo apt-get install ubuntu-restricted-extras
libdvdcss2 — библиотека для просмотра видео с лицензионных DVD дисков.
sudo add-apt-repository "deb http://download.videolan.org/pub/debian/stable/ /"
wget -O - http://download.videolan.org/pub/debian/videolan-apt.asc|sudo apt-key add -
sudo apt-get update && sudo apt-get install libdvdcss2
Выборочная установка мультимедиа кодеков
Выше описан метод как проще установить множество кодеков, но для некоторых случаев пригодится выборочная установка кодеков.
libavcodec-extra-53 — кодеки от проекта libav
libavformat-extra-53 — демуксеры от проекта libav
Кодеки для программ на основе Gstreamer, в этих пакетах находятся кодеки из состава libavcodec, они разделены по видам лицензий и др. параметрам:
gstreamer0.10-plugins-base
gstreamer0.10-plugins-good
gstreamer0.10-plugins-ugly
gstreamer0.10-plugins-bad
gstreamer0.10-plugins-bad-multiverse
libdvdread4 — библиотека для чтения DVD
libdvdnav4 — библиотека для навигации по DVD
libdvdcss2 — библиотека для расшифровки данных с лицензионных DVD дисков.
Просмотр информации о медиафайлах
В плеерах можно посмотреть информацию о файле, например кодеки, размер видео, бирейт
Файловый менеджер Naulilus показывает медиаданные в свойствах файла, если установлены плееры Totem или Gnome-mplayer
mediainfo — показывает подробную информацию о мультимедиа файле
avconv -i /путь/до/файла — конвертер, который может показать информацию о мультимедиа файле
ffmpeg -i /путь/до/файла — конвертер, который может показать информацию о мультимедиа файле
Решение проблем
Если плеер не может воспроизвести какой-либо мультимедиа файл, тогда запустите плеер из терминала и посмотрите сообщение об ошибке, и обратитесь на форум.
Если у вас в программах на основе Gstreamer есть проблемы с mp4 и m4a, тогда выполните команду
rm -f ~/.gstreamer-0.10/registry*
Codecs and containers
In general, codecs are utilized by multimedia applications to encode or decode audio or video streams. In order to play encoded streams, users must ensure an appropriate codec is installed.
This article deals only with codecs and application backends; see List of applications/Multimedia for a list of media players (MPlayer, mpv and VLC are popular choices).
Requirements
Playing multimedia content requires two components:
It is not always necessary to explicitly install codecs if you have installed a media player. For example, MPlayer pulls in a large number of codecs as dependencies, and also has codecs built in.
List of codecs
Audio
Lossless audio codecs
- Apple Lossless (ALAC) — A lossless audio compression codec developed by Apple and deployed on all of its platforms and devices.
- FLAC — Free Lossless Audio Codec.
- WavPack — Lossless audio compression format that also has a lossy hybrid mode.
Lossy audio codecs
AAC
- FAAC — Proprietary AAC audio encoder.
- FAAD2 — ISO AAC audio decoder.
- Fraunhofer FDK AAC — OpenCORE Framework implementation Advanced Audio Coding (AAC) encoder. Modified library of Fraunhofer AAC decoder and encoder.
- Nero AAC — Nero AAC reference quality MPEG-4 and 3GPP audio codec. (deprecated)
Image codecs
- JasPer — Software-based implementation of the codec specified in the emerging JPEG-2000 Part-1 standard.
- OpenJPEG — Open source JPEG 2000 codec.
- WebP — An image format employing both lossy and lossless compression. It is currently developed by Google.
- AV1 Image File Format (AVIF) — Image format based on the AV1 video codec.
- High Efficiency Image File Format (HEIF) — Image format based on the HEVC video codec. Often in a HEIC container.
- JPEG XL — Royalty-free image format developed by the Joint Photographic Experts Group which aims for broad usage, capable of re-encoding JPEGs while avoiding generation loss.
Video codecs
- AV1 — AOMedia Video 1 (AV1) is a successor codec to Google’s VP9, Mozilla’s Daala, Cisco’s Thor. aom is the reference implementation of both encoding and decoding. dav1d is the performance focused decoder. rav1e is performance focused encoder. Most benchmark show better performances with svt-av1 than rav1e.
- Daala — Research video codec under development by the Xiph.Org Foundation and sponsored by the Mozilla Foundation. The goal of the project is to provide a free to implement, use and distribute digital media format and reference implementation with technical performance superior to h.265.
- libde265 — Open source implementation of the h.265 video codec.
- libdv — The Quasar DV codec (libdv) is a software codec for DV video.
- libmpeg2 — Library for decoding MPEG-1 and MPEG-2 video streams.
- Schrödinger — Advanced royalty-free video compression format designed for a wide range of uses, from delivering low-resolution web content to broadcasting HD and beyond, to near-lossless studio editing.
- Theora — Open video codec developed by the Xiph.org.
- VP9 — High-quality, open video format for the web that’s freely available to everyone. Improved version of earlier VP8 codec.
- x264 — Free library for encoding H264/AVC video streams.
- x265 — Open-source project and free application library for encoding video streams into the H.265/High Efficiency Video Coding (HEVC) format.
- Xvid — Open source MPEG-4 video codec.
Container format tools
- MKVToolNix — Set of tools to create, edit and inspect Matroska files.
- MP4Joiner — A collection of GUI tools to manipulate MP4 files (MP4Joiner, MP4Splitter).
- OGMtools — Information, extraction or creation for OGG media streams.
Backends
GStreamer
GStreamer is a library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing.
Simply, GStreamer is a backend or framework utilized by many media applications. See GStreamer article.
xine
xine is a free multimedia player. It plays back CDs, DVDs, BluRays and VCDs. It also decodes multimedia files like AVI, MOV, WMV, and MP3 from local disk drives, and displays multimedia streamed over the Internet.
As an alternative to GStreamer, many media players can be configured to utilize the xine backend provided by xine-lib .
Note that the xine project itself provides a capable video player, xine-ui .
libavcodec
libavcodec is part of the FFmpeg project. It includes a large number of video and audio codecs. The libavcodec codecs are included with media players such as MPlayer and VLC, so you may not need to install the ffmpeg package itself.
Tips and tricks
No H264, mpg4 or Musepack (.mpc) in Totem Player
If you see the «The H264 plugin is missing» warning with Totem media player, install gst-libav .
No H264 in Parole Player
If you see the «Parole needs H.264 decoder to play this file» warning with Parole media player, install gst-libav .