Skip to content

Commit d90d4a8

Browse files
committed
Add auto as the default for file format.
1 parent 0ca9ceb commit d90d4a8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

predict.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@ def predict(
7979
description="Rough size of clip output in MB.", ge=10, le=200, default=25
8080
),
8181
fileFormat: str = Input(
82-
description="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).",
82+
description="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.",
8383
choices=[
84+
"auto",
8485
"h264",
8586
"hevc",
8687
],
87-
default="h264",
88+
default="auto",
8889
),
8990
jwtToken: str = Input(
9091
description='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 .',
@@ -136,6 +137,13 @@ def predict(
136137
# Partition the data dir by the dongle ID from the route
137138
data_dir = os.path.join("./shared/data_dir", dongleID)
138139

140+
# If the file format is auto, set it to HEVC if the render type is 360
141+
if fileFormat == "auto":
142+
if renderType == "360" or renderType == "360_forward_upon_wide":
143+
fileFormat = "hevc"
144+
else:
145+
fileFormat = "h264"
146+
139147
if renderType == "ui":
140148
# Download the route data
141149
downloader.downloadSegments(

0 commit comments

Comments
 (0)