From 7ebac29b3f10e166476e2b2f44c891de619886b7 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Fri, 16 Jan 2026 22:22:43 +0100 Subject: [PATCH] extend video2av1 function --- modules/transcode.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/transcode.nix b/modules/transcode.nix index 92f44ef..72b4541 100644 --- a/modules/transcode.nix +++ b/modules/transcode.nix @@ -17,14 +17,15 @@ } function video2av1() { - local dir="''${1:-.}" + local height="''${1:-720}" + local dir="''${2:-.}" for f in "$dir"/**/*.(mp4|mkv|avi); do if [[ -f "$f" ]]; then local outfile="./transcode/''${f%.*}.mkv" mkdir -p "$(dirname "$outfile")" ffmpeg -i "$f" \ -c:v libsvtav1 -crf 30 -preset 6 \ - -vf "scale='min(480,iw)':-2" \ + -vf "scale=-2:'min($height,ih)'" \ -c:a copy \ "$outfile" fi