Best way to handle a folder with multiple audio formats

Here’s an alternative idea using profiles. MCEBuddy profiles has a feature called unsupported combinations. Basically for a profile encoder you can specify unsupported combinations of video, audio and container parameters. If it encounters this combination that encoder is skipped and it moves onto the next one. More details here:

Using this parameter you can approach this in two different ways

  1. Use the first encoder to not handle certain combinations (e.g. handbrake doesn’t handle DTS streams and copies the audio tracks) and then another one to handle the rest (ffmpeg encodes all audio tracks into ac3). An example of this would look like this (just the relevant part of the profile, you need to fill in the rest):

    order=handbrake,ffmpeg
    handbrake-unsupported=dts
    handbrake-audio=-E copy
    handbrake-audioac3=-E copy
    ffmpeg-audio=-acodec ac3 -ab 384k
    ffmpeg-audioac3=-acodec ac3 -ab 384k

  2. The second approach is using profiles with conversion tasks, you create 2 profiles, specify just one encoder in each profile and for one profile you specify dts as unsupported and for the other one you specify aac,ac3 as unsupported. Create two conversion tasks, each using one of the two profiles created above. Now only the task with the profile which doesn’t support the audio codec will fail and the other one will run