# Project CARS Replay Enhancer Combines telemetry data with replay video to improve Project CARS replays.
Current release: 0.3 Current edge state: Less Rough Current mood: Nervous
The Project CARS Replay Enhancer (I’d call it PCRE, [but that’s taken](http://www.pcre.org/ “PCRE”)) is intended to augment Project CARS replays by combining captured telemetry data with replay video. The current state of the project is still somewhat rough, but it should be usable without extensive technical knowledge.
The scripts are currently not fast enough for live broadcasting.
## Requirements * [Python 3.4](https://www.python.org/download/releases/3.4.0/ “Python 3.4.0”) or greater * [MoviePy](http://zulko.github.io/moviepy/ “MoviePy”) * [natsort](https://pypi.python.org/pypi/natsort “natsort”) * [NumPy](http://www.numpy.org/ “NumPy”) * [Pillow](https://pypi.python.org/pypi/Pillow “Pillow”)
## Usage ###Telemetry Capture: Telemetry packet capture is performed by running the packetgrab.py script on the network. This captures UDP packets broadcast by Project CARS (make sure you’ve enabled UDP broadcast) and store them to a subdirectory for future processing.
> NOTE: As most internet video runs at 30 frames per second, you want to set your UDP broadcast rate to at least 30 packets per second, otherwise there may be noticeable “phasing” between video and data displays.
####Telemetry Capture Best Practices: There are a few things to do to optimize the telemetry data used by the Project CARS Replay Enhancer.
###Video Capture: There is no video capture functionality included in the scripts. How you get the video to your local machine is left as an exercise for the reader. For my PS4, I stream the replay to YouTube which then archives it and then can be downloaded using [youtube-dl](https://rg3.github.io/youtube-dl/ “youtube-dl”). Video capture devices such as an Elgato work just fine as well (probably better, actually).
See the configuration file for some details on when the video should stop and start, and how to sync the video to the telemetry.
###Getting Started: To create a new configuration file, run the Project CARS Replay Enhancer with no command line arguments: python3 ReplayEnhancer.py.
To edit an existing configuration file, or use an existing configuration file as the defaults for a new configuration file, run the Project CARS Replay Enhancer with the -c option and the name of the configuration file: python3 ReplayEnhancer.py -c config_file.json
Once the configuration file is completed, the Project CARS Replay Enhancer creates a low-quality, shortened video. This video can be used to confirm the title, results, standings, and–if enabled–champion screens, as well as the video trimming.
To adjust the video trimming, run the Project CARS Replay Enhancer with the -t option and the name of the configuration file: python3 ReplayEnhancer.py -t config_file.json. The trimming parameters are adjusted and another low-quality, shortened video is created to confirm the trimming.
> NOTE: If you have previously set a telemetry synchronization value (see below), it will be reset to 0.0 if either the detection parameters or start trimming parameters are changed.
To adjust the telemetry synchronization, run the Project CARS Replay Enhancer with the -r option and the name of the configuration file: python3 ReplayEnhancer.py -r config_file.json. To determine the telemetry synchronization value, view the time on the timer when the subject car crosses the start-finish line to begin Lap #2. * If the timer shows Lap 2 has already begun, the telemetry needs to start later. Add the amount of time on the timer to the telemetry synchronization value. (This is the typical scenario.) * If the timer shows Lap 1 is still in progress, the telemetry needs to start sooner. Subtract the difference between the time on the timer and the time of Lap 1 (obtainable from the standings display) from the telemetry synchronization value. After adjusting the telemetry synchronization, another low-quality, shortened video is created to confirm the synchronization.
Once the configuration is complete, create the full-length, full-quality video by providing the Project CARS Replay Enhancer with the configuration file, and no options: python3 ReplayEnhancer.py config_file.json.
##Enhancing the Enhancer? You’re more than welcome to do so! Write new modules, speed up new modules, feel free. If you have any issues or questions please communicate them here!
TODO: Figure out how to actually get changelog content.
Changelog content for this version goes here.