VideoHelp Forum
+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 54 of 54
Thread
  1. Member
    Join Date
    Aug 2011
    Location
    Amsterdam
    Search Comp PM
    Ah ok, first cup of coffee is on me, just for your willingness to want to help at all (at 6 freaking AM)
    Quote Quote  
  2. Hey, I know this is an ancient thread, but I thought I would go ahead and post. I have found PatrickEM's script extremely useful, aside from the issue with trying to keep multiple (but not all) audio or subs tracks. Anyways, I recently found a solution after quite a bit of fussing, and it turns out it was pretty simple. While enclosing a comma in quotes is ineffective, I found that enclosing the full string of track numbers and commas with quotes seems to work. So for instance, instead of 3,4 or 3","4 try "3,4". So far it is working well for me. I reworked the script to allow for keeping all subtitle tracks as well as removing all (originally there was only the option to keep one or remove all, which limited its usefulness for me). I also reworded the onscreen prompts a bit.

    Here's my updated version:
    https://www.dropbox.com/s/9p1r7xv0govl8y7/mkvstrip.bat?dl=0

    Thanks for the original script, PatrickEM!
    Last edited by Surlias; 23rd Oct 2014 at 00:56.
    Quote Quote  
  3. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Originally Posted by samonia View Post
    Hi
    Please use MediaInfo to show me what's inside one of those mkv files.
    What?

    Are you just another troll or spammer?
    Quote Quote  
  4. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    It's a fetish.
    Quote Quote  
  5. Member assburger's Avatar
    Join Date
    Oct 2012
    Location
    Montreal, Quebec
    Search Comp PM
    Originally Posted by bat999 View Post
    Hi
    I can't see any problems with that printout.
    You want the video and the English soundtrack.

    Here's what to do.

    Shut down WinFF.
    Look among the WinFF files for a file named presets.xml
    Open it with a text editor.
    Then save it as presets_old.xml
    (That's your backup if things go pearshaped).

    Now we add an extra preset to the file.
    Look at the file, you see the top 2 lines probably look something like this :-
    Code:
    <?xml version=\\\\\\\\\\\\\\\\\\\\\"1.0\\\\\\\\\\\\\\\\\\\\\"?>
    <presets>
    Now you need to paste some text straight underneath it.

    This is the text:-

    Code:
      <mkv2>
        <label>mkv Video and second audio</label>
        <params>-map 0:0 -map 0:2 -vcodec copy -acodec copy</params>
        <extension>mkv</extension>
        <category>Special</category>
      </mkv2>
    So when you've finished the top will look something like this (with all the original presets underneath)
    Code:
    <?xml version=\\\\\\\\\\\\\\\\\\\\\"1.0\\\\\\\\\\\\\\\\\\\\\"?>
    <presets>
      <mkv2>
        <label>mkv Video and second audio</label>
        <params>-map 0:0 -map 0:2 -vcodec copy -acodec copy</params>
        <extension>mkv</extension>
        <category>Special</category>
      </mkv2>
    Now save the file.
    Then start WinFF.
    You should see a new category named 'Special'.
    And a preset named 'mkv Video and second audio'.

    If everything looks OK, test it with one mkv file before you try to do the whole batch

    EDIT
    It's just occurred to me.
    You might need to use the parameter -sn to prevent the subtitles from being copied.
    So in the text that I gave you above, look at the line:-
    Code:
    <params>-map 0:0 -map 0:2 -vcodec copy -acodec copy</params>
    and change it to:-
    Code:
    <params>-map 0:0 -map 0:2 -vcodec copy -acodec copy -sn</params>
    Then save the file again.

    Thanks bat, I tried adding a profile in winff, using these parameters: "-map 0:0 -map 0:2 -vcodec copy -acodec copy"
    This gives me the error message: "Number of stream maps must match number of output streams".
    Probably that profile will work OK if you use -sn!
    "-map 0:0 -map 0:2 -vcodec copy -acodec copy -sn"
    THIS is exactly what i was googling for! thank you! (My mkv files folder has a structure 4 audio tracks, of which i need only the 4th one - so i changed the 0:2 to 0:4)

    Only one small thing - i need the subtitles to remain - how do i do this? i tried with and without the -sn but it always removes the subs!

    P.S.
    Is it possible to also, while removing batch tracks, to convert the remaining tracks from DTS to AC3?
    I can do it later via Popcorn converter, but would be convenient if this could be done all at the same time
    Last edited by assburger; 11th Mar 2015 at 19:41.
    God is a superstition; religion is poison.
    Quote Quote  
  6. hi @ll

    after downloading and playing around with 64bit edition of https://www.videohelp.com/software/MKVtoolnix i wanted it to be done more automatic

    !!!!!!!!!!!!!!!!!!!!!!!!!! Thx !!!!!!!!!!!!!!!!!!!!!!
    to PatrickEM and Surlias
    Originally Posted by PatrickEM View Post
    ...
    Originally Posted by Surlias View Post
    ...


    i only changed 2 things

    1st path to mkvmerge.exe
    since i didn't want to change my windows path variable to include the c:\Program Files\MKVToolNix\ directory or copy the exe around... i just hard coded it into the .BAT

    2nd the Output directory
    ... since i have more than one HDD i want to used the performance gain of reading from one and writing the new files to another HDD thus rendering the automatic output folder Creation useless .. hence the REM in front of it.. you could also delete these lines


    what remains... is to copy the .bat to the Dir with the files u wanna edit

    paste in editor and save and save as .bat file
    Code:
    @echo off
    
    title MKVstrip
    
    cls
    set /p MM=This batch script will strip unwanted audio/subtitle tracks from ALL .mkv files in the directory it is run from. The changes will be made to copies of the files and the originals will remain untouched. For this reason, please make sure you have enough disk space for the output files. Continue? (Y/N):
    IF '%MM%' == 'Y' GOTO AS
    IF '%MM%' == 'y' GOTO AS
    IF '%MM%' == 'N' GOTO EN
    IF '%MM%' == 'n' GOTO EN
    
    :AS
    echo.
    set /p AT=Type the track ID(s) of the audio track(s) you would like to KEEP, seperated by commas. For multiple tracks, enclose the entire statement in quotes (to KEEP ALL type a, or to view track IDs type i):
    IF '%AT%' == 'i' GOTO ID
    IF '%AT%' == 'a' GOTO SSNA
    IF '%AT%' == 'A' GOTO SSNA
    
    :SS
    echo.
    set /p ST=Type the track ID(s) of the subtitle track(s) you would like to KEEP, seperated by commas. For multiple tracks, enclose the entire statement in quotes (if none are present or to REMOVE ALL then type n, or to keep all type a):
    IF '%ST%' == 'n' GOTO NS
    IF '%ST%' == 'N' GOTO NS
    IF '%ST%' == 'a' GOTO ASS
    IF '%ST%' == 'A' GOTO ASS
    
    :WS
    echo.
    rem md output
    for %%i in (*.mkv) do "c:\Program Files\MKVToolNix\mkvmerge.exe" -o d:/!temp/"%%i" --atracks "%AT%" --stracks "%ST%" "%%i"
    echo.
    Echo The process is complete. The stripped files are located in the "output" folder.
    pause
    exit
    
    :SSNA
    echo.
    set /p ST=Type the track ID(s) of the subtitle track(s) you would like to KEEP, seperated by commas. For multiple tracks, enclose the entire statement in quotes (if none are present or to REMOVE ALL then type n, or to keep all type a):
    IF '%ST%' == 'n' GOTO NANS
    IF '%ST%' == 'N' GOTO NANS
    IF '%ST%' == 'a' GOTO NASS
    IF '%ST%' == 'A' GOTO NASS
    
    :NA
    echo.
    rem md output
    for %%i in (*.mkv) do "c:\Program Files\MKVToolNix\mkvmerge.exe" -o d:/!temp/"%%i" --stracks "%ST%" "%%i"
    echo.
    Echo The process is complete. The stripped files are located in the "output" folder.
    pause
    exit
    
    :NANS
    echo.
    rem md output
    for %%i in (*.mkv) do "c:\Program Files\MKVToolNix\mkvmerge.exe" -o d:/!temp/"%%i" --no-subtitles "%%i"
    echo.
    Echo The process is complete. The stripped files are located in the "output" folder.
    pause
    exit
    
    :NS
    echo.
    rem md output
    for %%i in (*.mkv) do "c:\Program Files\MKVToolNix\mkvmerge.exe" -o d:/!temp/"%%i" --atracks "%AT%" --no-subtitles "%%i"
    echo.
    Echo The process is complete. The stripped files are located in the "output" folder.
    pause
    exit
    
    :ASS
    echo.
    rem md output
    for %%i in (*.mkv) do "c:\Program Files\MKVToolNix\mkvmerge.exe" -o d:/!temp/"%%i" --atracks "%AT%" "%%i"
    echo.
    Echo The process is complete. The stripped files are located in the "output" folder.
    pause
    exit
    
    :NASS
    echo.
    rem md output
    for %%i in (*.mkv) do "c:\Program Files\MKVToolNix\mkvmerge.exe" -o d:/!temp/"%%i" "%%i"
    echo.
    Echo The process is complete. The stripped files are located in the "output" folder.
    pause
    exit
    
    :ID
    echo.
    for %%i in (*.mkv) do "c:\Program Files\MKVToolNix\mkvmerge.exe" -i "%%i"
    echo.
    pause
    GOTO AS
    
    :EN
    exit



    the only thing being more awesome .. would be for auto detection of the eng. audio track to be the one kept...

    in the mkvtoolnix-gui.exe i see an info of the tracks respective language code, like "eng" but not in the command line
    Quote Quote  
  7. Originally Posted by Sepgod View Post
    in the mkvtoolnix-gui.exe i see an info of the tracks respective language code, like "eng" but not in the command line
    mkvmerge --identify-verbose "input.mkv"
    Quote Quote  
  8. Member
    Join Date
    Jul 2015
    Location
    South Carolina
    Search Comp PM
    Originally Posted by PatrickEM View Post
    THANK YOU!
    Here it is, 2015. I found your .bat file and it was exactly what I was looking for!
    With your .bat file, I was able to strip the Italian audio track 1 from 6 seasons of 'Lost'. Now I can play the .mkv's back-to-back without having to switch audio tracks each time a new episode starts.
    Quote Quote  
  9. This thread saved my life. Thank you to all the contributors, especially PatrickEM for his bat.

    Since i needed this for avi files i just edited it and changed all *.mkv to *.avi. Script attached.

    You guys kick ass.
    Image Attached Files
    Last edited by CardinalFang; 4th Aug 2015 at 05:25.
    Quote Quote  
  10. Member
    Join Date
    Oct 2012
    Location
    United States
    Search Comp PM
    It's been a while. Amazing to see people still thanking me after all this time.

    I'd like to apologize to anyone in this thread who was still waiting for me to respond (especially tijgert, really sorry man), but I no longer even own a valid Windows license, so further batch file tweaking was out of the question for me, and I have moved on to ffmpeg+AppleScript to fill these needs. Nice to see that other people stepped up to fill the empty space I so negligently left behind.

    I should really get more active around here someday...
    Quote Quote  
  11. Originally Posted by Surlias View Post
    Hey, I know this is an ancient thread, but I thought I would go ahead and post. I have found PatrickEM's script extremely useful, aside from the issue with trying to keep multiple (but not all) audio or subs tracks. Anyways, I recently found a solution after quite a bit of fussing, and it turns out it was pretty simple. While enclosing a comma in quotes is ineffective, I found that enclosing the full string of track numbers and commas with quotes seems to work. So for instance, instead of 3,4 or 3","4 try "3,4". So far it is working well for me. I reworked the script to allow for keeping all subtitle tracks as well as removing all (originally there was only the option to keep one or remove all, which limited its usefulness for me). I also reworded the onscreen prompts a bit.

    Here's my updated version:
    https://www.dropbox.com/s/9p1r7xv0govl8y7/mkvstrip.bat?dl=0

    Thanks for the original script, PatrickEM!
    Oh how I wish it worked for me. I put the mkv video in a folder together with the .bat file. I double-clicked on it and then it asked if i had enough space, i typed "Y" and pressed enter, then it asked me which audio stream i'd like to keep. When I type "i" and enter it tells me mkvmerge is not recognized as an internal or external command. I'm a complete dummy. Am I doing something wrong?
    Quote Quote  
  12. you have to have mkvmerge.exe in the same folder as well
    Quote Quote  
  13. A few posts up, Sepgod posted an updated version of the script that allows you to point to the path where mkvmerge.exe is installed, instead of requiring it to be present in the directory with the videos you are remuxing.
    Quote Quote  
  14. great! it didn't occur to me this might be the issue, thank you guys
    Quote Quote  
  15. Member
    Join Date
    Dec 2015
    Location
    DeLand, Florida USA
    Search Comp PM
    I know this is an old thread but,

    I use the following command prompt entry to batch process files to eliminate unneeded audio files. I place all the files I want to convert in a folder then change the command prompt entry folder names - it works. The command, in this case, eliminates the unwanted audio track and assigns the remaining audio as 'eng' - it names the new file same as the original name with an added .mkv extension.

    Example: Input file name - inputfile.avi Output file name becomes inputfile.avi.mkv.

    My question is how do I change the command to output a file named inputfile.mkv (without the .avi included in the name). Currently I use a renaming program to delete the '.avi' in the output file name. Like I say it works okay, but I'm sure there is a way to alter the command prompt command to output the original file name without the .avi extension being included in output file name.

    My procedure is as follows:

    Open Command Prompt
    change command prompt dir to input folder dir
    change directory names in command line below then execute.

    FOR /F "delims=*" %A IN ('dir /b *.avi') DO "C:/Program Files/MKVToolNix\mkvmerge.exe" ^"--ui-language^" ^"en^" ^"--output^" ^"D:/OutputFolder/%A.mkv^" ^"--audio-tracks^" ^"2^" ^"--language^" ^"0:und^" ^"--language^" ^"2:eng^" ( ^"D:/InputFolder/%A^" ) ^"--track-order^" ^"0:0,0:2^"

    Rename the misnamed files.

    What do I change the instances of %A to in the command (ie. ^"D:/OutputFolder/%A.mkv^) to get the original file name without the old extension included?
    Quote Quote  
  16. Member
    Join Date
    Dec 2015
    Location
    DeLand, Florida USA
    Search Comp PM
    Originally Posted by noblemd View Post
    I know this is an old thread but,

    I use the following command prompt entry to batch process files to eliminate unneeded audio files. I place all the files I want to convert in a folder then change the command prompt entry folder names - it works. The command, in this case, eliminates the unwanted audio track and assigns the remaining audio as 'eng' - it names the new file same as the original name with an added .mkv extension.

    Example: Input file name - inputfile.avi Output file name becomes inputfile.avi.mkv.

    My question is how do I change the command to output a file named inputfile.mkv (without the .avi included in the name). Currently I use a renaming program to delete the '.avi' in the output file name. Like I say it works okay, but I'm sure there is a way to alter the command prompt command to output the original file name without the .avi extension being included in output file name.

    My procedure is as follows:

    Open Command Prompt
    change command prompt dir to input folder dir
    change directory names in command line below then execute.

    FOR /F "delims=*" %A IN ('dir /b *.avi') DO "C:/Program Files/MKVToolNix\mkvmerge.exe" ^"--ui-language^" ^"en^" ^"--output^" ^"D:/OutputFolder/%A.mkv^" ^"--audio-tracks^" ^"2^" ^"--language^" ^"0:und^" ^"--language^" ^"2:eng^" ( ^"D:/InputFolder/%A^" ) ^"--track-order^" ^"0:0,0:2^"

    Rename the misnamed files.

    What do I change the instances of %A to in the command (ie. ^"D:/OutputFolder/%A.mkv^) to get the original file name without the old extension included?
    Problem solved: Changed the command to:

    FOR /F "delims=*" %I IN ('dir /b *.avi') DO "C:/Program Files/MKVToolNix\mkvmerge.exe" ^"--ui-language^" ^"en^" ^"--output^" ^"D:/OutputFolder/%~nI.mkv^" ^"--audio-tracks^" ^"2^" ^"--language^" ^"0:und^" ^"--language^" ^"2:eng^" ( ^"D:/InputFolder/%I^" ) ^"--track-order^" ^"0:0,0:2^"

    With this change, the batch process runs properly, making the changes and outputing files with the original name (substituting an extension of .mkv without the old extension in the name).

    NOTE: The ('dir /b *.avi') needs to be changed to the your input files extension.
    For input files with .mkv extension it needs to be changed to ('dir /b *.mkv') .

    ************************************************** ********************

    BTW: I got the main part of this command by opening MKVMerge, adding one of the files I wanted to change, made the changes to the track attachments (Unchecking the audio track I wanted to elliminate, changing the remaining audio track language to english) and then MENU - Merge -- Show command line --- copy to clipboard. Made changes (noted in the quote) in my text editor and pasted the changed command into the Command Prompt.

    Example MKVMerge Command line:

    "C:/Program Files/MKVToolNix\mkvmerge.exe" ^"--ui-language^" ^"en^" ^"--output^" ^"D:/InputFolder/Inputfile.S04E01.mkv^" ^"--audio-tracks^" ^"2^" ^"--language^" ^"0:und^" ^"--language^" ^"2:eng^" ( ^"D:/InputFolder/Inputfile.S04E01.avi^" ) ^"--track-order^" ^"0:0,0:2^"
    Last edited by noblemd; 16th Dec 2015 at 13:24.
    Quote Quote  
  17. Member
    Join Date
    Apr 2016
    Location
    Norway
    Search Comp PM
    I've used the following PowerShell script to remove the DTS-HD audio tracks from all my TV series BD-rips.

    I wanted to keep audio track 2 (regular DTS) and subtitle track 3 from them all, so I just hard-coded that into the script. You can always alter the script to take arguments from command-line or in-script dialogues.

    Code:
    $env:Path += ";C:\Program Files\MKVToolNix\"
    $files = Get-ChildItem -Include *.mkv -Name -Recurse | Sort-Object
    Foreach ($Item in $files) {mkvmerge -o new_folder/$Item --atracks 2 --stracks 3 $Item}
    The first line is to temporarily add the MKVToolNix folder to PATH.
    The second line scapes the current folder, and all subfolders, finds all .mkv files and adds them to a collection, sorted by name.
    The third line processes the input-files, removing the DTS-HD track (audio track 1) and stores the new file in a folder names "new_folder".
    Quote Quote  
  18. I will add to this old thread as others may end up here as I did, but still not find a workable solution.

    Selecting the audio and video tracks by static numbers is a no go, as a few others have noted, I can't count on the order of the tracks (video before audio or one language before another) in the video file.

    So I wrote a vbscript file that uses mkvmerge to identify the tracks and languages of interest, and then builds and executes the command to create a new mkv file with the desired tracks.
    • The script can be executed by dragging and dropping video files on to the script.
    • The source video file is renamed to filename.ext.tmp in the orginal folder.
    • The new video file is named filename.mkv in the orginal folder.
    • My video files are named in the format "title (year) [rating].mkv". The title and year are written to the track name fields.
    • Optionally, auto deletion of the source video can be enabled by uncommenting the "Call DeleteSource" sub routine, once your confident that the script does what you want.
    • I am selecting on english and undefined tracks, you can change to other language codes as needed.
    • If at least one audio and one video track are not identified, the script stops processing that file and leaves it with a .tmp extension for manual examination.
    For a more advanced integration, create a batch file "ConvertToMKV.cmd" containing the single line
    "C:\path to your vbscript\ConvertToMKV.vbs" %*
    Place the batch file in "C:\Users\Your Username\AppData\Roaming\Microsoft\Windows\SendTo"
    Why the batch file? If you put the vbs script in "SendTo" and select multiple videos, they process in parallel (all at the same time, each running thier own copy of mkvmerge). If you use the batch file to call the vbs script, they run in serial (one at a time, only one mkvmerge instance in memory at a time).


    So here is my script, I call ConvertToMKV.vbs

    'Start of script

    Option Explicit
    Dim strInputFileName
    Dim strBaseFileNameNoExt
    Dim strTempFileName
    Dim strOutputFileName
    Dim MediaObjectList
    Dim objArgs
    Dim objFSo
    Dim objShell
    Dim strTitle
    Dim strTitleChunks
    Dim TrackSelection
    Set objArgs = WScript.Arguments
    Set objFSo = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("WScript.Shell")

    For Each strInputFileName in objArgs
    Call GetBaseFileNameNoExt ' FQ FileName without extension
    Call ParseTitle ' Filename without Path or Extension
    Call GetTrackInfo ' Identify Desired Tracks
    Call RenameInputFile ' Rename Input to .tmp in case input is already .mkv
    Call SetOutputFileName ' FQ FileName with MKV extension
    Call RemuxFile ' Remux
    'Call DeleteSource ' Delete Source if Output Created
    Next

    Sub GetBaseFileNameNoExt
    strBaseFileNameNoExt = Trim(Left(strInputFileName,InstrRev(strInputFileNa me,".")-1))
    End Sub 'GetBaseFileNameNoExt

    Sub RenameInputFile
    strTempFileName = strInputFileName & ".tmp"
    objFSO.MoveFile strInputFileName ,strTempFileName
    End Sub 'RenameInputFile

    Sub SetOutputFileName
    strOutputFileName = strBaseFileNameNoExt & ".mkv"
    End Sub 'SetOutputFileName

    Sub ParseTitle
    strTitleChunks = Split(strBaseFileNameNoExt,"\")
    strTitle = strTitleChunks(UBound(strTitleChunks))
    If Instr(strTitle,"[") Then strTitle = Trim(Left(strTitle,InstrRev(strTitle,"[")-1))
    End Sub 'ParseTitle

    Sub GetTrackInfo
    Dim CommandLine
    Dim MediaObject
    Dim MediaObjects
    Dim Track
    Dim VideoTracks
    Dim AudioTracks
    Dim SubTracks
    Dim TrackOrder
    TrackSelection = ""

    CommandLine = """" & GetMKVExecutable & """ "
    CommandLine = CommandLine & "-i -F verbose-text "
    CommandLine = CommandLine & """" & strInputFileName & """ "
    Set MediaObjectList = objShell.Exec(CommandLine)
    MediaObjects = Split(MediaObjectList.StdOut.ReadAll, vbCrLf)
    For Each MediaObject In MediaObjects
    Select Case Left(MediaObject,8)
    Case "Track ID"
    Track = Split(MediaObject," ",5)
    Select Case Track(3)
    Case "video"
    TrackSelection = TrackSelection & "--track-name """ & Track(2) & strTitle & """ "
    VideoTracks = VideoTracks & " " & Replace(Track(2),":","")
    Case "audio"
    If Instr(Track(4),"language:eng") Then
    TrackSelection = TrackSelection & "--track-name """ & Track(2) & strTitle & """ "
    AudioTracks = AudioTracks & " " & Replace(Track(2),":","")
    ElseIf Instr(Track(4),"language") = 0 Then
    TrackSelection = TrackSelection & "--track-name """ & Track(2) & strTitle & """ "
    AudioTracks = AudioTracks & " " & Replace(Track(2),":","")
    End If
    Case "subtitles"
    If Instr(Track(4),"language:eng") Then
    TrackSelection = TrackSelection & "--track-name """ & Track(2) & strTitle & """ "
    SubTracks = SubTracks & " " & Replace(Track(2),":","")
    ElseIf Instr(Track(4),"language") = 0 Then
    TrackSelection = TrackSelection & "--track-name """ & Track(2) & strTitle & """ "
    SubTracks = SubTracks & " " & Replace(Track(2),":","")
    End If
    Case Else
    'msgbox(Track(3))
    'Not Processing other values at this time
    End Select
    Case Else
    'Not Processing other values at this time
    End Select
    Next
    If Len(SubTracks) > 0 Then
    TrackSelection = "-s " & Replace(Trim(SubTracks)," ",",") & " " & TrackSelection
    TrackOrder = Replace(RTrim(SubTracks)," "," 0:")
    Else
    TrackSelection = "-S " & TrackSelection
    End If
    If Len(AudioTracks) > 0 Then
    TrackSelection = "-a " & Replace(Trim(AudioTracks)," ",",") & " " & TrackSelection
    TrackOrder = Replace(RTrim(AudioTracks)," "," 0:") & TrackOrder
    End If
    If Len(VideoTracks) > 0 Then
    TrackSelection = "-d " & Replace(Trim(VideoTracks)," ",",") & " " & TrackSelection
    TrackOrder = Replace(RTrim(VideoTracks)," "," 0:") & TrackOrder
    End If
    TrackOrder = "--track-order " & Replace(Trim(TrackOrder)," ",",")
    TrackSelection = TrackSelection & TrackOrder & " "
    End Sub 'GetTrackInfo

    Sub RemuxFile
    Dim CommandLine
    CommandLine = """" & GetMKVExecutable & """ "
    CommandLine = CommandLine & "--title """ & strTitle & """ --no-global-tags --no-track-tags "
    CommandLine = CommandLine & TrackSelection
    CommandLine = CommandLine & "-o """ & strOutputFileName & """ "
    CommandLine = CommandLine & """" & strTempFileName & """ "

    If Instr(TrackSelection,"-d ") = 0 Then Exit Sub 'Video Track Not Identified
    If Instr(TrackSelection,"-a ") = 0 Then Exit Sub 'Audio Track Not Identified
    objShell.Run CommandLine,7,True
    End Sub 'RemuxFile

    Sub DeleteSource
    If ValidFile(strOutputFileName) Then objFSO.DeleteFile strTempFileName
    End Sub 'DeleteSource

    Function GetMKVExecutable
    If ValidFile("C:\Program Files\MKVToolNix\mkvmerge.exe") Then
    GetMKVExecutable = "C:\Program Files\MKVToolNix\mkvmerge.exe"
    ElseIf ValidFile("C:\Program Files (x86)\MKVToolNix\mkvmerge.exe") Then
    GetMKVExecutable = "C:\Program Files (x86)\MKVToolNix\mkvmerge.exe"
    Else
    GetMKVExecutable = NULL
    msgbox("*** MKV Tools NOT Detected ***")
    End If
    End Function 'GetMKVExecutable

    Function ValidFile(FileName)
    Dim Outfile
    ValidFile = False
    If objFSO.FileExists(FileName) Then
    Set Outfile = objFSO.GetFile(FileName)
    If Outfile.size > 100 Then
    ValidFile = True
    End If
    End If
    End Function 'ValidFile

    'End of script

    I hope that this makes life easier for someone.
    Quote Quote  
  19. Nice one, High Plains Scripter
    Really handy!

    Thanks

    sebus
    Quote Quote  
  20. Hi @High Plains Scripter and @PatrickEM...

    Any chance of updating your scripts (I use both, love them!) to support MKVtoolnix v20? I've done a little digging and have determined...

    They both work with v19 but since v20 they have dropped "-i -F verbose-text" from mkvmerge.exe as per:

    http://ubuntuhandbook.org/index.php/2018/01/mkvtoolnix-20-0-0-released-with-mkvinfo-rewritten/

    I believe the same functionality can be derived from mkvinfo.exe and/or using the command line argument "-i -F json" from mkvmerge.exe.

    THANKS AGAIN, your scripts are so good I'm refusing to update to v20 (and all the associated bug fixes) of MKVtoolnix just so I can continue to use your scripts.
    Last edited by kurosh; 20th Jan 2018 at 07:31.
    Quote Quote  
  21. Originally Posted by kurosh View Post
    Hi @High Plains Scripter and @PatrickEM...

    Any chance of updating your scripts (I use both, love them!) to support MKVtoolnix v20? I've done a little digging and have determined...

    They both work with v19 but since v20 they have dropped "-i -F verbose-text" from mkvmerge.exe as per:

    http://ubuntuhandbook.org/index.php/2018/01/mkvtoolnix-20-0-0-released-with-mkvinfo-rewritten/

    I believe the same functionality can be derived from mkvinfo.exe and/or using the command line argument "-i -F json" from mkvmerge.exe.

    THANKS AGAIN, your scripts are so good I'm refusing to update to v20 (and all the associated bug fixes) of MKVtoolnix just so I can continue to use your scripts.
    Hello... anyone...?
    Quote Quote  
  22. Originally Posted by kurosh View Post
    Originally Posted by kurosh View Post
    Hi @High Plains Scripter and @PatrickEM...

    Any chance of updating your scripts (I use both, love them!) to support MKVtoolnix v20? I've done a little digging and have determined...

    They both work with v19 but since v20 they have dropped "-i -F verbose-text" from mkvmerge.exe as per:

    http://ubuntuhandbook.org/index.php/2018/01/mkvtoolnix-20-0-0-released-with-mkvinfo-rewritten/

    I believe the same functionality can be derived from mkvinfo.exe and/or using the command line argument "-i -F json" from mkvmerge.exe.

    THANKS AGAIN, your scripts are so good I'm refusing to update to v20 (and all the associated bug fixes) of MKVtoolnix just so I can continue to use your scripts.
    Hello... anyone...?
    Anyone out there?
    Quote Quote  
  23. Is this thread dead?

    Originally Posted by kurosh View Post
    Originally Posted by kurosh View Post
    Originally Posted by kurosh View Post
    Hi @High Plains Scripter and @PatrickEM...

    Any chance of updating your scripts (I use both, love them!) to support MKVtoolnix v20? I've done a little digging and have determined...

    They both work with v19 but since v20 they have dropped "-i -F verbose-text" from mkvmerge.exe as per:

    http://ubuntuhandbook.org/index.php/2018/01/mkvtoolnix-20-0-0-released-with-mkvinfo-rewritten/

    I believe the same functionality can be derived from mkvinfo.exe and/or using the command line argument "-i -F json" from mkvmerge.exe.

    THANKS AGAIN, your scripts are so good I'm refusing to update to v20 (and all the associated bug fixes) of MKVtoolnix just so I can continue to use your scripts.
    Hello... anyone...?
    Anyone out there?
    Quote Quote  
  24. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Try replacing all instances of mkvmerge.exe with mkvinfo.exe. If info takes the same params and produces the same output, it should work. Switching to JSON output will take substantial rewriting of GetTrackInfo.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!