5

Do video or audio file containers (extensions) have any repercussion with the video in itself ? Or is the codec used the only thing that has a repercussion ?

For example I have the exact same video source compressed with the same codec, let's say VP9. If I put this video in a container .mp4 or .mkv or .avi or .webm, will it have a repercussion on the video depending on the container I'll have used ?

Can some codecs only be used with some containers and vice versa ?

To be sure I understand, a codec is used to compress a video or an audio in order to reduce its quality or its size (less Bytes). But do we have to use a codec ? Can't we just read a "pure" video without compression without having applied a codec ?

1
  • 1
    "Can't we just read a "pure" video" sadly not. A "pure" video stream would be the RAW data from the camera sensor which is a) gigantic in size, b) only understood by specific software that knows how that sensor formats data and c) un-modified and un-corrected. In the same way that the thoughts in our head need to be written down in a language (English, German, Esparanto) media needs to be encoded (MP4, JPG, WAV, etc) Dec 18, 2019 at 21:41

2 Answers 2

1

No, but there are some exceptions. For example, mkv (and its fork webm) has only millisecond precision in timestamps and have no DTS, only PTS and even PTS is in form of durations. That means even simple 24/1.001 frame rate will be not perfectly presented in mkv. All the frames will still be decoded the same but not perfectly in time like it would be in mp4. TS also has a very strange time base that may be problematic.

0

Though there are uncompressed video formats, primarily used while recording or displaying the video, the amount of information is too large for general use. For example, 24-bit images displayed at 1080p, 60 fps is ~ 3 gigabits/second. That can be pushed through a short HDMI cable, but not efficiently stored.

Lossy compression schemes, such as MPEG, compress data but drop some visual information in the process. Lossless video compression, e.g. AV1 (that's "AVone", not "AVI") loses no data, i.e. the uncompressed stream is identical to that which was recorded.

BTW, most lossy compression schemes allow varying the amount of data lost, letting the user decide whether disk space or fidelity is relatively more important.

The file extension, which you term "container", is almost irrelevant. Some OS's ignore the extension entirely, and look only for identifying information inside the file. For example, a particular MP4 file looks like this in a hex editor:

MP4 file initial bytes

The MP4 signature format specifies the type and subtype, the length of chunks, etc. The computer identifies the type of file from that signature and then chooses a codec, designed for that file type, to decode the data.

3
  • 2
    While the file extension is commonly used to refer to a specific container format, the identifying information inside the file is an actual part of the "container" as the term is commonly understood. This is actually the first post I've seen to claim that "container" means the file extension and nothing else. Dec 19, 2019 at 5:33
  • So can I conclude that no matter which container I use, the quality of the video will not be affected ? That if I convert a video to another format with ffmpeg, the quality will not be affected ?
    – Nicryc
    Dec 19, 2019 at 14:00
  • No. Lossy compression loses info, lossless does not. Dec 19, 2019 at 20:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .