Log in

View Full Version : Need Help with MKVmerge Batch


XadoX
8th June 2010, 09:02
I have a folder with many subfolders in it, eg. EP01, EP02, ..., EP99 and so on.

In every folder are files audio_eng_DELAY YXZms.m4a, audio_ger_DELAY XYZms.ac3 and VideoFile.mkv.

Now I want to mux them into one MKV file. So that every subfolder creates one mkv file.
I have no clue how to read out the audio delay automaticly.

Can someone help me please with this task?

XadoX
26th August 2010, 07:20
Still fighting with this task :(

J_Darnley
26th August 2010, 18:11
FOR /F "tokens=2" %%A IN ("filename") DO set VAR=%%A
DELAY=%VAR:~0,3%

stax76
26th August 2010, 18:42
How did you get this pattern in the first place?

XadoX
27th August 2010, 06:29
So now I have this:

@ECHO OFF
REM READ OUT FILENAMES
DIR /B *.ac3 > DELAY_AC3.txt
set /p DELAY_AC3=<DELAY_AC3.txt
DEL DELAY_AC3.TXT
DIR /B *.m4a > DELAY_M4A.txt
set /p DELAY_M4A=<DELAY_M4A.txt
DEL DELAY_M4A.TXT

REM READ OUT DELAYS
FOR /F "tokens=2" %%A IN ("%DELAY_AC3%") DO set VAR_AC3=%%A
SET FINAL_AC3=%VAR_AC3:~0,3%
FOR /F "tokens=2" %%A IN ("%DELAY_M4A%") DO set VAR_M4A=%%A
SET FINAL_M4A=%VAR_M4A:~0,3%

REM SHOW THE DELAYS
ECHO %FINAL_AC3%
ECHO %FINAL_M4A%

Now I have to create a cascaded loop which read out the delays first and the uses this delays and mux the files to a final mkv file.