writing frames in disk