From 2c3c189ddd498ec7b8ec23fd48e176faa9fa3490 Mon Sep 17 00:00:00 2001 From: keerah <9025818+keerah@users.noreply.github.com> Date: Mon, 13 Feb 2023 05:55:38 -0500 Subject: [PATCH] Release 3 Image sequence input support Structural overhaul Presets overhaul --- sendtoffmpeg_encoder01.cmd | 53 ++++++++ sendtoffmpeg_encoder02.cmd | 63 +++++++++ sendtoffmpeg_settings.cmd | 55 +++++--- to APNG forever loop.bat | 123 ++++++++++++------ to CUDA h264 mp4 420 10Mbit aac128.bat | 90 ++++++------- to CUDA h264 mp4 420 10Mbit copy.bat | 68 ++++++++++ to CUDA h264 mp4 420 10Mbit.bat | 68 ---------- to CUDA h264 mp4 420 1Mbit copy.bat | 68 ++++++++++ to CUDA h264 mp4 420 1Mbit.bat | 67 ---------- to CUDA h264 mp4 420 20Mbit aac192.bat | 89 +++++++------ to CUDA h264 mp4 420 20Mbit.bat | 68 ---------- to CUDA h264 mp4 420 2Mbit aac96.bat | 90 ++++++------- ...264 mp4 420 40Mbit external wav aac256.bat | 65 ++++----- to CUDA h264 mp4 420 40Mbit external wav.bat | 71 ---------- to CUDA h264 mp4 420 40Mbit.bat | 67 ---------- to CUDA h264 mp4 420 4Mbit aac96.bat | 90 ++++++------- to CUDA h264 mp4 420 4Mbit copy.bat | 68 ++++++++++ to CUDA h264 mp4 420 4Mbit.bat | 68 ---------- to EXR squarifier.bat | 112 ++++++++++++++++ to HQ Gif 1080px 25fps.bat | 105 ++++++++------- to HQ Gif 120px 10fps.bat | 101 +++++++------- to HQ Gif 16 640px 10fps.bat | 106 +++++++-------- to HQ Gif 304px 15fps.bat | 75 ----------- to HQ Gif 304px 30fps.bat | 72 ++++++++++ to HQ Gif 32 320px 10fps.bat | 105 ++++++++------- ... 15fps.bat => to HQ Gif 32 616px 10fps.bat | 88 +++++++++---- to HQ Gif 32 640px 10fps.bat | 105 ++++++++------- to HQ Gif 420px 10fps.bat | 101 +++++++------- to HQ Gif 420px 15fps.bat | 105 ++++++++------- to HQ Gif 64 640px 15fps.bat | 105 ++++++++------- to HQ Gif 640px 15fps.bat | 105 ++++++++------- to HQ Gif 640px 24fps.bat | 105 ++++++++------- to HQ Gif 640px 25fps.bat | 105 ++++++++------- to Hap.bat | 64 --------- to JPEG q10.bat | 83 ++++++------ to JPEG q100.bat | 85 ++++++------ to JPEG q40.bat | 83 ++++++------ to JPEG q90.bat | 85 ++++++------ to PNG hi.bat | 85 ++++++------ to PNG low 400px width.bat | 85 ++++++------ to PNG low.bat | 85 ++++++------ to h264 mp4 420 baseline L3 high 20 film.bat | 91 ++++++------- to h264 mp4 420 high 20 film aac256.bat | 91 ++++++------- to h264 mp4 420 high 25 film aac192.bat | 91 ++++++------- to h264 mp4 420 high 30 film aac256.bat | 91 ++++++------- to h264 mp4 420 very high 14 film aac256.bat | 91 ++++++------- ...y high 14 film scale lanczos 1080 copy.bat | 69 ++++++++++ ...0 very high 14 film scale lanczos 1080.bat | 64 --------- ... high 14 film scale lanczos 540 aac128.bat | 63 --------- ... high 14 film scale lanczos 640 aac128.bat | 68 ++++++++++ to h264 mp4 420 very high 14 film.bat | 64 --------- to h264 mp4 420 very high 16 film aac256.bat | 91 ++++++------- ... high 16 film scale lanczos 720 aac256.bat | 87 +++++++------ to h264 mp4 420 very high 18 film aac256.bat | 67 ++++++++++ to h264 mp4 420 very high 18 film.bat | 63 --------- ... high 20 film scale lanczos 540 aac128.bat | 87 +++++++------ 56 files changed, 2369 insertions(+), 2290 deletions(-) create mode 100644 sendtoffmpeg_encoder01.cmd create mode 100644 sendtoffmpeg_encoder02.cmd create mode 100644 to CUDA h264 mp4 420 10Mbit copy.bat delete mode 100644 to CUDA h264 mp4 420 10Mbit.bat create mode 100644 to CUDA h264 mp4 420 1Mbit copy.bat delete mode 100644 to CUDA h264 mp4 420 1Mbit.bat delete mode 100644 to CUDA h264 mp4 420 20Mbit.bat delete mode 100644 to CUDA h264 mp4 420 40Mbit external wav.bat delete mode 100644 to CUDA h264 mp4 420 40Mbit.bat create mode 100644 to CUDA h264 mp4 420 4Mbit copy.bat delete mode 100644 to CUDA h264 mp4 420 4Mbit.bat create mode 100644 to EXR squarifier.bat delete mode 100644 to HQ Gif 304px 15fps.bat create mode 100644 to HQ Gif 304px 30fps.bat rename to HQ Gif 616px 15fps.bat => to HQ Gif 32 616px 10fps.bat (51%) delete mode 100644 to Hap.bat create mode 100644 to h264 mp4 420 very high 14 film scale lanczos 1080 copy.bat delete mode 100644 to h264 mp4 420 very high 14 film scale lanczos 1080.bat delete mode 100644 to h264 mp4 420 very high 14 film scale lanczos 540 aac128.bat create mode 100644 to h264 mp4 420 very high 14 film scale lanczos 640 aac128.bat delete mode 100644 to h264 mp4 420 very high 14 film.bat create mode 100644 to h264 mp4 420 very high 18 film aac256.bat delete mode 100644 to h264 mp4 420 very high 18 film.bat diff --git a/sendtoffmpeg_encoder01.cmd b/sendtoffmpeg_encoder01.cmd new file mode 100644 index 0000000..6dddec3 --- /dev/null +++ b/sendtoffmpeg_encoder01.cmd @@ -0,0 +1,53 @@ +REM This is one of the SenTo FFmpeg modular transcoders, keep it with the rest of the files + +ECHO [----------------------------------------------------------------------------------------] +ECHO [ %argCount% files queued to encode + +FOR /L %%i IN (1,1,%argCount%) DO ( + + ECHO [----------------------------------------------------------------------------------------] + + SET "vlen=" + FOR /F "tokens=* delims=" %%f IN ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argFile[%%i].name!"') DO SET "vlen=%%f" + + IF !vlen! == N/A ( + ECHO [ The source is a single image file with no length + + IF !imgseq! GTR 0 ( + REM detecting image sequence + IF !frcounter! GTR 0 ( + REM detecting the counter in the end of the filename + SET "basename=!argFile[%%i].trname:~0,-%frcounter%!" + SET "countername=!argFile[%%i].trname:~-%frcounter%!" + FOR /F "tokens=* delims=0" %%N IN ("!countername!") DO SET /A frnumber=%%N + IF !frnumber! GTR 0 ( + SET "argFile[%%i].name=!argFile[%%i].path!!basename!%%0!frcounter!d!argFile[%%i].ext!" + ECHO [ Image sequence detected ] + ECHO [ Basename: "!basename!" Start frame: !frnumber! Pattern: "!basename!%%0!frcounter!d" + SET "wset.seqfr=-framerate %fps% -start_number !frnumber! -pattern_type sequence" + SET "wset.seqfrout=-r %fps%" + REM No audio assumed + SET "wset.audiocomp=" + ) ELSE ( + SET "wset.seqfr=" + SET "wset.seqfrout=" + ) + ) ELSE ( + REM detecting the counter after first found dot + REM No implementation yet + ) + ) ELSE ( + SET "wset.seqfr=" + SET "wset.seqfrout=" + ) + ) ELSE ( + ECHO [ Video length is: !vlen! seconds + ) + + ECHO [ Transcoding %%i of %argCount%: !argFile[%%i].trname! + "%ffpath%ffmpeg.exe" !wset.params! !wset.seqfr! -i "!argFile[%%i].name!" !wset.videocomp! !wset.audiocomp! !wset.seqfrout! !wset.over! "!argFile[%%i].trname!"!wset.suff! +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [ SERVED ] +ECHO [----------------------------------------------------------------------------------------] diff --git a/sendtoffmpeg_encoder02.cmd b/sendtoffmpeg_encoder02.cmd new file mode 100644 index 0000000..9aa099f --- /dev/null +++ b/sendtoffmpeg_encoder02.cmd @@ -0,0 +1,63 @@ +REM This is one of the SenTo FFmpeg modular transcoders, keep it with the rest of the files + +ECHO [----------------------------------------------------------------------------------------] +ECHO [ %argCount% files queued to encode + +FOR /L %%i IN (1,1,%argCount%) DO ( + + ECHO [----------------------------------------------------------------------------------------] + + SET "vlen=" + FOR /F "tokens=* delims=" %%f IN ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argFile[%%i].name!"') DO SET "vlen=%%f" + + IF !vlen! == N/A ( + ECHO [ The source is a single image file with no length + + IF !imgseq! GTR 0 ( + REM detecting image sequence + IF !frcounter! GTR 0 ( + REM detecting the counter in the end of the filename + SET "basename=!argFile[%%i].trname:~0,-%frcounter%!" + SET "countername=!argFile[%%i].trname:~-%frcounter%!" + FOR /F "tokens=* delims=0" %%N IN ("!countername!") DO SET /A frnumber=%%N + IF !frnumber! GTR 0 ( + REM overwrite default framerate setting with the preset's one + SET /A fps=%wset.fps% + SET "argFile[%%i].name=!argFile[%%i].path!!basename!%%0!frcounter!d!argFile[%%i].ext!" + ECHO [ Image sequence detected ] + ECHO [ Basename: "!basename!" Start frame: !frnumber! Pattern: "!basename!%%0!frcounter!d" + SET "wset.seqfr=-framerate %fps% -start_number !frnumber! -pattern_type sequence" + REM No audio assumed + SET "wset.audiocomp=" + ) ELSE ( + REM No sequence, no pattern + SET "wset.seqfr=" + SET "wset.seqfrout=" + ) + ) ELSE ( + REM detecting the counter after first found dot + REM No implementation yet + ) + ) ELSE ( + SET "wset.seqfr=" + SET "wset.seqfrout=" + ) + ) ELSE ( + echo [ Video length is: !vlen! seconds + ) + + ECHO [ Encoding file %%i of %argCount% + ECHO [ STAGE 1: Generating a palette ] + "%ffpath%ffmpeg.exe" !wset.params! !wset.seqfr! -i "!argFile[%%i].name!" !wset.prepass! !wset.seqfrout! -y "!argFile[%%i].trname!"palette.png + + ECHO [----------------------------------------------------------------------------------------] + ECHO [ Encoding file %%i of %argCount% + ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] + "%ffpath%ffmpeg.exe" !wset.params! !wset.seqfr! -i "!argFile[%%i].name!" -i "!argFile[%%i].trname!"palette.png !wset.videocomp! !wset.over! "!argFile[%%i].trname!"!wset.suff! + + IF EXIST "!argFile[%%i].trname!palette.png" DEL /s "!argFile[%%i].trname!palette.png" > nul +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [ SERVED ] +ECHO [----------------------------------------------------------------------------------------] \ No newline at end of file diff --git a/sendtoffmpeg_settings.cmd b/sendtoffmpeg_settings.cmd index f10674e..3309277 100644 --- a/sendtoffmpeg_settings.cmd +++ b/sendtoffmpeg_settings.cmd @@ -1,23 +1,46 @@ -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2022 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg REM This is a SendTo_FFmpeg settings file -REM You need to be careful here, cause it's an executable part of the script for each preset +rem You have to be careful here, cause it's an executable part of the scripts +rem Scripts won't be able to run without this file nearby. -REM If you copy of this file to the folder of your source files, then these localized settings -REM will be used for transcoding all files inside this folder instead of the global settings -REM For example, you can disable the pause after processing or reduce verbose level to errors only -REM for a particular folder only. +REM If you copy this file to the folder of your source files +REM then these "localized" settings will be used for transcoding +REM of the files inside this folder instead of the global settings. +REM For example, you can disable the descriptive name suffixes, +REM use another default framerate or even use another FFmpeg version +REM for a particular folder only -rem Path to ffmpeg.exe -set "ffpath=c:\Program Files\ffmpeg\bin\" +SET "ffpath=c:\Program Files\ffmpeg\bin\" +REM Path to ffmpeg.exe +REM will also look for exiftool.exe here when needed -rem FFmpeg verbosity level, use "info" for full verbosity or "error" for errors only -set "vbl=warning" +SET "vbl=warning" +REM FFmpeg verbosity level +REM "info" for full verbosity, "warning" for all important messaes, "error" for errors only -rem Enable pause after encoding, any positive value enables the pause -set /A pse=1 +SET /A pse=1 +REM Enable pause after encoding +REM Any positive value enables the pause -rem Descriptive naming for output files, any positive value enables description -set /A dscr=1 \ No newline at end of file +SET /A dscr=1 +REM Descriptive naming for output files +REM Any positive value enables filename suffixes + +SET /A quietover=1 +REM Quiet overwrite +REM If it is set to 1, the output files will be always overwritten + +SET /A fps=30 +REM Default framerate for image seuences + +SET /A imgseq=1 +REM Consider image sequences +REM if 0 then ffmpeg won't look for image sequences containing the selected file + +SET /A frcounter=4 +REM Frame counter digits +REM The number of digits in the frame counter to detect (leading zeroes assumed) +REM If set to 0, the scripts will search for the counter after the first dot in the filename +REM taking all digits available (future feature) \ No newline at end of file diff --git a/to APNG forever loop.bat b/to APNG forever loop.bat index a4f3eca..61eda3d 100644 --- a/to APNG forever loop.bat +++ b/to APNG forever loop.bat @@ -1,63 +1,108 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi APNG module has been invoked ---] -ECHO [--- Preset: plain, loop forever ---] +IF %argCount% LEQ 0 ( + ECHO [-----------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: APNG plain, loop forever ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) -IF %dscr% GTR 0 (SET "dscrName=_animpng") ELSE (SET "dscrName=") +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-f apng -plays 0" +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_animpng") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.png" + +ECHO [-----------------------------------------------------------------------------------] +ECHO [ %argCount% files queued to encode FOR /L %%i IN (1,1,%argCount%) DO ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! + ECHO [-----------------------------------------------------------------------------------] - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f + FOR /F "tokens=* delims=" %%f IN ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argFile[%%i].name!"') DO SET "vlen=%%f" - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -f apng -plays 0 -y "!argVn[%%i]!%dscrName%.png" -) + IF !vlen! NEQ "N/A" ( + ECHO [ The source is a single image file with no length + + IF !imgseq! GTR 0 ( + REM detecting image sequence + IF !frcounter! GTR 0 ( + REM detecting the counter in the end of the filename + SET "basename=!argFile[%%i].trname:~0,-%frcounter%!" + SET "countername=!argFile[%%i].trname:~-%frcounter%!" + FOR /F "tokens=* delims=0" %%N IN ("!countername!") DO SET /A frnumber=%%N + IF !frnumber! GTR 0 ( + SET "argFile[%%i].name=!argFile[%%i].path!!basename!%%0!frcounter!d!argFile[%%i].ext!" + ECHO [ Image sequence detected ] + ECHO [ Basename: "!basename!" Start frame: !frnumber! Pattern: "!basename!%%0!frcounter!d" + SET "seqfr=-framerate %fps% -start_number !frnumber! -pattern_type sequence" + SET "seqfrout=-r %fps%" + ) ELSE ( + SET "seqfr=" + SET "seqfrout=" + ) + ) ELSE ( + REM detecting the counter after first found dot + REM No implementation yet + ) + ) ELSE ( + SET "seqfr=" + SET "seqfrout=" + ) + ) ELSE ( + echo [ Video length is: !vlen! seconds + ) -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] + ECHO [ Transcoding %%i of %argCount%: !argFile[%%i].trname! + "%ffpath%ffmpeg.exe" !wset.params! !seqfr! -i "!argFile[%%i].name!" !wset.videocomp! !wset.audiocomp! !seqfrout! !wset.over! "!argFile[%%i].trname!"!wset.suff! +) -if %pse% GTR 0 PAUSE +ECHO [-----------------------------------------------------------------------------------] +ECHO [ SERVED ] +ECHO [-----------------------------------------------------------------------------------] -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it \ No newline at end of file +:End +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to CUDA h264 mp4 420 10Mbit aac128.bat b/to CUDA h264 mp4 420 10Mbit aac128.bat index e6aaa35..ddc82aa 100644 --- a/to CUDA h264 mp4 420 10Mbit aac128.bat +++ b/to CUDA h264 mp4 420 10Mbit aac128.bat @@ -1,67 +1,67 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: CUDA 420, slow, 10 Mbps, kf 2 sec, Audio aac128 ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 CUDA 420, slow, 10 Mbps, kf 2 sec, Audio aac128 ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_cuda420_10Mbit_aac128") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v h264_nvenc -preset slow -b:v 10M -pix_fmt yuv420p -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 128k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_cuda_10Mbit_aac128") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v h264_nvenc -preset slow -b:v 10M -pix_fmt yuv420p -force_key_frames 0:00:02 -c:a aac -b:a 128k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description insite it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 10M argument, which defines the bitrate for the output. -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to CUDA h264 mp4 420 10Mbit copy.bat b/to CUDA h264 mp4 420 10Mbit copy.bat new file mode 100644 index 0000000..2c45bf7 --- /dev/null +++ b/to CUDA h264 mp4 420 10Mbit copy.bat @@ -0,0 +1,68 @@ +@ECHO OFF +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg + +setlocal enabledelayedexpansion + +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" +) + +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 CUDA 420, slow, 10 Mbps, kf 2 sec, Audio copy ---] + +SET "cmdp=%~dp0" +SET "argp=%~dp1" + +REM get settings +IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( + CALL "%argp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! +) ELSE ( + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) +) + +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End +) + + +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v h264_nvenc -preset slow -b:v 10M -pix_fmt yuv420p -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a copy -y" + REM This one simply copies the source audio stream, be aware, that not every audio can be fed into mp4, no pcm, yes aac +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_cuda_4Mbit_aac96") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" + +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End +) + +:End +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to CUDA h264 mp4 420 10Mbit.bat b/to CUDA h264 mp4 420 10Mbit.bat deleted file mode 100644 index acd834b..0000000 --- a/to CUDA h264 mp4 420 10Mbit.bat +++ /dev/null @@ -1,68 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: CUDA 420, slow, 10 Mbps, keyfr 2 sec, Audio Copy ---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_cuda420_10Mbit") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v h264_nvenc -preset slow -b:v 10M -pix_fmt yuv420p -force_key_frames 0:00:02 -c:a copy -y "!argVn[%%i]!%dscrName%.mp4" -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description insite it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 10M argument, which defines the bitrate for the output. -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to CUDA h264 mp4 420 1Mbit copy.bat b/to CUDA h264 mp4 420 1Mbit copy.bat new file mode 100644 index 0000000..b58f440 --- /dev/null +++ b/to CUDA h264 mp4 420 1Mbit copy.bat @@ -0,0 +1,68 @@ +@ECHO OFF +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg + +setlocal enabledelayedexpansion + +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" +) + +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 CUDA 420, slow, 1 Mbps, kf 2 sec, Audio Copy ---] + +SET "cmdp=%~dp0" +SET "argp=%~dp1" + +REM get settings +IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( + CALL "%argp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! +) ELSE ( + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) +) + +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End +) + + +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v h264_nvenc -b:v 1M -pix_fmt yuv420p -preset slow -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a copy -y" + REM This one simply copies the source audio stream, be aware, that not every audio can be fed into mp4, no pcm, yes aac +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_cuda_1Mbit") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" + +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End +) + +:End +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to CUDA h264 mp4 420 1Mbit.bat b/to CUDA h264 mp4 420 1Mbit.bat deleted file mode 100644 index 1b73418..0000000 --- a/to CUDA h264 mp4 420 1Mbit.bat +++ /dev/null @@ -1,67 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: CUDA 420, slow, 1 Mbps, kf 2 sec, Audio Copy ---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_cuda420_1Mbit") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v h264_nvenc -b:v 1M -pix_fmt yuv420p -preset slow -force_key_frames 0:00:02 -c:a copy -y "!argVn[%%i]!%dscrName%.mp4" -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description insite it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 1M argument, which defines the bitrate for the output. -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to CUDA h264 mp4 420 20Mbit aac192.bat b/to CUDA h264 mp4 420 20Mbit aac192.bat index 807917a..e335a3a 100644 --- a/to CUDA h264 mp4 420 20Mbit aac192.bat +++ b/to CUDA h264 mp4 420 20Mbit aac192.bat @@ -1,68 +1,67 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: CUDA 420, slow, 20 Mbps, kf 2 sec, Audio aac192 ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 CUDA 420, slow, 20 Mbps, kf 2 sec, Audio aac192 ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) -IF %dscr% GTR 0 (SET "dscrName=_cuda420_20Mbit_aac192") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v h264_nvenc -preset slow -b:v 20M -pix_fmt yuv420p -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 192k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_cuda_20Mbit_aac192") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v h264_nvenc -preset slow -b:v 20M -pix_fmt yuv420p -force_key_frames 0:00:02 -c:a aac -b:a 192k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description insite it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 20M argument, which defines the bitrate for the output. -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to CUDA h264 mp4 420 20Mbit.bat b/to CUDA h264 mp4 420 20Mbit.bat deleted file mode 100644 index 25574ac..0000000 --- a/to CUDA h264 mp4 420 20Mbit.bat +++ /dev/null @@ -1,68 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: CUDA 420, slow, 20 Mbps, kf 2 sec, Audio Copy ---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_cuda420_20Mbit") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v h264_nvenc -preset slow -b:v 20M -pix_fmt yuv420p -force_key_frames 0:00:02 -c:a copy -y "!argVn[%%i]!%dscrName%.mp4" -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 20M argument, which defines the bitrate for the output. -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to CUDA h264 mp4 420 2Mbit aac96.bat b/to CUDA h264 mp4 420 2Mbit aac96.bat index bb7d552..a36289f 100644 --- a/to CUDA h264 mp4 420 2Mbit aac96.bat +++ b/to CUDA h264 mp4 420 2Mbit aac96.bat @@ -1,67 +1,67 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: CUDA 420, slow, 2 Mbps, nokeyfr, Audio aac96 ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 CUDA 420, slow, 2 Mbps, no kf, Audio aac96 ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_cuda420_2Mbit_aac96") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v h264_nvenc -preset slow -b:v 2M -pix_fmt yuv420p" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 96k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_cuda_2Mbit_aac96") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v h264_nvenc -preset slow -b:v 2M -pix_fmt yuv420p -c:a aac -b:a 96k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description insite it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 10M argument, which defines the bitrate for the output. -rem The output video will have keyframes each second due to -force_key_frames 0:00:01 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to CUDA h264 mp4 420 40Mbit external wav aac256.bat b/to CUDA h264 mp4 420 40Mbit external wav aac256.bat index d6d5b39..070fa25 100644 --- a/to CUDA h264 mp4 420 40Mbit external wav aac256.bat +++ b/to CUDA h264 mp4 420 40Mbit external wav aac256.bat @@ -5,58 +5,61 @@ REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmp setlocal enabledelayedexpansion -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.13 by Keerah.com ---] -ECHO [--- MP4 h264 module has been invoked, this preset is single file only ---] -ECHO [--- Preset: CUDA 420, slow, 40 Mbps, kf 2 sec, External Audio to aac256 ---] -ECHO [--- Using external audio source file: %~n1.wav +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v2.15 by Keerah ---] +ECHO [--- Preset: h264 mp4 CUDA 420, slow, 40 Mbps, kf 2 sec, External Audio to aac256 ---] +ECHO [--- This preset is single file only. Looking for audio source: %~n1.wav SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End +) + + ECHO [----------------------------------------------------------------------------------------] + IF %1.==. ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] + ECHO [ NO FILE SPECIFIED ] ) ELSE ( IF not EXIST %~n1.wav ( - ECHO [---------------------------------------------------------------------------------] ECHO [ Couldn't find the external audio file: %~n1.wav - GOTO End + GOTO :End ) - IF %dscr% GTR 0 (SET "dscrName=_cuda420_40Mbit_au") ELSE (SET "dscrName=") - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding... ] - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f + IF %dscr% GTR 0 (SET "dscrName=_420_cuda_40Mbit_muxaac256") ELSE (SET "dscrName=") + + SET "vlen=" + FOR /F "tokens=* delims=" %%f IN ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argFile[%%i].name!"') DO SET "vlen=%%f" + ECHO [ Video length is: !vlen! seconds + ECHO [ Muxing and Transcoding... ] "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i %1 -i "%~n1.wav" -c:a aac -b:a 256k -shortest -c:v h264_nvenc -preset slow -b:v 40M -pix_fmt yuv420p -force_key_frames 0:00:02 -y "%~n1%dscrName%.mp4" ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 40M argument, which defines the bitrate for the output. -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 -rem This script does not support muliple files \ No newline at end of file +ECHO [----------------------------------------------------------------------------------------] +ECHO [ SERVED ] +ECHO [----------------------------------------------------------------------------------------] + +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to CUDA h264 mp4 420 40Mbit external wav.bat b/to CUDA h264 mp4 420 40Mbit external wav.bat deleted file mode 100644 index 802d378..0000000 --- a/to CUDA h264 mp4 420 40Mbit external wav.bat +++ /dev/null @@ -1,71 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.13 by Keerah.com ---] -ECHO [--- MP4 h264 module has been invoked, this preset is single file only ---] -ECHO [--- Preset: CUDA 420, slow, 40 Mbps, kf 2 sec, External Audio to aac256 ---] -ECHO [--- Using external audio source file: %~n1.wav - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %1.==. ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - -) ELSE ( - - IF not EXIST %~n1.wav ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Couldn't find the external audio file: %~n1.wav - GOTO End - ) - - IF %dscr% GTR 0 (SET "dscrName=_cuda420_40Mbit_slow_ext") ELSE (SET "dscrName=") - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding... ] - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i %1 -i %~n1.wav -c:a aac -b:a 256k -shortest -c:v h264_nvenc -preset slow -b:v 40M -pix_fmt yuv420p -force_key_frames 0:00:02 -y %~n1%dscrName%.mp4 -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem Do not forget to replace the path to FFmpeg if its installed into a different folder in your system. - -rem This batch uses your Cuda card for encoding (to 420 40Mbit mp4) -rem but also looks for a .wav file with the same name as your source video has -rem and places it instead of whatever audio was in your source video. -rem If the streams are different in length the arg -shortest tells FFmpeg -rem to cut the output to the shortest of audio or video. -rem New audio will be compressed into 256kbps AAC, -rem FFmpeg is clever and takes in account all the source audio channels. -rem Your source video and audio files must have exact names (except the extension of course). -rem The script checks if there's appropriate .wav file found and stops if it wasn't. - -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 - -rem PAUSE command in the end keeps the batch window open after it's finished just to let you see the messages. -rem If you need more info on encoding then change verbose level -v command from -v warning to -v info. \ No newline at end of file diff --git a/to CUDA h264 mp4 420 40Mbit.bat b/to CUDA h264 mp4 420 40Mbit.bat deleted file mode 100644 index 23a9377..0000000 --- a/to CUDA h264 mp4 420 40Mbit.bat +++ /dev/null @@ -1,67 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: CUDA 420, slow, 40 Mbps, kf 2 sec, Audio Copy ---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_cuda420_40Mbit") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v h264_nvenc -preset slow -b:v 40M -pix_fmt yuv420p -force_key_frames 0:00:02 -c:a copy -y "!argVn[%%i]!%dscrName%.mp4" -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 40M argument, which defines the bitrate for the output. -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to CUDA h264 mp4 420 4Mbit aac96.bat b/to CUDA h264 mp4 420 4Mbit aac96.bat index f966c8d..86c6fc1 100644 --- a/to CUDA h264 mp4 420 4Mbit aac96.bat +++ b/to CUDA h264 mp4 420 4Mbit aac96.bat @@ -1,67 +1,67 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: CUDA 420, slow, 4 Mbps, no kf, Audio aac96 ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 CUDA 420, slow, 4 Mbps, no kf, Audio aac96 ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_cuda420_5Mbit_aac96") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v h264_nvenc -preset slow -b:v 4M -pix_fmt yuv420p" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 96k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_cuda_4Mbit_aac96") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v h264_nvenc -preset slow -b:v 4M -pix_fmt yuv420p -c:a aac -b:a 96k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description insite it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 10M argument, which defines the bitrate for the output. -rem The output video will have keyframes each second due to -force_key_frames 0:00:01 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to CUDA h264 mp4 420 4Mbit copy.bat b/to CUDA h264 mp4 420 4Mbit copy.bat new file mode 100644 index 0000000..f9d4529 --- /dev/null +++ b/to CUDA h264 mp4 420 4Mbit copy.bat @@ -0,0 +1,68 @@ +@ECHO OFF +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg + +setlocal enabledelayedexpansion + +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" +) + +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 CUDA 420, slow, 4 Mbps, kf 2 sec, Audio copy ---] + +SET "cmdp=%~dp0" +SET "argp=%~dp1" + +REM get settings +IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( + CALL "%argp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! +) ELSE ( + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) +) + +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End +) + + +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v h264_nvenc -preset slow -b:v 4M -pix_fmt yuv420p -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a copy -y" + REM This one simply copies the source audio stream, be aware, that not every audio can be fed into mp4, no pcm, yes aac +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_cuda_4Mbit") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" + +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End +) + +:End +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to CUDA h264 mp4 420 4Mbit.bat b/to CUDA h264 mp4 420 4Mbit.bat deleted file mode 100644 index 37f68f5..0000000 --- a/to CUDA h264 mp4 420 4Mbit.bat +++ /dev/null @@ -1,68 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: CUDA 420, slow, 4 Mbps, keyfr 2 sec, Audio Copy ---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_cuda420_10Mbit") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v h264_nvenc -preset slow -b:v 4M -pix_fmt yuv420p -force_key_frames 0:00:02 -c:a copy -y "!argVn[%%i]!%dscrName%.mp4" -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description insite it -rem This preset uses a separate Nvidia codec h264_nvenc. -rem For more information on the codec and its parameters refer to Nvidia's application note -rem https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf -rem Just one hint from me on -b:v 10M argument, which defines the bitrate for the output. -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to EXR squarifier.bat b/to EXR squarifier.bat new file mode 100644 index 0000000..441b644 --- /dev/null +++ b/to EXR squarifier.bat @@ -0,0 +1,112 @@ +@ECHO OFF +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg + +setlocal enabledelayedexpansion + +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" +) + +IF %argCount% LEQ 0 ( + ECHO [-----------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: EXR linear half-float, zip16 ---] +ECHO [--- Scales to the next power of 2 to the maximum of width or height ---] + +REM This one process only on per frame basis, no sequence detection, no video splitting as of yet + +SET "cmdp=%~dp0" +SET "argp=%~dp1" + +REM get settings +IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( + CALL "%argp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! +) ELSE ( + + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) +) + +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End + ) + +REM Check for exiftool +IF NOT EXIST "%ffpath%exiftool.exe" ( + ECHO [--- Sorry, the path to exifprobe.exe is unreacheable. Unable to continue! ---] + GOTO :End + ) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [ %argCount% files queued to encode + + +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-format 1 -compression 3 -gamma 1" + REM available EXR compressions: 0 - none (default), 1 - rle, 2 - zip1, 3 - zip16 + REM availableEXR formats: 1 - half, 2 - float (default) + REM available EXR gamma correction: -gamma , where float is between 0.001 and FLT_MAX, default = 1 +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_exr_square") ELSE (SET "wset.dscr=") +SET "wset.seqfr=" + rem -pattern_type none +SET "wset.seqfrout=-update 1 -frames:v 1" +SET "wset.suff=!wset.dscr!.exr" + + +FOR /L %%i IN (1,1,%argCount%) DO ( + + ECHO [-----------------------------------------------------------------------------------] + + REM fetch for the image dimensions using exiftool + REM exiftool was chosen because of the its clean output, unlike the ffprobe's, less parsing is simpler and faster + + SET /A "pWidth=0" + FOR /F "tokens=*" %%G IN ('""%ffpath%exiftool.exe" -b "!argFile[%%i].name!" -ImageWidth"') DO SET /A pWidth=%%G + FOR /F "tokens=*" %%H IN ('""%ffpath%exiftool.exe" -b "!argFile[%%i].name!" -ImageHeight"') DO SET /A pHeight=%%H + + REM max of Height or Width + SET /A "mSize=!pHeight!" + IF !pWidth! GTR !pHeight! (SET /A "mSize=!pWidth!") + + REM choose the next nearest power of 2 factor + SET /A "sFac=256" + IF !mSize! GTR 256 (SET /A "sFac=512") + IF !mSize! GTR 512 (SET /A "sFac=1024") + IF !mSize! GTR 1024 (SET /A "sFac=2048") + IF !mSize! GTR 2048 (SET /A "sFac=4096") + IF !mSize! GTR 4096 (SET /A "sFac=8192") + + ECHO [ Converting %%i of %argCount%: !argFile[%%i].trname! + ECHO [ Image dimensions: !pHeight! by !pWidth! + ECHO [ Target scale: !sFac!x!sFac! + "%ffpath%ffmpeg.exe" %wset.params% %wset.seqfr% -i "!argFile[%%i].name!" -vf "scale=!sFac!:!sFac!,setsar=1:1" %wset.videocomp% %wset.audiocomp% %wset.over% %wset.seqfrout% "!argFile[%%i].trname!"%wset.suff% +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [ SERVED ] +ECHO [-----------------------------------------------------------------------------------] + +:End +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 1080px 25fps.bat b/to HQ Gif 1080px 25fps.bat index 05159ee..9431c72 100644 --- a/to HQ Gif 1080px 25fps.bat +++ b/to HQ Gif 1080px 25fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 25 fps, 1080px, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: Gif 256 colors, 1080px width, 25 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf fps=25,scale=1080:-1:flags=lanczos,palettegen -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=25,scale=1080:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=25,scale=1080:-1:flags=lanczos,palettegen"" +SET "wset.videocomp=-filter_complex "fps=25,scale=1080:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif256_1080_25") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 120px 10fps.bat b/to HQ Gif 120px 10fps.bat index dcda4fb..0c2ff5e 100644 --- a/to HQ Gif 120px 10fps.bat +++ b/to HQ Gif 120px 10fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 10 fps, 120px, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: Gif 256 colors, 120px width, 10 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=10,scale=120:-1:flags=lanczos,palettegen"" +SET "wset.videocomp=-filter_complex "fps=10,scale=120:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif256_120_10") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf fps=10,scale=120:-1:flags=lanczos,palettegen -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=10,scale=120:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 16 640px 10fps.bat b/to HQ Gif 16 640px 10fps.bat index c4c70fe..8283c5c 100644 --- a/to HQ Gif 16 640px 10fps.bat +++ b/to HQ Gif 16 640px 10fps.bat @@ -1,73 +1,73 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 10 fps, 640px, 16 colors, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: Gif 16 colors, 640px width, 10 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf fps=10,scale=640:-1:flags=lanczos,palettegen=max_colors=16:stats_mode=full -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=10,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf fps=10,scale=640:-1:flags=lanczos,palettegen=max_colors=16:stats_mode=full" +SET "wset.videocomp=-filter_complex "fps=10,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif16_640_10") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + REM prepass only to one frame palette + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 304px 15fps.bat b/to HQ Gif 304px 15fps.bat deleted file mode 100644 index 634bf53..0000000 --- a/to HQ Gif 304px 15fps.bat +++ /dev/null @@ -1,75 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" -) - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 30 fps, 304px, 2 pass ---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hq304gif") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf "fps=30,scale=304:-1:flags=lanczos,palettegen=max_colors=128:stats_mode=full" -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - rem dither "bayer","heckbert","floyd_steinberg","sierra2","sierra2_4a" - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=30,scale=304:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=sierra2_4a" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file diff --git a/to HQ Gif 304px 30fps.bat b/to HQ Gif 304px 30fps.bat new file mode 100644 index 0000000..ad4df06 --- /dev/null +++ b/to HQ Gif 304px 30fps.bat @@ -0,0 +1,72 @@ +@ECHO OFF +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg + +setlocal enabledelayedexpansion + +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" +) + +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: Gif 256 colors, 304px width, 30 fps, 2 pass, sierra2_4a ---] + +SET "cmdp=%~dp0" +SET "argp=%~dp1" + +REM get settings +IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( + CALL "%argp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! +) ELSE ( + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) +) + +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End +) + + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=30,scale=304:-1:flags=lanczos,palettegen=max_colors=128:stats_mode=full"" +SET "wset.videocomp=-filter_complex "fps=30,scale=304:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=sierra2_4a"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif256_304_30") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End +) + +:End +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 32 320px 10fps.bat b/to HQ Gif 32 320px 10fps.bat index 6a1efb4..de7458e 100644 --- a/to HQ Gif 32 320px 10fps.bat +++ b/to HQ Gif 32 320px 10fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 10 fps, 320px, 32 colors, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: Gif 32 colors, 320px width, 10 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf fps=10,scale=320:-1:flags=lanczos,palettegen=max_colors=32:stats_mode=full -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf fps=10,scale=320:-1:flags=lanczos,palettegen=max_colors=32:stats_mode=full" +SET "wset.videocomp=-filter_complex "fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif32_320_10") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 616px 15fps.bat b/to HQ Gif 32 616px 10fps.bat similarity index 51% rename from to HQ Gif 616px 15fps.bat rename to to HQ Gif 32 616px 10fps.bat index e296a18..6d7f8fc 100644 --- a/to HQ Gif 616px 15fps.bat +++ b/to HQ Gif 32 616px 10fps.bat @@ -1,46 +1,82 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 30 fps, 304px, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: Gif 32 colors, 616px width, 10 fps, 2 pass, Bayer 3 ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode + + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=10,scale=616:-1:flags=lanczos,palettegen=max_colors=32:stats_mode=full"" +SET "wset.videocomp=-filter_complex "fps=10,scale=616:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=3"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif32_616_10") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %dscr% GTR 0 (SET "dscrName=_hq304gif") ELSE (SET "dscrName=") + +:End +IF %pse% GTR 0 PAUSE + + + + + + + FOR /L %%i IN (1,1,%argCount%) DO ( diff --git a/to HQ Gif 32 640px 10fps.bat b/to HQ Gif 32 640px 10fps.bat index 33e0e0a..a39fb72 100644 --- a/to HQ Gif 32 640px 10fps.bat +++ b/to HQ Gif 32 640px 10fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 10 fps, 640px, 32 colors, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO ----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: Gif 32 colors, 640px width, 10 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf "fps=10,scale=640:-1:flags=lanczos,palettegen=max_colors=32" -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=10,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=10,scale=640:-1:flags=lanczos,palettegen=max_colors=32"" +SET "wset.videocomp=-filter_complex "fps=10,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif32_640_10") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 420px 10fps.bat b/to HQ Gif 420px 10fps.bat index 73d765e..986e932 100644 --- a/to HQ Gif 420px 10fps.bat +++ b/to HQ Gif 420px 10fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 10 fps, 420px, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: Gif 256 colors, 420px width, 10 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=10,scale=420:-1:flags=lanczos,palettegen"" +SET "wset.videocomp=-filter_complex "fps=10,scale=420:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif256_420_10") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf fps=10,scale=420:-1:flags=lanczos,palettegen -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=10,scale=420:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 420px 15fps.bat b/to HQ Gif 420px 15fps.bat index 5f37312..9ddef05 100644 --- a/to HQ Gif 420px 15fps.bat +++ b/to HQ Gif 420px 15fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 15 fps, 420px, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: Gif 256 colors, 420px width, 15 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf fps=15,scale=420:-1:flags=lanczos,palettegen -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=15,scale=420:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=15,scale=420:-1:flags=lanczos,palettegen"" +SET "wset.videocomp=-filter_complex "fps=15,scale=420:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif256_420_15") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 64 640px 15fps.bat b/to HQ Gif 64 640px 15fps.bat index 0179ac7..f1235ed 100644 --- a/to HQ Gif 64 640px 15fps.bat +++ b/to HQ Gif 64 640px 15fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 15 fps, 640px, 64 colors, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: Gif 64 colors, 640px width, 15 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf "fps=15,scale=640:-1:flags=lanczos,palettegen=max_colors=64" -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=15,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=15,scale=640:-1:flags=lanczos,palettegen=max_colors=64"" +SET "wset.videocomp=-filter_complex "fps=15,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif64_640_15") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 640px 15fps.bat b/to HQ Gif 640px 15fps.bat index aac85cd..d186236 100644 --- a/to HQ Gif 640px 15fps.bat +++ b/to HQ Gif 640px 15fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 15 fps, 640px, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: Gif 256 colors, 640px width, 15 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf fps=15,scale=640:-1:flags=lanczos,palettegen -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=15,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=15,scale=640:-1:flags=lanczos,palettegen"" +SET "wset.videocomp=-filter_complex "fps=15,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif256_640_24") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 640px 24fps.bat b/to HQ Gif 640px 24fps.bat index 8c0d525..f0d7000 100644 --- a/to HQ Gif 640px 24fps.bat +++ b/to HQ Gif 640px 24fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 24 fps, 640px, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: Gif 256 colors, 640px width, 24 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf fps=24,scale=640:-1:flags=lanczos,palettegen -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=24,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=24,scale=640:-1:flags=lanczos,palettegen"" +SET "wset.videocomp=-filter_complex "fps=24,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif256_640_24") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to HQ Gif 640px 25fps.bat b/to HQ Gif 640px 25fps.bat index 05e4929..a358f34 100644 --- a/to HQ Gif 640px 25fps.bat +++ b/to HQ Gif 640px 25fps.bat @@ -1,73 +1,72 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi GIF module has been invoked ---] -ECHO [--- Preset: 25 fps, 640px, 2 pass ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: Gif 256 colors, 640px width, 25 fps, 2 pass ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hqgif") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 1: Generating a palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -i "!argVec[%%i]!" -vf fps=25,scale=640:-1:flags=lanczos,palettegen -y "!argVec[%%i]!"_palette.png - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Encoding file %%i of %argCount% - ECHO [ STAGE 2: Encoding to Gif using the generatied palette ] - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -i "!argVec[%%i]!"_palette.png -filter_complex "fps=25,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y "!argVec[%%i]!"%dscrName%.gif - - IF EXIST "!argVec[%%i]!"_palette.png DEL /s "!argVec[%%i]!"_palette.png > nul + +REM compression settings +SET "wset.fps=10" +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.prepass=-vf "fps=25,scale=640:-1:flags=lanczos,palettegen"" +SET "wset.videocomp=-filter_complex "fps=25,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse"" + REM There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. + REM You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_hqgif256_640_25") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.gif" +SET "wset.seqfrout=-update 1 -frames:v 1" + + +IF EXIST "%cmdp%sendtoffmpeg_encoder02.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder02.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder02.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -IF %pse% GTR 0 PAUSE - -rem This script creates high quality GIFs and supports multiple file selection at once (processes them in queue) -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside of it -rem There's no alpha channel support yet. The output file will be saved to the same folder your source comes from. -rem You can change the frame rate/resolution by changing fps=XX/scale=XXX values to your preference, just do it in both FFmpeg command lines. -rem The script works in 2 stages (2 pass encoding). First one scans the source and creates a colour palette of it to minimise your Gif size. And the second pass creates the Gif itself. -rem To encode just a piece of your source video add to command parameters something like -ss 12:23 -t 35 where -ss is start time and -t is duration \ No newline at end of file +IF %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to Hap.bat b/to Hap.bat deleted file mode 100644 index 56316de..0000000 --- a/to Hap.bat +++ /dev/null @@ -1,64 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi HAP module has been invoked ---] -ECHO [--- Preset: HAP default, audio copy ---] - -set "cmdp=%~dp0" -set "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_hap") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v hap -c:a copy -y "!argVn[%%i]!%dscrName%.mov" -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to JPEG q10.bat b/to JPEG q10.bat index 0f220e0..9b23ca4 100644 --- a/to JPEG q10.bat +++ b/to JPEG q10.bat @@ -1,59 +1,66 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2022 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.3 by Keerah.com ---] -ECHO [--- Multi JPEG module has been invoked ---] -ECHO [--- Preset: JPEG quality 10%% ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: JPEG quality 10 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) -IF %dscr% GTR 0 (SET "dscrName=_jpeg10") ELSE (SET "dscrName=") +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-vf "scale=in_range=mpeg:out_range=full" -q:v 9" +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_jpeg10") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!_%%0!frcounter!d.jpg" -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Converting %%i of %argCount%: !argVn[%%i]! - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -i "!argVec[%%i]!" -vf "scale=in_range=mpeg:out_range=full" -q:v 9 -y "!argVn[%%i]!%dscrName%_%%04d.jpg" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - if %pse% GTR 0 PAUSE diff --git a/to JPEG q100.bat b/to JPEG q100.bat index ee7c2b8..e24763a 100644 --- a/to JPEG q100.bat +++ b/to JPEG q100.bat @@ -1,59 +1,66 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2022 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.3 by Keerah.com ---] -ECHO [--- Multi JPEG module has been invoked ---] -ECHO [--- Preset: JPEG quality 100%% ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: JPEG quality 100 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) -IF %dscr% GTR 0 (SET "dscrName=_jpeg100") ELSE (SET "dscrName=") +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-vf "scale=in_range=mpeg:out_range=full" -q:v 0" +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_jpeg100") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!_%%0!frcounter!d.jpg" -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Converting %%i of %argCount%: !argVn[%%i]! - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -i "!argVec[%%i]!" -vf "scale=in_range=mpeg:out_range=full" -q:v 0 -y "!argVn[%%i]!%dscrName%_%%04d.jpg" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to JPEG q40.bat b/to JPEG q40.bat index 06dfe13..a4df552 100644 --- a/to JPEG q40.bat +++ b/to JPEG q40.bat @@ -1,59 +1,66 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2022 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.3 by Keerah.com ---] -ECHO [--- Multi JPEG module has been invoked ---] -ECHO [--- Preset: JPEG quality 40%% ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: JPEG quality 40 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) -IF %dscr% GTR 0 (SET "dscrName=_jpeg40") ELSE (SET "dscrName=") +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-vf "scale=in_range=mpeg:out_range=full" -q:v 6" +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_jpeg40") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!_%%0!frcounter!d.jpg" -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Converting %%i of %argCount%: !argVn[%%i]! - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -i "!argVec[%%i]!" -vf "scale=in_range=mpeg:out_range=full" -q:v 6 -y "!argVn[%%i]!%dscrName%_%%04d.jpg" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - if %pse% GTR 0 PAUSE diff --git a/to JPEG q90.bat b/to JPEG q90.bat index e097131..3f08c33 100644 --- a/to JPEG q90.bat +++ b/to JPEG q90.bat @@ -1,59 +1,66 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2022 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.3 by Keerah.com ---] -ECHO [--- Multi JPEG module has been invoked ---] -ECHO [--- Preset: JPEG quality 90%% ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: JPEG quality 90 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) -IF %dscr% GTR 0 (SET "dscrName=_jpeg90") ELSE (SET "dscrName=") +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-vf "scale=in_range=mpeg:out_range=full" -c:v 4 -q:v 1" +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_jpeg90") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!_%%0!frcounter!d.jpg" -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Converting %%i of %argCount%: !argVn[%%i]! - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -i "!argVec[%%i]!" -vf "scale=in_range=mpeg:out_range=full" -q:v 1 -y "!argVn[%%i]!%dscrName%_%%04d.jpg" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to PNG hi.bat b/to PNG hi.bat index ea7fa30..bbf45a5 100644 --- a/to PNG hi.bat +++ b/to PNG hi.bat @@ -1,59 +1,66 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2022 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.3 by Keerah.com ---] -ECHO [--- Multi PNG module has been invoked ---] -ECHO [--- Preset: PNG, compression 0 ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: PNG, compression 0 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) -IF %dscr% GTR 0 (SET "dscrName=_pnghigh") ELSE (SET "dscrName=") +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-compression_level 0" +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_pnghigh") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!_%%0!frcounter!d.png" -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Converting %%i of %argCount%: !argVn[%%i]! - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -i "!argVec[%%i]!" -compression_level 0 -y "!argVn[%%i]!%dscrName%.png" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to PNG low 400px width.bat b/to PNG low 400px width.bat index fd82320..d0239f3 100644 --- a/to PNG low 400px width.bat +++ b/to PNG low 400px width.bat @@ -1,59 +1,66 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2022 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.3 by Keerah.com ---] -ECHO [--- Multi PNG module has been invoked ---] -ECHO [--- Preset: PNG, compression 9, resize to width 400 ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: PNG, compression 9, resize to width 400 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) -IF %dscr% GTR 0 (SET "dscrName=_png400low") ELSE (SET "dscrName=") +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-vf scale=400:-1 -sws_flags lanczos -compression_level 9" +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_png400low") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!_%%0!frcounter!d.png" -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Converting %%i of %argCount%: !argVn[%%i]! - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -i "!argVec[%%i]!" -vf scale=400:-1 -sws_flags lanczos -compression_level 9 -y "!argVn[%%i]!%dscrName%.png" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to PNG low.bat b/to PNG low.bat index 7e48f6d..acef902 100644 --- a/to PNG low.bat +++ b/to PNG low.bat @@ -1,59 +1,66 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.3 by Keerah.com ---] -ECHO [--- Multi PNG module has been invoked ---] -ECHO [--- Preset: PNG, compression 9 ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: PNG, max compression of 9 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) -IF %dscr% GTR 0 (SET "dscrName=_pnglow") ELSE (SET "dscrName=") +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-compression_level 9" +SET "wset.audiocomp=" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_pnglow") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!_%%0!frcounter!d.png" -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Converting %%i of %argCount%: !argVn[%%i]! - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -i "!argVec[%%i]!" -compression_level 9 -y "!argVn[%%i]!%dscrName%.png" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 baseline L3 high 20 film.bat b/to h264 mp4 420 baseline L3 high 20 film.bat index 1021ad7..9061151 100644 --- a/to h264 mp4 420 baseline L3 high 20 film.bat +++ b/to h264 mp4 420 baseline L3 high 20 film.bat @@ -1,66 +1,69 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [------------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420 L3 baseline 3.0, veryslow, crf 20, FILM, kf 2 sec, Audio aac128 ---] +IF %argCount% LEQ 0 ( + ECHO [-----------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: h264 mp4, 420 L3 3.0, veryslow, crf 20, Film, kf 2 sec, Audio aac128 -] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) -IF %argCount% == 0 ( - - ECHO [------------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) - -IF %argCount% GTR 1 ( - ECHO [------------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_420_crf20_Baseline3") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [------------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p -tune film -preset veryslow -crf 20 -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 + REM This batch encodes to a very strict (very compatible) Baseline v3.0 profile + REM It also reencodes the audio to 128 kbps AAC to guarantee full compatibility to virtually any player +SET "wset.audiocomp=-c:a aac -b:a 128k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf20_Baseline3") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p -tune film -preset veryslow -crf 20 -force_key_frames 0:00:02 -c:a aac -b:a 128k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [------------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [------------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 -rem This batch encodes to a very strict (very compatible) Baseline v3.0 profile -rem It also reencodes the audio to 128 kbps AAC to guarantee full compatibility to virtually any player -rem If you need more info on encoding then change verbose level -v command from -v warning to -v info. \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 high 20 film aac256.bat b/to h264 mp4 420 high 20 film aac256.bat index 59e3f7a..d2de7e9 100644 --- a/to h264 mp4 420 high 20 film aac256.bat +++ b/to h264 mp4 420 high 20 film aac256.bat @@ -1,64 +1,67 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420, veryslow, crf 20, GRAIN, kf 2 sec, Audio aac256 ---] +IF %argCount% LEQ 0 ( + ECHO [-----------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 420, veryslow, crf 20, GRAIN, kf 2 sec, Audio aac256 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) -IF %dscr% GTR 0 (SET "dscrName=_420_crf20_aac256") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 20 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 256k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf20_aac256") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 20 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02 -c:a aac -b:a 256k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 high 25 film aac192.bat b/to h264 mp4 420 high 25 film aac192.bat index 6645ec6..a7715b4 100644 --- a/to h264 mp4 420 high 25 film aac192.bat +++ b/to h264 mp4 420 high 25 film aac192.bat @@ -1,64 +1,67 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420, veryslow, crf 25, FILM, kf 2 sec, Audio aac192 ---] +IF %argCount% LEQ 0 ( + ECHO [-----------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 420, veryslow, crf 25, FILM, kf 2 sec, Audio aac192 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) -IF %dscr% GTR 0 (SET "dscrName=_420_crf20_aac256") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 25 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 192k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf25_aac192") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 25 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02 -c:a aac -b:a 192k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 high 30 film aac256.bat b/to h264 mp4 420 high 30 film aac256.bat index db94ae7..93f8ae0 100644 --- a/to h264 mp4 420 high 30 film aac256.bat +++ b/to h264 mp4 420 high 30 film aac256.bat @@ -1,64 +1,67 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420, veryslow, crf 30, GRAIN, kf 2 sec, Audio aac256 ---] +IF %argCount% LEQ 0 ( + ECHO [-----------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 420, veryslow, crf 30, GRAIN, kf 2 sec, Audio aac256 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) -IF %dscr% GTR 0 (SET "dscrName=_420_crf30_aac256") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 30 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 256k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf30_aac256") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 30 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02 -c:a aac -b:a 256k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 very high 14 film aac256.bat b/to h264 mp4 420 very high 14 film aac256.bat index 2971da2..4520d1a 100644 --- a/to h264 mp4 420 very high 14 film aac256.bat +++ b/to h264 mp4 420 very high 14 film aac256.bat @@ -1,64 +1,67 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420 veryslow, crf 14, GRAIN, kf 2sec, Audio aac256 ---] +IF %argCount% LEQ 0 ( + ECHO [-----------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah.com ---] +ECHO [--- Preset: h264 mp4 420 veryslow, crf 14, GRAIN, kf 2sec, Audio aac256 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) -IF %dscr% GTR 0 (SET "dscrName=_420_crf14_aac256") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 14 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 256k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf14_aac256") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 14 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02 -c:a aac -b:a 256k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 very high 14 film scale lanczos 1080 copy.bat b/to h264 mp4 420 very high 14 film scale lanczos 1080 copy.bat new file mode 100644 index 0000000..8c3b7a2 --- /dev/null +++ b/to h264 mp4 420 very high 14 film scale lanczos 1080 copy.bat @@ -0,0 +1,69 @@ +@ECHO OFF +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg + +setlocal enabledelayedexpansion + +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" +) + +IF %argCount% LEQ 0 ( + ECHO [-----------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 420, veryslow, crf 14, lanczos 1080p, Film, kf 2 sec, Copy --] + +SET "cmdp=%~dp0" +SET "argp=%~dp1" + +REM get settings +IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( + CALL "%argp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! +) ELSE ( + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) +) + +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End +) + + +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 14 -pix_fmt yuv420p -vf scale=-1:1080 -sws_flags lanczos -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 + REM scales to fit vertically to 1080px +SET "wset.audiocomp=-c:a copy" + REM This one simply copies the source audio stream +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf16_x1080") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" + +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End +) + +:End +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 very high 14 film scale lanczos 1080.bat b/to h264 mp4 420 very high 14 film scale lanczos 1080.bat deleted file mode 100644 index 2e48eef..0000000 --- a/to h264 mp4 420 very high 14 film scale lanczos 1080.bat +++ /dev/null @@ -1,64 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420, veryslow, crf 14, scale lanczos 1080p, FILM, kf 2 sec, Audio Copy ---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_420_crf16_1080") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 14 -pix_fmt yuv420p -vf scale=-1:1080 -sws_flags lanczos -tune film -force_key_frames 0:00:02 -c:a copy -y "!argVn[%%i]!%dscrName%.mp4" -) - -:End -ECHO [---------------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem 1080 defines the height but the aspect ratio is preserved and the width depends on the source video -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to h264 mp4 420 very high 14 film scale lanczos 540 aac128.bat b/to h264 mp4 420 very high 14 film scale lanczos 540 aac128.bat deleted file mode 100644 index 4891a3f..0000000 --- a/to h264 mp4 420 very high 14 film scale lanczos 540 aac128.bat +++ /dev/null @@ -1,63 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420, veryslow, crf 16, scale lanczos 540p, FILM, kf 2 sec, Audio aac128---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_420_crf16_1080") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 16 -pix_fmt yuv420p -vf scale=-1:540 -sws_flags lanczos -tune film -force_key_frames 0:00:02 -c:a aac -b:a 128k -y "!argVn[%%i]!%dscrName%.mp4" -) - -:End -ECHO [---------------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to h264 mp4 420 very high 14 film scale lanczos 640 aac128.bat b/to h264 mp4 420 very high 14 film scale lanczos 640 aac128.bat new file mode 100644 index 0000000..0ab9c4c --- /dev/null +++ b/to h264 mp4 420 very high 14 film scale lanczos 640 aac128.bat @@ -0,0 +1,68 @@ +@ECHO OFF +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg + +setlocal enabledelayedexpansion + +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" +) + +IF %argCount% LEQ 0 ( + ECHO [-----------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [-----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 420, veryslow, crf 16, lanczos 640p, FILM, kf 2 sec, aac128 -] + +SET "cmdp=%~dp0" +SET "argp=%~dp1" + +REM get settings +IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( + CALL "%argp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! +) ELSE ( + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) +) + +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End +) + + +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 16 -pix_fmt yuv420p -vf scale=-1:640 -sws_flags lanczos -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 + REM scales to fit vertically to 640px +SET "wset.audiocomp=-c:a aac -b:a 128k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf16_x640_aac128") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" + +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End +) + +:End +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 very high 14 film.bat b/to h264 mp4 420 very high 14 film.bat deleted file mode 100644 index 055ced1..0000000 --- a/to h264 mp4 420 very high 14 film.bat +++ /dev/null @@ -1,64 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420, veryslow, crf 14, FILM, kf 2 sec, Audio Copy ---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_420_crf14") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 14 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02 -c:a copy -y "!argVn[%%i]!%dscrName%.mp4" -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to h264 mp4 420 very high 16 film aac256.bat b/to h264 mp4 420 very high 16 film aac256.bat index 38dc4df..56cb38c 100644 --- a/to h264 mp4 420 very high 16 film aac256.bat +++ b/to h264 mp4 420 very high 16 film aac256.bat @@ -1,64 +1,67 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420 veryslow, crf 16, GRAIN, kf 2sec, Audio aac256 ---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4, 420 veryslow, crf 16, Film, kf 2sec, Audio aac256 ---] -set "cmdp=%~dp0" -set "argp=%~dp1" +SET "cmdp=%~dp0" +SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) -IF %dscr% GTR 0 (SET "dscrName=_420_crf16_aac256") ELSE (SET "dscrName=") -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 16 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 256k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf16_aac256") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 16 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02 -c:a aac -b:a 256k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] - -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 very high 16 film scale lanczos 720 aac256.bat b/to h264 mp4 420 very high 16 film scale lanczos 720 aac256.bat index 766f25c..1790c91 100644 --- a/to h264 mp4 420 very high 16 film scale lanczos 720 aac256.bat +++ b/to h264 mp4 420 very high 16 film scale lanczos 720 aac256.bat @@ -1,63 +1,68 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420, veryslow, crf 16, scale lanczos 720p, FILM, kf 2 sec, Audio aac256---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 420, veryslow, crf 16, lanczos 720p, Film, kf 2 sec, aac256 ---] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) -IF %dscr% GTR 0 (SET "dscrName=_420_crf16_720") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 16 -pix_fmt yuv420p -vf scale=-1:720 -sws_flags lanczos -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 + REM scales vertically to fit 720px using lanczos algo +SET "wset.audiocomp=-c:a aac -b:a 256k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf16_x720_aac256") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 16 -pix_fmt yuv420p -vf scale=-1:720 -sws_flags lanczos -tune film -force_key_frames 0:00:02 -c:a aac -b:a 256k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 very high 18 film aac256.bat b/to h264 mp4 420 very high 18 film aac256.bat new file mode 100644 index 0000000..c2c4bdc --- /dev/null +++ b/to h264 mp4 420 very high 18 film aac256.bat @@ -0,0 +1,67 @@ +@ECHO OFF +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg + +setlocal enabledelayedexpansion + +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" +) + +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v3.0 by Keerah ---] +ECHO [--- Preset: h264 mp4 420, veryslow, crf 18, Film, kf 2 sec, Audio aac256 ---] + +SET "cmdp=%~dp0" +SET "argp=%~dp1" + +REM get settings +IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( + CALL "%argp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! +) ELSE ( + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) +) + +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End +) + + +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 18 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 +SET "wset.audiocomp=-c:a aac -b:a 256k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf18") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" + +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End +) + +:End +if %pse% GTR 0 PAUSE \ No newline at end of file diff --git a/to h264 mp4 420 very high 18 film.bat b/to h264 mp4 420 very high 18 film.bat deleted file mode 100644 index a8b671b..0000000 --- a/to h264 mp4 420 very high 18 film.bat +++ /dev/null @@ -1,63 +0,0 @@ -@ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg - -setlocal enabledelayedexpansion - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" -) - -ECHO [---------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420, veryslow, crf 18, FILM kf 2 sec, Audio Copy ---] - -SET "cmdp=%~dp0" -SET "argp=%~dp1" - -IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( - CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] -) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End -) - -IF %argCount% GTR 1 ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode -) - -IF %dscr% GTR 0 (SET "dscrName=_420_crf18") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f - - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 18 -pix_fmt yuv420p -tune film -force_key_frames 0:00:02 -c:a copy -y "!argVn[%%i]!%dscrName%.mp4" -) - -:End -ECHO [---------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description insite it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file diff --git a/to h264 mp4 420 very high 20 film scale lanczos 540 aac128.bat b/to h264 mp4 420 very high 20 film scale lanczos 540 aac128.bat index 53635c5..e209d01 100644 --- a/to h264 mp4 420 very high 20 film scale lanczos 540 aac128.bat +++ b/to h264 mp4 420 very high 20 film scale lanczos 540 aac128.bat @@ -1,63 +1,68 @@ @ECHO OFF -REM SendTo_FFmpeg is a set of windows batches for effortless and free transcoding -REM Copyright (c) 2018-2021 Keerah, keerah.com. All rights reserved -REM More information at https://keerah.com https://github.com/keerah/SendTo_FFmpeg +REM SendTo_FFmpeg is a set of windows batches for effortless transcoding +REM Download from https://github.com/keerah/SendTo_FFmpeg setlocal enabledelayedexpansion -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argVec[!argCount!]=%%~x" - set "argVn[!argCount!]=%%~nx" +SET argCount=0 +FOR %%f IN (%*) DO ( + SET /A argCount+=1 + SET "argFile[!argCount!].name=%%~f" + SET "argFile[!argCount!].trname=%%~nf" + SET "argFile[!argCount!].ext=%%~xf" + SET "argFile[!argCount!].path=%%~dpf" ) -ECHO [---------------------------------------------------------------------------------------] -ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] -ECHO [--- Multi MP4 h264 module has been invoked ---] -ECHO [--- Preset: 420, veryslow, crf 24, scale lanczos 540p, FILM, kf 2 sec, Audio aac128---] +IF %argCount% LEQ 0 ( + ECHO [----------------------------------------------------------------------------------------] + ECHO [ NO FILE^(S^) SPECIFIED ] + GOTO :End +) + +ECHO [----------------------------------------------------------------------------------] +ECHO [--- SendTo FFmpeg encoder v2.2 by Keerah.com ---] +ECHO [--- Preset: h264 mp4 420, veryslow, crf 24, lanczos 540p, Film, kf 2 sec, aac128 ] SET "cmdp=%~dp0" SET "argp=%~dp1" +REM get settings IF EXIST "%argp%sendtoffmpeg_settings.cmd" ( CALL "%argp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: LOCAL ---] + ECHO [--- Settings: *LOCAL*, Verbosity: !vbl! ) ELSE ( - CALL "%cmdp%sendtoffmpeg_settings.cmd" - ECHO [--- Settings: GLOBAL ---] -) - -IF %argCount% == 0 ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ NO FILE SPECIFIED ] - GOTO End + IF EXIST "%cmdp%sendtoffmpeg_settings.cmd" ( + CALL "%cmdp%sendtoffmpeg_settings.cmd" + ECHO [--- Settings: Global, Verbosity: !vbl! + ) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_settings.cmd is unreacheable. Unable to continue! ---] + GOTO :End + ) ) - -IF %argCount% GTR 1 ( - ECHO [---------------------------------------------------------------------------------------] - ECHO [ %argCount% files queued to encode +REM Check for ffmpeg +IF NOT EXIST "%ffpath%ffmpeg.exe" ( + ECHO [--- Sorry, the path to ffmpeg.exe is unreacheable. Unable to continue! ---] + GOTO :End ) -IF %dscr% GTR 0 (SET "dscrName=_420_crf24_540") ELSE (SET "dscrName=") - -FOR /L %%i IN (1,1,%argCount%) DO ( - - ECHO [---------------------------------------------------------------------------------------] - ECHO [ Transcoding %%i of %argCount%: !argVn[%%i]! - for /F "delims=" %%f in ('call "%ffpath%ffprobe.exe" -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" "!argVec[%%i]!"') do echo [ Video length is: %%f +REM compression settings +SET "wset.params=-v %vbl% -hide_banner -stats" +SET "wset.videocomp=-c:v libx264 -preset veryslow -crf 24 -pix_fmt yuv420p -vf scale=-1:540 -sws_flags lanczos -tune film -force_key_frames 0:00:02" + REM The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 + REM scales vertically to fit 540px using lanczos algo +SET "wset.audiocomp=-c:a aac -b:a 128k" +IF %quietover% == 1 (SET "wset.over=-y") ELSE (SET "wset.over=") +IF %dscr% GTR 0 (SET "wset.dscr=_420_crf24_x540_aac128") ELSE (SET "wset.dscr=") +SET "wset.suff=!wset.dscr!.mp4" - "%ffpath%ffmpeg.exe" -v %vbl% -hide_banner -stats -i "!argVec[%%i]!" -c:v libx264 -preset veryslow -crf 24 -pix_fmt yuv420p -vf scale=-1:540 -sws_flags lanczos -tune film -force_key_frames 0:00:02 -c:a aac -b:a 128k -y "!argVn[%%i]!%dscrName%.mp4" +IF EXIST "%cmdp%sendtoffmpeg_encoder01.cmd" ( + CALL "%cmdp%sendtoffmpeg_encoder01.cmd" +) ELSE ( + ECHO [--- Sorry, the sendtoffmpeg_encoder01.cmd is unreacheable. Unable to continue! ---] + GOTO :End ) :End -ECHO [---------------------------------------------------------------------------------------] -ECHO [ SERVED ] -ECHO [---------------------------------------------------------------------------------------] -if %pse% GTR 0 PAUSE - -rem the main settings are defined in file sendtoffmpeg_settings.cmd, read the description inside it -rem The output video will have keyframes each 2 seconds due to -force_key_frames 0:00:02 \ No newline at end of file +if %pse% GTR 0 PAUSE \ No newline at end of file