Add an encode_film function