Created
May 12, 2019 11:46
-
-
Save axieum/8b4f7d474b9169e630b07bcfcc2ff3d1 to your computer and use it in GitHub Desktop.
A colourful media converter for Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal EnableDelayedExpansion | |
cls | |
echo [104;97m ALL TO .MP4 [0m | |
echo. | |
set looking=".\*.avi" | |
set total=0 | |
set current=0 | |
set converted=0 | |
set failed=0 | |
if not "%1"=="" ( | |
set looking=%1 | |
) | |
for %%f in (%looking%) do ( | |
set /a total+=1 | |
echo - %%~nf | |
) | |
if %total%==0 ( | |
echo [101m There are no files... [0m | |
) else ( | |
echo. | |
echo [104;97m There are !total! files to convert! [0m | |
echo. | |
for %%f in (%looking%) do ( | |
set /a current+=1 | |
echo [100m Converting ^(!current!/!total!^) [0m '%%~nxf' | |
echo. | |
ffmpeg -loglevel quiet -stats -i %%~dpnxf %%~dpnf.mp4 > NUL | |
echo. | |
if not errorlevel 1 ( | |
set /a converted+=1 | |
echo [102;90m Success [0m '%%~nf.mp4' | |
) else ( | |
set /a failed+=1 | |
echo [101m Failure [0m '%%~nxf' | |
) | |
echo. | |
) | |
echo [104;97m !converted! files were converted^^! [0m[31m !failed! failed [0m | |
) | |
echo. | |
echo Press any key to exit... | |
pause > NUL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment