; ffmpeg info: ; also: http://forum.videohelp.com/threads/289790-mencoder-ts-to-avi-%28x264%29-with-multiple-audio-stream ; http://linuxers.org/tutorial/ffmpeg-basics-beginners ; ffmpeg -i test.ts -t 10 -b 1000k -vcodec libx264 output.mp4 ; MsgBox(0, "Debug", @ScriptDir) $ini_ffmpeg_location = IniRead("ts-ripper-config.ini", "Settings", "ffmpeg location", "NotFound") ; Get path of ffmpeg.exe from config file $ini_default_path = IniRead("ts-ripper-config.ini", "Settings", "Default location", @ScriptDir) ; Read last user defined location from the db. If FileExists($ini_ffmpeg_location & "\ffmpeg.exe") Then Call("PrepareRip") Else Call("LocateFfmpeg") EndIf Func LocateFfmpeg() ; locates the ffmpeg.exe if not found. Local $LocateFfmpegQuestion = MsgBox(1, "Whoops!", "ffmpeg.exe was not found." & @CRLF & @CRLF & "Click Ok to search for ffmpeg.exe") Switch $LocateFfmpegQuestion Case 1; Ok Global $WhereIsFfmpeg = FileOpenDialog("Locate your ffmpeg.exe", @ScriptDir & "\", "Exe (*.exe)", 1 + 4) If @error Then MsgBox(0, "!", "No File chosen - I quit!") Exit ElseIf $WhereIsFfmpeg == 2 Then ; Cancelled MsgBox(0, "!", "No File chosen - I quit!") Exit Else $FfmpegFolder = StringLeft($WhereIsFfmpeg, StringInStr($WhereIsFfmpeg, '\', 0, -1) - 1) ; copy the folder only from $TsPath IniWrite(@ScriptDir & "\ts-ripper-config.ini", "Settings", "ffmpeg location", $FfmpegFolder) ; Write last user defined folder location of ffmpeg.exe the db. If FileExists($FfmpegFolder & "\ffmpeg.exe") Then Call("PrepareRip") Else Call("LocateFfmpeg") EndIf EndIf Case 2; Cancel -> Exit program MsgBox(0, "!", "No File chosen - I quit!") Exit EndSwitch EndFunc Func PrepareRip() ; locate the file to rip. Local $PrepareRipQuestion = MsgBox(1, "Step 1:", "Select your .ts video file") Switch $PrepareRipQuestion Case 1; Ok Global $TsPath = FileOpenDialog("Locate your .ts file", $ini_default_path & "\", "Video (*.ts)", 1 + 4) If @error Then MsgBox(0, "!", "No File chosen - I quit!") Exit ElseIf $TsPath == 2 Then ; Cancelled MsgBox(0, "!", "No File chosen - I quit!") Exit Else $TsFolder = StringLeft($TsPath, StringInStr($TsPath, '\', 0, -1) - 1) ; copy the folder only from $TsPath IniWrite(@ScriptDir & "\ts-ripper-config.ini", "Settings", "Default location", $TsFolder) ; Write last user defined location from the db. Call("RipIt") EndIf Case 2; Cancel -> Exit program MsgBox(0, "!", "No File(s) chosen - I quit!") Exit EndSwitch EndFunc Func RipIt() ; Creates rip in same folder as original. $ffmpeg_command = $WhereIsFfmpeg & " -i " & $TsPath & " -b:v 1200k -vcodec libx264 " & $TsPath & ".mp4" ; The ffmpeg rip settings. Run($ffmpeg_command, "", @SW_MAXIMIZE) ; the ffmpeg command. EndFunc