Are codecs and file formats the same?
No, although it can be confusing because they sometimes have the same name. You can think of a file format as a type of container. Inside the container is data that has been compressed by using a particular codec. For example, a file format such as Windows Media Audio contains data that is compressed by using the Windows Media Audio codec. However, a file format such as Audio Video Interleaved (AVI) can contain data that is compressed by any of a number of different codecs, including the MPEG-2, DivX, or XviD codecs. AVI files can also contain data that is not compressed by any codec. Consequently, you might be able to play some AVI files and not others, depending on which codecs were used to compress the file and which codecs you have installed on your computer. For the same reason, you also might be able to play the audio portion of an AVI file, but not the video portion.