<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def debug_video_writer_factory(output_dir):
 """Creates a VideoWriter for debug videos."""

  if FLAGS.disable_ffmpeg:
    return common_video.IndividualFrameWriter(output_dir)
  else:
    output_path = os.path.join(output_dir, "video.avi")
    return common_video.WholeVideoWriter(
        fps=10, output_path=output_path, file_format="avi"
    )