Hash video profile paths

This commit is contained in:
Abel Luck 2026-03-31 15:01:49 +02:00
parent 954608c5f9
commit 2ad0536bb0
5 changed files with 180 additions and 28 deletions

View file

@ -170,6 +170,10 @@ def _frame_rate(stream: Dict[str, Any]) -> Optional[str]:
return None
def _scale_to_max_height(max_height: int) -> str:
return f"scale=-2:{max_height}"
def audio_meta(probe: Dict[str, Any]) -> Optional[AudioMeta]:
stream = primary_audio_stream(probe)
if not stream:
@ -303,7 +307,7 @@ def video_transcode_params(
params = {"extension": settings["extension"]}
if len(passes) == 0 or is_vcodec:
if not is_good_height:
params["vf"] = f"scale={width}:{height}"
params["vf"] = _scale_to_max_height(max_height)
if not is_vcodec:
params.update(settings["ffmpeg_video_params"])
if not is_acodec or not is_audio_bitrate:
@ -313,7 +317,7 @@ def video_transcode_params(
for p in passes:
p = copy.deepcopy(p)
if not is_good_height:
p["vf"] = f"scale={width}:{height}"
p["vf"] = _scale_to_max_height(max_height)
params["passes"].append(p)
return params