update write_video.m