Modify the def write_before to write_video as write_video fails

I think there is a minor typo in the last example when motion is found. Modified the def from write_before to write_video.