Videos can be saved in many formats. Formats are actually rules prescribing how to store digital data for videos. For example, formats specify the maximum resolution and color depth, the aspect ratio, or the number of images per second.
Application programs, such as player, must read out these formats to play out videos properly. For this purpose, codecs are used. Codecs know the format rules, and can encode or decode video files according to these rules. They form the interface between the video format and the application program. Codecs compress and also decompress usually video, audio or images in a desired format: when you play a video codecs ensure that certain information, such as duration, resolution or aspect ratio is correctly implemented.
Analogous to the various video formats, there are a variety of codecs available. The playback program must the find the matching codec from a list of existing codecs to reproduce the corresponding video file. While the player determines parameters such as position and size of the video window, the video resolution can be adjusted during playback by a codec.