What is the difference between codec, file format and extension?

Asked

Viewed 121 times

2

I’ve heard that mp3, mp4 and etc... uses the same codec, but what are each and what the difference?

1 answer

2


Let’s take an example: "image.jpg"

  • File format: is how the data is stored in the file. In this case it is an image, which was "compressed" with JPG/JPEG compression. In many file types other than the content itself this implies having a header (header) at the beginning of the archive containing information about that content (metadata) as file format identifier, dimensions (in case of images), author, location, encoding used, etc.

  • Codec: (of "Codblender-Dechater") is the software which was used to, from a file in "standard" or simpler format, generate a file in format expected. That is, it is the codec that generates the file in the right format. Other examples would be mpg and mkv for video, that is, there are codecs that process a video and generate compressed videos in these other formats.

  • Extension: nothing is more than the part of the file name that identifies the format or type of the file. In the example, the ". jpg" is the extension indicating that it is a file of JPG/JPEG format. One note is that, the extension is used by programs that will open this file to "know" that has been encoded (encoding) in that format, but that doesn’t necessarily mean that file is in that format. Extensions help the OS associate a particular program with a file format type, so for example when clicking a file the OS knows which software to use to "open" or "read" that file. There was a historical restriction for the extension to have at most three letters, but today this is no longer true, although it can be seen in some traditional extensions such as .exe, .zip, .txt, .jpg, .gif, etc..

As a bonus we also have the term compression format, which has to do with compressing data (codec) in a more portable (compressed) and/or more transmission-optimized format. This compression can be lossy (loses information in relation to the original) or Lossless (no loss). For example, MPEG is a family of formats lossy facing streaming audio/video that includes MPEG-1 Layer 3, which is the famous MP3. PKZIP and RAR are known compression formats Lossless of archives in general (archives .zip and .rar, respectively). Note that certain files compensate to compress, for transport/storage purposes, others are already orginally well compressed by some other format and there is little or no advantage in compressing in other, can leave the file even bigger than it was already.

inserir a descrição da imagem aqui

  • That totally answered my question

  • 1

    @Gustavosoares Great. Remember the [tour]? You can accept the answer then :)

  • Okay then I go there

  • @Gustavosoares It’s little grasshopper, I saw the +1 but missed "accept" even, which is to mark blue below this number to the left of the answer. See here

  • @Piovezan, the +1 you saw is mine and the other is yours.

  • 1

    https://i.pinimg.com/736x/D5/54/5d/d5545d8fb22c51574148c2fa709ec1d3-Betrayal-so-Sad.jpg

  • 1

    kkkkkkkkkkkkk....: D

  • 1

    very good this image @Piovezan :D

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.