## Basic model info

Model name: nelsonjchen/op-replay-clipper
Model description: GPU accelerated replay renderer / video data clipper for comma.ai connect's openpilot route data. SEE README.


## Model inputs

- renderType (optional): UI renders with the comma openpilot UI. Forward, Wide, and Driver process the raw, segmented, and low-compatibility HEVC video files into a portable HEVC or H264 MP4 file, are fast transcodes, and are great for quick previews. 360 requires viewing/uploading the video file in VLC or YouTube to pan around in a 🌐 sphere or post-processing with software such as Insta360 Studio or similar software for reframing. Forward Upon Wide roughly overlays Forward video on Wide video for increased detail in Forward video. 360 Forward Upon Wide is 360 with Forward Upon Wide as the forward video and scales up to render at 8K for reframing with Insta360 Studio or similar software. (string)
- route (optional): One 🔗 comma connect URL (e.g. https://connect.comma.ai/18277b1abce7bbe4/00000029--e1c8705a52/132/144, this is the preferred input method and includes dongle ID with start/end times.) OR one #️⃣ route ID (e.g. a2a0ccea32023010|2023-07-27--13-01-19. Note that any segment ID "--" appended to the end will be ignored as"startSecond" is used instead, but route id portion of input will still accepted) (⚠️ "Public Access" must be enabled or a valid JWT Token must be provided. All required files for render type in Comma Connect must be uploaded from device. Please see the Quick Usage section of the README on GitHub at https://github.com/nelsonjchen/op-replay-clipper#quick-usage for instructions on generating an appropiate comma connect URL.) (string)
- startSeconds (optional): Start time in seconds for #️⃣ Route ID route input only. (🔗 comma connect URL already has the start time embedded in it and this input will be ignored in favor of that)  (integer)
- lengthSeconds (optional): Length of clip in seconds #️⃣ Route ID route input only. (🔗 comma connect URL already has the length time indirectly embedded in it from the embedded end time and this input will be ignored in favor of that. The minimum and maximum length will still be enforced) (integer)
- smearAmount (optional): (UI Render only) Smear amount (Let the video start this time before beginning recording, useful for making sure the radar triangle (△), if not present, is present to be rendered at the start if necessary) (integer)
- speedhackRatio (optional): (UI Render only) Speedhack ratio (Higher ratio renders faster but renders may be more unstable and have artifacts) (Suggestion: 0.1-0.3 for jitter-free, 1-3 for fast renders). WARNING: Too low of a speed hack ratio may cause the render to exceed 10 minutes which is the max Replicate will allow for a single run. Please use 1.0 for everyday use. (number)
- metric (optional): (UI Render only) Render in metric units (km/h) (boolean)
- forwardUponWideH (optional): (Forward Upon Wide Renders only) H-position of the forward video overlay on wide. Different devices can have different offsets from differing user mounting or factory calibration. (number)
- fileSize (optional): Rough size of clip output in MB. (integer)
- fileFormat (optional): Auto, H.264, or HEVC (HEVC is 50-60 percent higher quality for its filesize but may not be compatible with all web browsers or devices). Auto, which is recommended, will choose HEVC for 360 renders and H.264 for all other renders. (string)
- jwtToken (optional): Optional JWT Token from https://jwt.comma.ai for non-"Public access" routes. ⚠️ DO NOT SHARE THIS TOKEN WITH ANYONE as https://jwt.comma.ai generates JWT tokens valid for 90 days and they are irrevocable. Please use the safer, optionally temporary, more granular, and revocable "Public Access" toggle option on comma connect if possible. For more info, please see https://github.com/nelsonjchen/op-replay-clipper#jwt-token-input . (string)
- notes (optional): Notes Text field. Doesn't affect output. For your own reference. (string)


## Model output schema

{
  "type": "string",
  "title": "Output",
  "format": "uri"
}

If the input or output schema includes a format of URI, it is referring to a file.


## Example inputs and outputs

Use these example outputs to better understand the types of inputs the model accepts, and the types of outputs the model returns:

### Example (https://replicate.com/p/5aj544f9rnrgt0cenn4b5ax038)

#### Input

```json
{
  "notes": "",
  "route": "https://connect.comma.ai/a2a0ccea32023010/1690488131496/1690488151496",
  "metric": false,
  "fileSize": 25,
  "jwtToken": "",
  "renderType": "driver",
  "smearAmount": 5,
  "startSeconds": 50,
  "lengthSeconds": 20,
  "speedhackRatio": 1,
  "forwardUponWideH": 2.2
}
```

#### Output

```json
"https://replicate.delivery/pbxt/vj9QQ6WetKRaIKGDDr0F8NbeYx0frWngsB6bfvUJfeDPhj1pE/cog-clip.mp4"
```


## Model readme

> This isn't actually a machine learning model! 
> 
> It's a renderer for openpilot UI with their replay tool and to clip the raw video files to a desired size from their web service. Replicate's Nvidia GPUs are to be used to accelerate the UI rendering, video decoding, and encoding.
> 
> Please see the "Real" README:
> 
> https://github.com/nelsonjchen/op-replay-clipper/blob/master/README.md

