VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. i have a mkv video file, and a number of aac audio tracks, that i want to insert into the mkv file, replacing the existing audio tracks. for example:

    HTML Code:
    - 01.mkv
    video file, contains following tracks in the given order:
      [0] video track
      [1] audio track
      [2] audio track
    
    - 01_1.aac
    audio file, should replace audio track in 01.mkv at ID [1]
    
    - 01_2.aac
    audio file, should replace audio track in 01.mkv at ID [2]
    i want to automate this to repeat for many videos, so i need a batch command. the output should be placed in a new file, eg. 01_replaced.mkv. the video track should remain untouched, the audio tracks are to be replaced with the given files at the given positions.

    looking at the mkvmerge manual (https://mkvtoolnix.download/doc/mkvmerge.html) i find options to rearrange tracks, copy tracks, rename tracks, etc. but there seems to be no option for replacing or overwriting an existing track in a file.

    is mkvmerge the right tool for this? can anybody give me a hint on how to pull this off?

    thanx for any helpful comments
    Quote Quote  
  2. No muxer can replace tracks in a file. They have remux the requested tracks to a new file then delete the original(s).
    Quote Quote  
  3. First demux the video track with mkvextract then use mkvmerge, eg

    Code:
    for %%h in (*.mkv) do (
     mkvextract.exe tracks "%%h" 0:%%~nh.h264
     mkvmerge -o "%%~nh_replaced.mkv" "%%~nh.h264" "%%~nh_1.aac" "%%~nh_2.aac")
    Quote Quote  
  4. Code:
    for %%a in (*.mkv) do mkvmerge -o "%%~na_replaced.mkv" --no-audio "%%a" "%%~na_1.aac" "%%~na_2.aac"
    Quote Quote  



Similar Threads

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