Skip to content

Instantly share code, notes, and snippets.

@axieum
Created May 12, 2019 11:46
Show Gist options
  • Save axieum/8b4f7d474b9169e630b07bcfcc2ff3d1 to your computer and use it in GitHub Desktop.
Save axieum/8b4f7d474b9169e630b07bcfcc2ff3d1 to your computer and use it in GitHub Desktop.
A colourful media converter for Windows
@echo off
setlocal EnableDelayedExpansion
cls
echo  ALL TO .MP4 
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  There are no files... 
) else (
echo.
echo  There are !total! files to convert! 
echo.
for %%f in (%looking%) do (
set /a current+=1
echo  Converting ^(!current!/!total!^)  '%%~nxf'
echo.
ffmpeg -loglevel quiet -stats -i %%~dpnxf %%~dpnf.mp4 > NUL
echo.
if not errorlevel 1 (
set /a converted+=1
echo  Success  '%%~nf.mp4'
) else (
set /a failed+=1
echo  Failure  '%%~nxf'
)
echo.
)
echo  !converted! files were converted^^!  !failed! failed 
)
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