Yeah why not. I see either a GUI or INI based CLI though. Can you just pass commands on the command line?
Will you tell me how to do something similar like:
ffmpeg -i "%1" -target pal-dvd -aspect 16:9 -b 8000k -maxrate 8812k -ab 384k -flags mv0 -mbd rd -cmp dct -precmp dct -subcmp dct -trellis 2 -dc 10 -pass 1 -passlogfile "%1" "%1.vob" \
& ffmpeg -i "%1" -target pal-dvd -aspect 16:9 -b 8000k -maxrate 8812k -ab 384k -flags mv0 -mbd rd -cmp dct -precmp dct -subcmp dct -trellis 2 -dc 10 -pass 2 -passlogfile "%1" "%1.vob"It's handy to have something like that sitting in your registry like so:
HKEY_CLASSES_ROOT\SystemFileAssociations\.avs\Shell\FFdvdLow\
@=Create VOB
HKEY_CLASSES_ROOT\SystemFileAssociations\.avs\Shell\FFdvdLow\Command
@=cmd /c ffmpeg -i "%1" -target pal-dvd -aspect 16:9 -b 8000k -maxrate 8812k -ab 384k -flags mv0 -mbd rd -cmp dct -precmp dct -subcmp dct -trellis 2 -dc 10 -pass 1 -passlogfile "%1" "%1.vob" & ffmpeg -i "%1" -target pal-dvd -aspect 16:9 -b 8000k -maxrate 8812k -ab 384k -flags mv0 -mbd rd -cmp dct -precmp dct -subcmp dct -trellis 2 -dc 10 -pass 2 -passlogfile "%1" "%1.vob"
In exchange I give you my script to batch encode a folder:
'' RED MpegBatcher script 0.3b6
'' Convert all .AVI files without an .MPG counterpart to .MPG using either FFMPEG or TMPGEnc
''
'' By Redsandro
'' 2008-09-07 - 2009-11-11
'' http://www.REDnet.nl/en/
' Usage:
'
' Copy this script to a folder full of .AVI's, or, add this command to your folder context-menu like so:
' Installation for Windows XP/Vista/7:
' HKEY_CLASSES_ROOT\Directory\shell\DGIndexFolder\Command
' @ = cscript.exe D:\Software\bin\FFMPEGFolder.vbs "%1"
'
' Edit a bunch of vars (Dim) below (the ones before the Subroutine starts) to suit your needs and make sure they are correct and existing. (!)
' TMPGEnc only:
' Copy a random video file to P:\Temp\TMPGEncBatcher.avi (with same specs as the files you are going to convert)
' Open TMPGEnc, load P:\Temp\TMPGEncBatcher.avi, apply your favorite settings, press ctrl+alt+M (Add project to Batch List), use P:\Temp\TMPGEncBatcher.avi as name, exit TMPGEnc.
'
' Notes:
'
' Depending on the parent app that calls this script (cscript.exe, command, registry shell extension, or some explorer replacement) the system32 folder from Windows will either be mapped to SysWOW64 or not.
' Make sure required commands are available from both (for example ffmpeg.exe)
'
' FFMPEG requires you to have installed AviSynth.
Option Explicit
'On Error Resume Next
' GLOBAL
'
' Set this to your encoding preference
' FFMPEG/TMPGEnc/AFTEREFFECTS
Dim encoder: encoder = "FFMPEG"
' Set this to trailing text in your .AVI name that's not in your .MPEG files.
' For example, my lagarith avifiles are named as "Shot 02.01.03 Morning.Laggy.avi" while the mpegs are called "Shot 02.01.03 Morning.mpg"
Dim aviTrail: aviTrail = ".Laggy"
' Similar for the mpegfile, if you want to do something crazy like appending a date.
' Note that this is included in the search for already mpegged files.
Dim mpgTrail: mpgTrail = ""
' TMPGEnc
'
' Set this to your TMPGEnc path INCLUDING END SLASH.
Dim TMPGEncPath: TMPGEncPath = "D:\Software\Video\TMPGEnc Plus\"
' Set this to your TMPGEnc executable.
Dim TMPGEnc: TMPGEnc = "TMPGEnc.exe"
' Set this to your temporary video folder. INCLUDE END SLASH.
Dim TempDir: TempDir = "P:\Temp\"
' Set this to your temporary video name. NO EXTENSION.
Dim TempFile: TempFile = "TMPGEncBatcher"
' FFMPEG
'
' Command
Dim FFavs: FFavs = "MpegBatcherFFMPEG.avs"
Dim FFmpg: FFmpg = "MpegBatcherFFMPEG.mpg"
Dim FFcmd: FFcmd = "ffmpeg -i " & FFavs & " -s hd1080 -aspect 16:9 -r 25 -vcodec mpeg2video -f vob -b 25M -mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 13 -bf 2 -ab 384k " & FFmpg & ""
'Dim FFcmd: FFcmd = "ffmpeg -i " & FFavs & " -s hd1080 -aspect 16:9 -r 25 -vcodec mpeg2video -f vob -b 25M -qmin 1 -qmax 31 -bufsize 35M -mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 13 -bf 2 -ab 384k " & FFmpg & "" ' fail blocky
'-qmin 1 -qmax 31 -vb 25000k -minrate 800k -maxrate 35000k -bufsize $[(512)*8]k -flags +ildct+ilme -f mpegts -y output--mpeg2hd.ts
' Private GLOBALs
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Dim currentFolder, fileDone, fileSkip, fsoFile, fileMpeg, pauseExit
Dim args, arg, tmp
Dim argVerbose: argVerbose = False
' Begin
Main
Sub Main
' set globals
Set currentFolder = fso.GetFolder(".")
fileDone = 0: fileSkip = 0
pauseExit = False
' Get arguments
Set args = WScript.Arguments
For Each arg in args
If arg = "-v" Then
argVerbose = True
Elseif fso.FolderExists(arg) Then
Set currentFolder = fso.GetFolder(arg)
parseCommand(arg)
Elseif fso.FileExists(arg) Then
' Single file encoding is a SHORTCUT, not severely tested.
currentFolder = fso.GetAbsolutePathName(arg)
currentFolder = fso.GetParentFolderName(currentFolder)
'WScript.Echo currentFolder
Set currentFolder = fso.GetFolder(currentFolder)
parseCommand currentFolder.Path
' Immediately do conversion and exit Main()
Dim File: Set File = fso.getFile(arg)
Dim fileBase: fileBase = fso.getBaseName(File.Name)
Dim fileExt: fileExt = fso.getExtensionName(File.Name)
If UCase(fileExt) = "AVI" Then
fileMpeg = Replace(fileBase, aviTrail, mpgTrail, 1, -1, 1) & ".mpg"
doFFMPEG File
End If
Exit Sub
End If
Next
' Begin output
WScript.Echo "**************************"
WScript.Echo "* RED MpegBatcher script *"
WScript.Echo "**************************"
WScript.Echo ""
WScript.Echo "Encoder: " & encoder
WScript.Echo ""
Select Case UCase(encoder)
Case "TMPGENC"
If Not dialogStart("TMPGEnc Free 2.5") Then Exit Sub
' Start the process if there's a batch project
If fso.FileExists(TMPGEncPath & "CurrentBatch.tbe") Then
' Make template copy of CurrentBatch.tbe to reset finished state again and again
WScript.Echo "Backing up CurrentBatch.tbe ..."
Set fsoFile = fso.GetFile(TMPGEncPath & "CurrentBatch.tbe")
fsoFile.Copy(TMPGEncPath & "CurrentBatch.tbe.bak")
Else
WScript.Echo "You did not save your project as a Batch List in TMPGEnc!"
WScript.Echo "Save a phoney single file '" & TempDir & TempFile & ".avi' to '" & TempDir & TempFile & ".mpg' conversion batch in TMPGEnc using your preferred settings, and this file will be used for all batch conversions."
pauseExit = True
End If
Case "FFMPEG"
If Not dialogStart("FFMPEG") Then Exit Sub
Case "AFTEREFFECTS"
WScript.Echo "This encoder is not explicitly added yet. Just edit the FFMPEG command line and you're off!"
pauseExit = True
Case Else
WScript.Echo "Invalid encoding option: " & encoder
pauseExit = True
End Select
If pauseExit = False Then
' Parse folder
parseFolder currentFolder
' Ergo Conclusio
WScript.Echo fileDone & " files encoded; " & fileSkip & " files were already encoded."
End If
WScript.Echo "Press ENTER to exit."
' Pause so the promt doesn't close immediately
Do While Not WScript.StdIn.AtEndOfLine
Dim Input: Input = WScript.StdIn.Read(1)
Loop
WScript.Echo "Done."
End Sub
Sub parseCommand(ByVal strPath)
' Replace %VAR%s in command line with actual values
tmp = Chr(34) & strPath & "\" & FFavs & Chr(34)
FFcmd = Replace(FFcmd, FFavs, tmp, 1, -1, 1)
tmp = Chr(34) & strPath & "\" & FFmpg & Chr(34)
FFcmd = Replace(FFcmd, FFmpg, tmp, 1, -1, 1)
End Sub
Function dialogStart(ByVal encoder)
WScript.Echo "Sending unprocessed .AVI files to " & encoder & " from this directory: "
WScript.Echo ""
WScript.Echo currentFolder.Path
WScript.Echo ""
WScript.Echo "Search for: *" & aviTrail & ".avi"
WScript.Echo "Without: *" & mpgTrail & ".mpg"
WScript.Echo ""
If Not promptYesNo("Continue? (y/n): ") Then dialogStart = False: Exit Function
WScript.Echo ""
dialogStart = True
End Function
Sub parseFolder (ByVal Folder)
' Prepare vars
Dim Files: Set Files = Folder.Files
Dim File
' Loop through dir
For Each File In Files
Dim fileBase: fileBase = fso.getBaseName(File.Name)
Dim fileExt: fileExt = fso.getExtensionName(File.Name)
If UCase(fileExt) = "AVI" Then
fileMpeg = Replace(fileBase, aviTrail, mpgTrail, 1, -1, 1) & ".mpg"
'fileMpeg = Replace(File.Name, aviTrail & ".avi", mpgTrail & ".mpg")
If Not fso.FileExists(currentFolder.Path & "\" & fileMpeg) Then
' Check for specified file trailing
If UCase(Right(fileBase,Len(aviTrail))) = UCase(aviTrail) Then
WScript.Echo File.Name & " FOUND"
WScript.Echo fileMpeg & " MISSING"
Select Case UCase(encoder)
Case "TMPGENC"
doTMPGEnc File
Case "FFMPEG"
doFFMPEG File
End Select
Else
fileSkip = fileSkip + 1
End If
Else
fileSkip = fileSkip + 1
End If
End If
Next
End Sub
' TMPGEnc functions
'
Sub doTMPGEnc (ByVal File)
' Dim vars
Dim tmpAvi: tmpAvi = TempDir & TempFile & ".avi"
Dim tmpMpeg: tmpMpeg = TempDir & TempFile & ".mpg"
' Check if temp files exists, delete..
If fso.FileExists(tmpAvi) Then
WScript.Echo "Deleting " & tmpAvi & " ..."
fso.DeleteFile(tmpAvi)
End If
If fso.FileExists(tmpMpeg) Then
WScript.Echo "Deleting " & tmpMpeg & " ..."
fso.DeleteFile(tmpMpeg)
End If
' Copy target file to temp file
Set fsoFile = fso.GetFile(File)
WScript.Echo "Copying " & File.Name & " to " & TempDir & "..."
fsoFile.copy(TempDir)
WScript.Echo "Renaming " & File.Name & " to " & TempFile & ".avi" & "..."
Set fsoFile = fso.GetFile(TempDir & File.Name)
fsoFile.Move(TempDir & TempFile & ".avi")
' Reset Batch List template
resetBatchList
' Run TMPGEnc in batch + autoclose mode
WScript.Echo "Starting " & TMPGEnc & "..."
WScript.Echo ""
run chr(34) & TMPGEncPath & TMPGEnc & chr(34) & " /batch /close"
fileDone = fileDone + 1
' Reset Batch List template again, (You'd understand why if you was debugging this script)
resetBatchList
' Successful? Delete .avi
If fso.FileExists(tmpAvi) Then
WScript.Echo "Deleting " & tmpAvi & " ..."
fso.DeleteFile(tmpAvi)
End If
' and move .mpg
WScript.Echo "Moving '" & tmpMpeg & "' to " & currentFolder.Path
Set fsoFile = fso.GetFile(tmpMpeg)
fsoFile.Move(currentFolder.Path & "\" & fileMpeg)
WScript.Echo ""
End Sub
Function resetBatchList()
WScript.Echo "Resetting CurrentBatch.tbe ..."
If fso.FileExists(TMPGEncPath & "CurrentBatch.tbe") Then
fso.DeleteFile(TMPGEncPath & "CurrentBatch.tbe")
End If
Set fsoFile = fso.GetFile(TMPGEncPath & "CurrentBatch.tbe.bak")
fsoFile.Copy(TMPGEncPath & "CurrentBatch.tbe")
End Function
' FFMPEG
'
Sub doFFMPEG (ByVal File)
' Create AVS file
WScript.Echo "Creating '" & FFavs & "'"
Dim avsFile: Set avsFile = fso.OpenTextFile (currentFolder.Path & "\" & FFavs, 2, True)
avsFile.WriteLine("AVISource(""" & File.Name & """)")
avsFile.WriteLine("ConvertToYV12(matrix=""Rec709"")")
avsFile.WriteLine("")
avsFile.Close
' Run FFMPEG
WScript.Echo "Starting ffmpeg.exe..."
WScript.Echo FFcmd
WScript.Echo ""
run FFcmd
' Alternate execution to run command from script dir:
'run "cmd /K CD """ & currentFolder.Path & "\"" & " & FFcmd
fileDone = fileDone + 1
' Rename MPEG
WScript.Echo "Renaming '" & FFmpg & "' to '" & fileMpeg & "'"
Set fsoFile = fso.GetFile(currentFolder.Path & "\" & FFmpg)
fsoFile.Move(currentFolder.Path & "\" & fileMpeg)
' Remove AVS file
WScript.Echo "Removing '" & FFavs & "'"
fso.DeleteFile(currentFolder.Path & "\" & FFavs)
WScript.Echo ""
End Sub
Function promptYesNo(ByVal strMsg)
Do
WScript.Echo strMsg
Dim key: key = WScript.StdIn.ReadLine()
Select Case LCase(Trim(key))
Case "n","no" promptYesNo = False: Exit Function
Case "y","yes" promptYesNo = True: Exit Function
End Select
WScript.StdOut.WriteLine "Just enter 'y' or 'n'..."
Loop
End Function
Sub run(ByVal executable)
Dim shell: Set shell = CreateObject("WScript.Shell")
shell.Run executable, 1, true
Set shell = Nothing
End Sub