Multimedia Formats in Linux. Part One

Audio and video formats in Linux


There are many audio and video formats that vary in weight and quality.In this post, we'll look at applications for converting between multimedia formats on Linux.

The reasons for these formats are multiple, from the need to adapt to different platforms to each manufacturer's desire to impose their own.

Although there are players like VLC or MPlayer that work with almost all the known ones, We may need to work with a specific format, hence the need for a converter.

What are audio and video formats?

Audio formats

An audio format is a way of encoding and storing analog sound in digital format. The microphone captures the sound wave and the recording software converts it into information that includes the number of samples per second and the weight of each sample.

What is a sample?

Sound is a sound wave.  The recording software does not save the entire waveform but only certain points at specific times.  At playback, it will use these points to reconstruct the waveform. The quality of the samples will improve the sound fidelity.

An audio CD is recorded at 44.1 kHz, or 44.100 audio samples per second. Each sample is stored at 16 bits deep, allowing each value to represent 65.536 possible amplitude levels (2^16).

That is to say, the more samples per second, the better the capacity to reproduce high frequencies. and, the more bits per sample, the more precision in the volume of each point of the wave.

There are compressed and uncompressed formats. Uncompressed formats save the wave almost as it was captured; they have higher quality but take up more space. Compressed formats, on the other hand, can be lossy or lossless.

  • Lossy formats:  They eliminate sounds that are not perceptible to the human ear or that are drowned out by other sounds, causing an imperceptible loss of quality.
  • Lossless formats: They eliminate mathematical redundancy but quality is not reduced.
  • AAC (Advanced Audio Coding): Lossy compression. It has better quality than MP3 but isn't compatible with as many devices.

Some popular audio formats are:

  • MP3 (MPEG-1 Audio Layer III): It's a lossy compressed format. It produces lightweight files but with a very noticeable loss of quality if saved at low bit rates.
  • WAV (Waveform Audio File): High quality but produces large files.
  • AAC (Advanced Audio Coding): It generates lossy files of higher quality than MP3. The downside is that it's not as compatible with other devices.
  • FLAC (Free Lossless Audio Codec): It's a lossless compression format. It produces files of similar quality to the original but takes up less space than WAV. It doesn't work with simpler players.
  • OGG Vorbis: It's a lossy compression format. It produces good quality files, although it's not widely compatible with many devices.
  • . WMA (Windows Media Audio): Native Windows format that provides lossy or lossless compression. It has little support outside of Windows, although several Linux programs support it.

Video Formats in Linux

A video format works like A container where moving images, their audio, subtitles, and metadata are stored. This data is compressed using codecs.

A codec is the fform in which data is compressed, That is to say, a format has video compressed in a video codec and audio compressed in an audio codec.

Here we have the main difference between audio and video formats. Audio formats store samples of sound waves, video formats are containers that store audio, video, and other complementary information.

The methods for compressing files will vary depending on the format used. Some methods include:

  • Keyframes (I-frames): Save full frames as whole photos.
  • Predicted frames (P-frames): Only changes from the previous frame are saved.
  • Bidirectional frames (B-frames): Saves the differences with the previous and next frames.

Using these techniques greatly reduces the size of videos with few variations, such as those using a static background.
In the next article, we'll continue with multimedia formats and look at compression tools between formats.