av1encode

This commit is contained in:
JMARyA 2025-06-14 18:46:07 +02:00
parent e8a57d883c
commit 61e2b5e1e6
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

24
functions/av1encode.fish Normal file
View file

@ -0,0 +1,24 @@
function av1encode
if test (count $argv) -lt 1
echo "Usage: av1encode <input-file> [crf] [preset]"
return 1
end
set input $argv[1]
set crf (or $argv[2] 28)
set preset (or $argv[3] 6)
set base (basename $input)
set name (string replace -r '\.[^.]+$' '' $base)
set output "$name.av1.mkv"
echo "Encoding: $input -> $output (CRF $crf, preset $preset)..."
ffmpeg -i "$input" \
-map 0 \
-c:v libsvtav1 -crf $crf -preset $preset \
-c:a libopus \
-c:s copy \
-movflags +faststart \
"$output"
end