VideoHelp Forum

+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Hi! I'm trying to swap track position on multiple files at once, I've tried this script:

    for %%a in ("*.mkv") do mkvpropedit "%%a" ^
    --track-order 0:0,0:2,0:1,0:3,0:4

    Which should swap track 2 position with track 1 on all MKV files in the same folder, I say should but actually it doesn't - I am missing something?
    Quote Quote  
  2. --track-order is an option for mkvmerge, not mkvpropedit.
    Quote Quote  
  3. Tried but didn't work... what's the command to not auto-close the command prompt window so I can read what it says? maybe there's some an error it identifies
    Quote Quote  
  4. Originally Posted by RandomNewbe View Post
    what's the command to not auto-close the command prompt window so I can read what it says?
    pause

    With mkvmerge you need to supply input and output filenames.

    Code:
    mkvmerge --track-order 0:0,0:2,0:1,0:3,0:4 input.mkv -o output.mkv
    pause
    Quote Quote  
  5. Edit: Okay I found a semi-working script:


    for %%y in (*.mp4) do mkvmerge -o "%%~dpny.mkv" "%%~fy" --track-order 0:0,0:2,0:1,0:3,0:4

    pause

    However for this to work I have to rename all .mkv files to .mp4 because if I specify to process the .mkv files I get an error (since the output would overwrite the input files and the script won't let me do that)

    Image
    [Attachment 67776 - Click to enlarge]

    "Error: The name of the destination file "<path>" and of one of the source files is the same. This would case mkvmerge to overwrite one of your source files."

    Is there a way to have to output files slightly renamed so it doesn't cause an overwrite error?
    Last edited by RandomNewbe; 23rd Nov 2022 at 08:58.
    Quote Quote  
  6. Originally Posted by RandomNewbe View Post
    However for this to work I have to rename all .mkv files to .mp4 because if I specify to process the .mkv files I get an error (since the output would overwrite the input files and the script won't let me do that)
    Add something to the output filename, or specify a sub-folder:

    Code:
    for %%y in (*.mkv) do mkvmerge  -o "%%~dpny_reordered.mkv" "%%~fy" --track-order 0:0,0:2,0:1,0:3,0:4
    pause
    Quote Quote  
  7. That's perfect ~ thanks a lot <3
    Quote Quote  



Similar Threads