Last active
June 27, 2023 07:30
-
-
Save wincmd64/bf2d84fbcc847b8db701bb8d9ed06dfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Пакетная конвертация видеофайлов с помощью пресетов HandBrake | |
:: https://t.me/wincmd64 | |
:: ИСПОЛЬЗОВАНИЕ: | |
:: 1. сохранить код в .bat-файл и поместить рядов с HandBrakeCLI.exe | |
:: 2. создать ярлык на .bat-файл в папке Shell:SendTo | |
:: 3. выделить нужные видеофайлы и выбрать в контекстном меню пункт Отправить > *имя_ярлыка* | |
:: 4. выбрать в открывшимся окне нужный пресет и дождаться окончания конвертации | |
:: HandBrakeCLI.exe -- https://handbrake.fr/downloads2.php | |
:: presets -- https://handbrake.fr/docs/en/latest/technical/official-presets.html | |
@echo off | |
echo. | |
echo [ Choose HandBrake preset ] | |
echo. | |
echo General: 1 = Very Fast 1080p30 Web: a = Creator 2160p60 4K | |
echo 2 = Very Fast 720p30 s = Creator 1440p60 2.5K | |
echo 3 = Very Fast 576p25 d = Creator 1080p60 | |
echo 4 = Very Fast 480p30 f = Creator 720p60 | |
echo 5 = Fast 1080p30 [default] g = Email 25 MB 3 Minutes 720p30 | |
echo 6 = Fast 720p30 h = Email 25 MB 5 Minutes 480p30 | |
echo 7 = Fast 576p25 j = Email 25 MB 10 Minutes 288p30 | |
echo 8 = Fast 480p30 z = Social 100 MB 5 Minutes 1080p30 | |
echo q = HQ 1080p30 x = Social 50 MB 5 Minutes 720p30 | |
echo w = HQ 720p30 c = Social 50 MB 10 Minutes 480p30 | |
echo e = HQ 576p25 v = Social 8 MB 3 Minutes 360p30 | |
echo r = HQ 480p30 | |
SET preset=Fast 1080p30 | |
SET /p choice=Enter: | |
if %choice%==1 SET preset=Very Fast 1080p30 | |
if %choice%==2 SET preset=Very Fast 720p30 | |
if %choice%==3 SET preset=Very Fast 576p25 | |
if %choice%==4 SET preset=Very Fast 480p30 | |
if %choice%==5 SET preset=Fast 1080p30 | |
if %choice%==6 SET preset=Fast 720p30 | |
if %choice%==7 SET preset=Fast 576p25 | |
if %choice%==8 SET preset=Fast 480p30 | |
if %choice%==q SET preset=HQ 1080p30 Surround | |
if %choice%==w SET preset=HQ 720p30 Surround | |
if %choice%==e SET preset=HQ 576p25 Surround | |
if %choice%==r SET preset=HQ 480p30 Surround | |
if %choice%==a SET preset=Creator 2160p60 4K | |
if %choice%==s SET preset=Creator 1440p60 2.5K | |
if %choice%==d SET preset=Creator 1080p60 | |
if %choice%==f SET preset=Creator 720p60 | |
if %choice%==g SET preset=Email 25 MB 3 Minutes 720p30 | |
if %choice%==h SET preset=Email 25 MB 5 Minutes 480p30 | |
if %choice%==j SET preset=Email 25 MB 10 Minutes 288p30 | |
if %choice%==z SET preset=Social 100 MB 5 Minutes 1080p30 | |
if %choice%==x SET preset=Social 50 MB 5 Minutes 720p30 | |
if %choice%==c SET preset=Social 50 MB 10 Minutes 480p30 | |
if %choice%==v SET preset=Social 8 MB 3 Minutes 360p30 | |
TITLE %preset% | |
FOR %%k IN (%*) DO ( | |
echo. | |
echo FILE: %%k [%%~tk] | |
if exist "%~dp0HandBrakeCLI.exe" ("%~dp0HandBrakeCLI.exe" -v0 -Z "%preset%" -E copy -i %%k -o "%%~dpnk_%preset%.mp4") | |
FOR /f "tokens=1-5 delims=.-/: " %%m IN ("%%~tk") DO (powershell "Get-ChildItem '%%~dpnk_%preset%.mp4' | ForEach-Object{$_.CreationTime = $_.LastWriteTime = $_.LastAccessTime = New-Object DateTime %%o,%%n,%%m,%%p,%%q,00}") | |
) | |
color 27 | |
timeout 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment