thought I'd share and hope it helps someone. I did copy another script on here for 'base', no point in re-inventing the wheel from scratch!
Code: Select all
@ECHO OFF
ECHO.
ECHO Begin SABPostProccessVideo - Convert mkv to mp4 works on xbox360 using System video Player perfeclty...
ECHO.
REM Change these variables to match your system
SET FFMPEG=C:\ffmpeg\bin\ffmpeg.exe
SET OldFormat=mkv
SET NewFormat=mp4
REM You shouldn't need to edit anything below here
ECHO Looking in "%~1" for %OldFormat% files...
ECHO Using %FFMPEG% to convert %OldFormat% to %NewFormat%...
ECHO These are the files to convert
for %%i IN ("%~1\*.%OldFormat%") DO (ECHO "%%i")
ECHO Starting Conversion (If there are any files)
for %%i IN ("%~1\*.%OldFormat%") DO (%FFMPEG% -y -ss 00:00:00 -threads 6 -i "%%i" -vcodec copy -f mp4 -strict experimental -acodec copy "%%i.%NewFormat%")
REM Pause for 5 seconds once processing is complete to let things settle a bit
PING 192.168.1.250 -n 1 -w 5000 >NUL
REM This part checks to see if the old format files were converted to new format
ECHO Checking for new format files in %~1
IF EXIST "%~1\*.%NewFormat%" (
ECHO Found %NewFormat% in folder!
ECHO Deleting old files then
ECHO.
ECHO Pause for 5 seconds before trying to delete files
PING 192.168.1.250 -n 1 -w 5000 >NUL
ECHO Delete %OldFormat% files from source directory
del /Q /S /F "%~1\*.%OldFormat%"
) ELSE (
ECHO DID NOT find %NewFormat% in folder!
ECHO so, erm, not doing anything now, you can keep your %NewFormat% and do it yourself!
)