Skip to content

Media Containers

Hossein HassanNejad edited this page Sep 10, 2026 · 1 revision

A container determines how audio, video, subtitles, metadata, and other media streams are stored inside a media file.

The container does not determine media quality. Quality mainly depends on the codecs and encoding settings used for the audio and video streams.

For example:

movie.mp4
Container → MP4
Video codec → H.264
Audio codec → AAC

Example

await NyxConverter.convertTo(
  inputPath,
  outputDirectory,
  container: NyxContainer.mp4,
);

Supported Containers

Video Containers

Container Description
MP4 Excellent compatibility and recommended for most video files.
MKV Flexible container supporting multiple tracks, subtitles, and chapters.
AVI Older container with broad legacy support.
MOV Apple QuickTime container.
WebM Web-focused container commonly used for online video.
MPEG MPEG container commonly used with MPEG-1/2 media.
WMV Windows Media format commonly associated with ASF/WMV files.

Audio Formats

Format Description
MP3 Highly compatible compressed audio format.
AAC Efficient compressed audio format commonly used for AAC audio streams.
WAV Commonly used for uncompressed PCM audio.
FLAC Lossless compressed audio format.
OGG Open container commonly used with Vorbis or Opus audio.

Recommendations

Goal Recommended Format
Maximum video compatibility MP4
Multiple tracks / subtitles MKV
Apple / QuickTime workflows MOV
Web video WebM
MPEG workflows MPEG
Windows Media WMV
Universal audio MP3
Lossless audio FLAC
Uncompressed audio WAV

Container vs Codec

A container and a codec are different things.

For example:

movie.mp4
├── Container: MP4
├── Video codec: H.264
└── Audio codec: AAC

Another file could use:

movie.mkv
├── Container: MKV
├── Video codec: H.265
└── Audio codec: Opus

The same codec can often be stored in different containers, depending on compatibility and format support.

Clone this wiki locally