Log in

View Full Version : Workflow to add a AAC compatibility track to MKV files


ultradj83
28th August 2023, 18:27
Dears,
I have 361 MKV files organized in a Artist / Title folder tree.
Such files usually have DTS or AC3 or LPCM or AAC audio tracks.
For those who don't have a AAC track, I need to add it to avoid compatibility issues with some players.

I'm in difficult in determining an automatic workflow for these.

Regards

Kisa_AG
30th August 2023, 14:29
I'm in difficult in determining an automatic workflow for these.

Hello!

There is something very similar to what you are looking for in MediaInfo CLI help:

Batch Processing Example

If a file C:\video\USA Holiday.mpg contains AC-3 audio, then this may be determined and used in the following C:\conversion.bat called using:

C:\conversion.bat C:\video\USA Holiday.mpg

---conversion.bat--------------------------------------------------
@echo off
: Get the codec
C:\Programs\mediainfo_cli\mediainfo.exe --Inform=Audio;%%Codec%% %1 > C:\value.txt
: Read it
for /f "tokens=*" %%A in ('type C:\miresult.txt') do set myVar=%%A
: Test for AC-3
if ".%myvar%" == ".AC-3" goto :AC3
: non-AC-3 processing follows
ffmpeg.....
goto :exit
:AC3
: AC-3 processing follows
ffmpeg....
:exit
---------------------------------------------------------------------

Hope this helps.