Here is a script that converts files to MP4, rename them (Movies through Sabnzbd's Sorting and TV-Shows through my setup in Sonarr) and move them where you want.
Code: Select all
@ECHO OFF
ECHO.
ECHO Begin SAB Post-Proccess Video - Remux AVI or MKV to MP4
ECHO.
REM Change these variables to match your system
SET FFMPEG=D:\ffmpeg\bin\ffmpeg.exe
SET OldAVI=avi
SET OldMKV=mkv
SET NewFormat=mp4
REM You shouldn't need to edit anything below here. Only if you add another format (Container) OldASF, OldWMV etc.
ECHO.
ECHO Deleting Unnecessary files before converting (Samples etc, so it does not convert them too)!
ECHO.
del /Q /F "%~1\*RARBG.COM*","%~1\*sample*","%~1\*.idx","%~1\*.sub","%~1\*.srr","%~1\*.par2","%~1\*.jpg","%~1\*.url","%~1\*.pdf","%~1\*.m2ts","%~1\*.srs"
ECHO.
ECHO Looking in "%~1" for %OldAVI% or %OldMKV% files.
ECHO Using %FFMPEG% to convert %OldAVI% or %OldMKV% to %NewFormat%...
ECHO.
ECHO These are the files to convert:
ECHO.
for %%i IN ("%~1\*.%OldAVI%","%~1\*.%OldMKV%") DO (ECHO "%%i")
ECHO.
ECHO Starting Conversion (If there are any files)
ECHO.
ECHO.
ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ START CONVERTING %time:~0,-3% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Timer\timer.exe /q
for %%i IN ("%~1\*.%OldAVI%","%~1\*.%OldMKV%") DO (%FFMPEG% -nostats -loglevel warning -y -i "%%i" -c:v copy -c:a libfdk_aac "%~1\%%~ni.%NewFormat%")
ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END CONVERTING %time:~0,-3% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO.
ECHO Conversion took:
@ECHO OFF
D:\Timer\timer.exe /n /nologo /s
ECHO.
REM Pause for 5 seconds once processing is complete to let things settle a bit
PING 127.0.0.1 -n 1 -w 5000 >NUL
ECHO.
REM Change the del command below, if you want to add or remove files to delete or keep.
ECHO Deleting %OldAVI% or %OldMKV% and unnecessary files!
ECHO.
del /Q /F "%~1\*.%OldAVI%","%~1\*.%OldMKV%","%~1\*RARBG.COM*","%~1\*sample*","%~1\*.idx","%~1\*.sub","%~1\*.srr","%~1\*.par2","%~1\*.jpg","%~1\*.url","%~1\*.pdf","%~1\*.m2ts","%~1\*.srs"
ECHO Checking for new format files in %~1
ECHO.
IF EXIST "%~1\*.%NewFormat%" (
Dir /B %~1\*.mp4
ECHO.
ECHO Found %NewFormat% in folder!
ECHO.
PING 127.0.0.1 -n 1 -w 5000 >NUL
)
ECHO.
ECHO Done!
Setup your sonarr as you want it with TV-Shows.
Setup your Sabnzbd as you want it.
Make a file with the above code and put the file in Sabnzbd's Script folder. (C:\Program Files (x86)\SABnzbd\scripts\)
Setup your Categories in Sabnzbd (TV-Shows and Movies) and point to the script file you made.
Setup Sorting in Sabnzbd if you want.
TV-Shows will be converted to MP4 and Sonarr takes care of the renaming and moving of files.
Movies will be converted to MP4 and Sabnzbd will take care of the renaming (if you use sorting) and moving files.
It is easy to change so it suits your wishes, files to delete Before converting, how to convert it, files to delete after etc.
P.S All THANKS goes to porp in this Thread! https://www.reddit.com/r/usenet/comment ... ically_in/
Updated script 29 October 2016 at 19:09 Added Timer to calculate time it takes to convert the file D.S