def new_configuration(cls):
        """
        Creates a new configuration file and builds
        a test video.
        """
        try:
            print("No configuration file provided.")
            print("Creating new configuration file.")

            config = Configuration()
            config.new_configuration()

            print("Creating low-quality video as {}".format(
                config.output_video))
            print(
                "If video trimming needs to be adjusted, run the ",
                "Project CARS Replay Enhancer with the `-t` option.")
            print("\n")
            print(
                "To synchronize telemetry with video, run the ",
                "Project CARS Replay Enhancer with the `-r` option.")
            print(
                "Set the synchronization offset to the value shown "
                "on the Timer when the viewed car crosses the start ",
                "finish line to begin lap 2.")
            print(
                "Please wait. Telemetry being processed and ",
                "rendered. If this is the first time this data has ",
                "been used, it make take longer.")

            try:
                replay = cls(config.config_file)
            except ValueError as error:
                print("Invalid JSON in configuration file: {}".format(
                    error))
            else:
                start_video = replay.build_default_video(False)
                end_video = replay.build_default_video(False)

                start_video = start_video.set_duration(
                    start_video.duration).subclip(0, 185)
                if replay.show_champion:
                    end_video = end_video.set_duration(
                        end_video.duration).subclip(
                            end_video.duration-120)
                else:
                    end_video = end_video.set_duration(
                        end_video.duration).subclip(
                            end_video.duration-100)
                output = mpy.concatenate_videoclips(
                    [start_video, end_video])
                output.write_videofile(
                    replay.output_video, fps=10, preset='superfast')
        except KeyboardInterrupt:
            raise
    def edit_configuration(cls, previous_file):
        """
        Edits and exiting configuration file and builds a
        test video.
        """
        try:
            print("Editing configuration file {}".format(
                previous_file))

            config = Configuration(previous_file)
            config.new_configuration()

            print("Creating low-quality video as {}".format(
                config.output_video))
            print(
                "If video trimming needs to be adjusted, run the ",
                "Project CARS Replay Enhancer with the `-t` option.")
            print("\n")
            print(
                "To synchronize telemetry with video, run the ",
                "Project CARS Replay Enhancer with the `-r` option.")
            print(
                "Set the synchronization offset to the value shown ",
                "on the Timer when the viewed car crosses the start ",
                "finish line to begin lap 2.")

            try:
                replay = cls(config.config_file)
            except ValueError as error:
                print("Invalid JSON in configuration file: {}".format(
                    error))
            else:
                start_video = replay.build_default_video(False)
                end_video = replay.build_default_video(False)

                start_video = start_video.set_duration(
                    start_video.duration).subclip(0, 185)
                if replay.show_champion:
                    end_video = end_video.set_duration(
                        end_video.duration).subclip(
                            end_video.duration-120)
                else:
                    end_video = end_video.set_duration(
                        end_video.duration).subclip(
                            end_video.duration-100)
                output = mpy.concatenate_videoclips(
                    [start_video, end_video])
                output.write_videofile(
                    replay.output_video,
                    fps=10,
                    preset='superfast')

        except KeyboardInterrupt:
            raise