Add one-click AV1/HEVC helper scripts (sh/bat)

This commit is contained in:
Stu Leak 2025-12-09 00:53:56 -05:00
parent b8ddbe17f6
commit 4089105b08
7 changed files with 151 additions and 0 deletions

View File

@ -0,0 +1,30 @@
@echo off
setlocal
REM VideoTools helper: AV1 1080p balanced encode (keeps audio/subs/metadata)
REM Usage: convert-av1-1080p-vt.bat "input.ext" "output.mkv"
if "%~1"=="" (
echo Usage: %~nx0 "input.ext" "output.mkv"
exit /b 1
)
set INPUT=%~1
set OUTPUT=%~2
if "%OUTPUT%"=="" (
REM auto-name
set OUTPUT=%~dpn1-av1-1080p.mkv
)
ffmpeg -y -hide_banner -loglevel error ^
-i "%INPUT%" ^
-map 0 ^
-c:v libaom-av1 -b:v 1400k -cpu-used 4 -row-mt 1 -pix_fmt yuv420p ^
-c:a copy -c:s copy -c:d copy ^
"%OUTPUT%"
if %ERRORLEVEL% equ 0 (
echo Done: "%OUTPUT%"
) else (
echo Encode failed. Check above ffmpeg output.
)
endlocal

View File

@ -0,0 +1,29 @@
@echo off
setlocal
REM VideoTools helper: H.265/HEVC 1080p balanced encode (keeps audio/subs/metadata)
REM Usage: convert-hevc-1080p-vt.bat "input.ext" "output.mkv"
if "%~1"=="" (
echo Usage: %~nx0 "input.ext" "output.mkv"
exit /b 1
)
set INPUT=%~1
set OUTPUT=%~2
if "%OUTPUT%"=="" (
set OUTPUT=%~dpn1-hevc-1080p.mkv
)
ffmpeg -y -hide_banner -loglevel error ^
-i "%INPUT%" ^
-map 0 ^
-c:v libx265 -preset slow -b:v 2000k -pix_fmt yuv420p ^
-c:a copy -c:s copy -c:d copy ^
"%OUTPUT%"
if %ERRORLEVEL% equ 0 (
echo Done: "%OUTPUT%"
) else (
echo Encode failed. Check above ffmpeg output.
)
endlocal

View File

@ -0,0 +1,29 @@
@echo off
setlocal
REM VideoTools helper: H.265/HEVC lossless (CRF 0) re-encode; keeps audio/subs/metadata
REM Usage: convert-hevc-lossless-vt.bat "input.ext" "output.mkv"
if "%~1"=="" (
echo Usage: %~nx0 "input.ext" "output.mkv"
exit /b 1
)
set INPUT=%~1
set OUTPUT=%~2
if "%OUTPUT%"=="" (
set OUTPUT=%~dpn1-hevc-lossless.mkv
)
ffmpeg -y -hide_banner -loglevel error ^
-i "%INPUT%" ^
-map 0 ^
-c:v libx265 -preset slow -crf 0 -x265-params lossless=1 -pix_fmt yuv420p ^
-c:a copy -c:s copy -c:d copy ^
"%OUTPUT%"
if %ERRORLEVEL% equ 0 (
echo Done: "%OUTPUT%"
) else (
echo Encode failed. Check above ffmpeg output.
)
endlocal

0
scripts/clear-go-cache.sh Normal file → Executable file
View File

21
scripts/convert-av1-1080p-vt.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# VideoTools helper: AV1 1080p balanced encode (keeps audio/subs/metadata)
# Usage: ./convert-av1-1080p-vt.sh "input.ext" ["output.mkv"]
set -e
if [ -z "$1" ]; then
echo "Usage: $0 input.ext [output.mkv]"
exit 1
fi
in="$1"
out="${2:-${1%.*}-av1-1080p.mkv}"
ffmpeg -y -hide_banner -loglevel error \
-i "$in" \
-map 0 \
-c:v libaom-av1 -b:v 1400k -cpu-used 4 -row-mt 1 -pix_fmt yuv420p \
-c:a copy -c:s copy -c:d copy \
"$out"
echo "Done: $out"

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# VideoTools helper: H.265/HEVC 1080p balanced encode (keeps audio/subs/metadata)
# Usage: ./convert-hevc-1080p-vt.sh "input.ext" ["output.mkv"]
set -e
if [ -z "$1" ]; then
echo "Usage: $0 input.ext [output.mkv]"
exit 1
fi
in="$1"
out="${2:-${1%.*}-hevc-1080p.mkv}"
ffmpeg -y -hide_banner -loglevel error \
-i "$in" \
-map 0 \
-c:v libx265 -preset slow -b:v 2000k -pix_fmt yuv420p \
-c:a copy -c:s copy -c:d copy \
"$out"
echo "Done: $out"

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# VideoTools helper: H.265/HEVC lossless (CRF 0) re-encode; keeps audio/subs/metadata
# Usage: ./convert-hevc-lossless-vt.sh "input.ext" ["output.mkv"]
set -e
if [ -z "$1" ]; then
echo "Usage: $0 input.ext [output.mkv]"
exit 1
fi
in="$1"
out="${2:-${1%.*}-hevc-lossless.mkv}"
ffmpeg -y -hide_banner -loglevel error \
-i "$in" \
-map 0 \
-c:v libx265 -preset slow -crf 0 -x265-params lossless=1 -pix_fmt yuv420p \
-c:a copy -c:s copy -c:d copy \
"$out"
echo "Done: $out"