Model Based Video Encoding