@SET TITLE=%~1

mkdir "../%TITLE%/temp"

HandBrakeCLI -i "../%TITLE%/%TITLE% - 4k.mkv" -o "../%TITLE%/temp/handbrake.mkv" -f av_mkv -m -e x265_10bit --encoder-preset slower -q 20 --encoder-profile auto --all-audio -E copy --audio-copy-mask aac,eac3,dts,ac3,truehd,dtshd,mp3 --crop-mode auto --auto-anamorphic --all-subtitles > "../%TITLE%/temp/log.txt"

"%ProgramFiles%\MKVToolNix\mkvmerge.exe" --output "../%TITLE%/%TITLE% - 4k Subs.mkv" -S --no-chapters "../%TITLE%/temp/handbrake.mkv" --default-track-flag 0:no --language 0:en "../%TITLE%/%TITLE%.en.srt" -A -D -B -T -M --no-global-tags "../%TITLE%/temp/handbrake.mkv" >> "../%TITLE%/temp/log.txt"
