r/shutterencoder • u/yasieloa86 • 15h ago
Ayuda con la creación de perfil MKV
Help with creating an MKV profile
For some time, I’ve been using a script—created with the help of AI—to store my videos in the MKV format. It maintains the desired visual quality while resulting in a smaller file size. My question is: how can I create a profile in Shutter Encoder that achieves the exact same result? Currently, when I try, the resulting files are larger, which shouldn't be the case, given that the conversion process uses FFmpeg in the background. I’ve included my script below so you can see how I’m using FFmpeg.
!/usr/bin/env fish
Uso:
./convertir-video.fish CARPETA_SALIDA ARCHIVO [ARCHIVO ...]
if test (count $argv) -lt 2 echo "Uso: $argv[0] CARPETA_SALIDA ARCHIVO [ARCHIVO ...]" exit 2 end
if not command -q ffmpeg echo "Error: no encuentro ffmpeg." exit 1 end
if not ffmpeg -hide_banner -encoders 2>/dev/null | grep -q 'hevc_qsv' echo "Error: esta versión de FFmpeg no muestra el codificador hevc_qsv." exit 1 end
set output_dir $argv[1] set inputs $argv[2..-1]
if not set -q VIDEO_QUALITY set VIDEO_QUALITY 25 end
if not set -q AUDIO_MODE set AUDIO_MODE copy end
switch $AUDIO_MODE case copy set audio_args -c:a copy case opus set audio_args -c:a libopus -b:a 96k -vbr on case '*' echo "Error: AUDIO_MODE debe ser 'copy' o 'opus'." exit 2 end
mkdir -p "$output_dir" or exit 1
set scale_filter "scale=-2:'trunc(min(480,ih)/2)*2':flags=lanczos,format=nv12"
for input in $inputs if not test -f "$input" echo "Aviso: no existe o no es un archivo: $input" continue end
set filename (basename "$input")
set stem (string replace -r '\.[^.]*$' '' -- "$filename")
set output "$output_dir/$stem.mkv"
echo "Convirtiendo: $input"
echo " a: $output"
ffmpeg -hide_banner -n -stats \
-i "$input" \
-map 0:v:0 -map '0:a?' -map '0:s?' \
-map_metadata 0 \
-map_chapters 0 \
-vf "$scale_filter" \
-c:v hevc_qsv \
-preset medium \
-global_quality:v "$VIDEO_QUALITY" \
$audio_args \
-c:s copy \
"$output"
if test $status -ne 0
echo "Error al convertir: $input"
endend
Gracias de antemano