Codec is a portmanteau for encoder and decoder, you can consider it as rules of how to encode your media for streaming, storage and transmission, and how to reverse the process to decode the media for playback and editing. Container ensures everything is packaged and portable. You can shove encoded video streams, audio streams, subtitles and metadata into this box.