Codec is an algorithm for compressing (packing, encoding) data and restoring compressed data.
In the context of video and audio data, the codec (respectively, video and audio codec) determines how the content can be encoded for transmission / storage, as well as how the encoded content is played back.
The most common video codecs are H.264 and Motion JPEG.