Keeping Original audio with FLAC profile?

Everything related to MakeMKV
Post Reply
BobLSL
Posts: 23
Joined: Sun Jun 28, 2015 4:51 am

Keeping Original audio with FLAC profile?

Post by BobLSL »

Hi,

First, thanks for this great and well thought product.

Is it possible while creating a MKV from a BR with FLAC audio to retain the original audio track unmodified as secondary audio track? The FLAC one should be the default one.
Woodstock
Posts: 10312
Joined: Sun Jul 24, 2011 11:21 pm

Re: Keeping Original audio with FLAC profile?

Post by Woodstock »

I don't think it is possible, but will defer to anyone who has made it work.

My work-around for this is to rip "raw" with MakeMKV, and post-process with handbrake (available at handbrake.fr) to get the actual tracks I want. I can have handbrake convert the tracks to FAAC for compatibility, then also include the original for when the playback supports it, which is probably what you're wanting.
BobLSL
Posts: 23
Joined: Sun Jun 28, 2015 4:51 am

Re: Keeping Original audio with FLAC profile?

Post by BobLSL »

I'm asking this to keep a backup DTS-HD or TrueHD track, in case a future change in hardware will make me need a full Blu-ray structure again. Making a BR from a FLAC track would need something like the DTS-HD encoder suite...

I can do it manually, by demuxing the m2ts file with TSMuxer, and using mkvmerge to merge it with the MAKEmkv FLAC mkv file, but a one pass solution would be more convenient.
ptdmkv
Posts: 3
Joined: Wed Jun 24, 2015 3:15 pm

Re: Keeping Original audio with FLAC profile?

Post by ptdmkv »

Sure its possible, copy the default.mmcp.xml file to a new file (or just edit that one), and find the relevant sections and modify as such

Code: Select all

<trackSettings input="TRUEHD-multi">
	<output outputSettingsName="flac-best"
                defaultSelection="$app_DefaultSelectionString">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString,-sel:all">
        </output>
</trackSettings>
and then repeat for dtshd-multi and dtshdma-multi or whatever else, first output tells it dump flac out as the first track, and then copy the original track. I just went through this for a bunch of pixar movies that seem to have random audio issues when bitstreamed to my receiver so I encoded to flac as my streamer can decode that and send lpcm, but I wanted to retain original audio track for whatever reason in the future...

-pd
BobLSL
Posts: 23
Joined: Sun Jun 28, 2015 4:51 am

Re: Keeping Original audio with FLAC profile?

Post by BobLSL »

ptdmkv wrote:Sure its possible, copy the default.mmcp.xml file to a new file (or just edit that one), and find the relevant sections and modify as such

and then repeat for dtshd-multi and dtshdma-multi or whatever else, first output tells it dump flac out as the first track, and then copy the original track. I just went through this for a bunch of pixar movies that seem to have random audio issues when bitstreamed to my receiver so I encoded to flac as my streamer can decode that and send lpcm, but I wanted to retain original audio track for whatever reason in the future...

-pd
Thanks, it's exactly what I was looking for.

Note though that this works only for DTS-HD: the MKV container cannot handle the AC3 track embedded with the TrueHD one, the only way to keep it for possible blu-ray futur use is to demux it separately.

However, I can't make it work so far.

I took the default profile, and added the DTS stuff from the FLAC profile:

Code: Select all

    <!-- Save DTS-HD as FLAC -->
    <trackSettings input="DTSHDMA-stereo">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDMA-multi">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>
                                                                                                                    
    <!-- Save DTS-HD LBR (low quality) as FLAC (just to decode) -->
    <trackSettings input="DTSHDLBR-stereo">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDLBR-multi">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>

But the new profile now acts as the FLAC one, it does no longer saves the original track as the default one it's derived from does.

Here is the whole new profile:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<profile>
    <!-- profile name - Default -->
    <name lang="eng">Mine</name>
 
    <!-- Common MKV flags -->
    <mkvSettings
        ignoreForcedSubtitlesFlag="true"
        useISO639Type2T="false"
        setFirstAudioTrackAsDefault="true"
        setFirstSubtitleTrackAsDefault="true"
        setFirstForcedSubtitleTrackAsDefault="true"
        insertFirstChapter00IfMissing="true"
    />
 
    <!-- Settings overridable in preferences -->
    <profileSettings
        app_DefaultSelectionString="-sel:all,+sel:(favlang|nolang|single),-sel:(havemulti|havecore),-sel:mvcvideo,=100:all,-10:favlang"
    />
 
    <!-- Output formats currently supported by MakeMKV -->
    <!-- Save DTS-HD as FLAC -->
    <trackSettings input="DTSHDMA-stereo">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDMA-multi">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>
 
    <!-- Save DTS-HD LBR (low quality) as FLAC (just to decode) -->
    <trackSettings input="DTSHDLBR-stereo">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDLBR-multi">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>
    <outputSettings name="copy" outputFormat="directCopy">
        <description lang="eng">Copy track as is</description>
        <description lang="ger">Track 1:1 kopieren</description>
    </outputSettings>
 
    <outputSettings name="lpcm" outputFormat="LPCM-raw">
        <description lang="eng">Save as raw LPCM</description>
        <description lang="ger">Als RAW LPCM speichern</description>
    </outputSettings>
 
    <outputSettings name="wavex" outputFormat="LPCM-wavex">
        <description lang="eng">Save as LPCM in WAV container</description>
        <description lang="ger">Als LPCM im WAV-Container speichern</description>
    </outputSettings>
 
    <outputSettings name="flac-best" outputFormat="FLAC">
        <description lang="eng">Save as FLAC (best compression)</description>
        <description lang="ger">Als FLAC speichern (höchste Komprimierungsstufe)</description>
        <extraArgs>-compression_level 12</extraArgs>
    </outputSettings>
 
    <outputSettings name="flac-fast" outputFormat="FLAC">
        <description lang="eng">Save as FLAC (fast compression)</description>
        <extraArgs>-compression_level 5</extraArgs>
    </outputSettings>
 
    <!-- Default rule - copy as is -->
    <trackSettings input="default">
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>
 
    <!-- Save LPCM mono or stereo as raw LPCM -->
    <trackSettings input="LPCM-stereo">
        <output outputSettingsName="lpcm"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>
 
    <!-- Put multi-channel LPCM into WAVEX container-->
    <trackSettings input="LPCM-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>
 
</profile>

What am I missing? Something obvious I would guess... :)
ptdmkv
Posts: 3
Joined: Wed Jun 24, 2015 3:15 pm

Re: Keeping Original audio with FLAC profile?

Post by ptdmkv »

Offhand with a just a quick look, it appears to be syntax related. If I get a chance tomorrow perhaps I will post up my file for you.

-pd
BobLSL
Posts: 23
Joined: Sun Jun 28, 2015 4:51 am

Re: Keeping Original audio with FLAC profile?

Post by BobLSL »

ptdmkv wrote:Offhand with a just a quick look, it appears to be syntax related. If I get a chance tomorrow perhaps I will post up my file for you.

-pd
That would be very much appreciated. No hurry though.
ptdmkv
Posts: 3
Joined: Wed Jun 24, 2015 3:15 pm

Re: Keeping Original audio with FLAC profile?

Post by ptdmkv »

Try the following (couldnt attach as "board attachment quota has been reached"), save it into the MakeMKV install folder and assuming you dont edit it - select the "FLACCP" profile.

flaccp.mmcp.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<profile>
    <!-- profile name - Default -->
    <name lang="eng">FLACCP</name>

    <!-- Common MKV flags -->
    <mkvSettings 
        ignoreForcedSubtitlesFlag="true"
        useISO639Type2T="false"
        setFirstAudioTrackAsDefault="true"
        setFirstSubtitleTrackAsDefault="true"
        setFirstForcedSubtitleTrackAsDefault="true"
        insertFirstChapter00IfMissing="true"
    />

    <!-- Settings overridable in preferences -->
    <profileSettings
        app_DefaultSelectionString="-sel:all,+sel:(favlang|nolang|single),+sel:lossless,-sel:(havemulti|havelossless),-sel:mvcvideo,=100:all,-10:favlang"
    />

    <!-- Output formats currently supported by MakeMKV -->
    <outputSettings name="copy" outputFormat="directCopy">
        <description lang="eng">Copy track as is</description>
        <description lang="ger">Track 1:1 kopieren</description>
    </outputSettings>

    <outputSettings name="lpcm" outputFormat="LPCM-raw">
        <description lang="eng">Save as raw LPCM</description>
        <description lang="ger">Als RAW LPCM speichern</description>
    </outputSettings>

    <outputSettings name="wavex" outputFormat="LPCM-wavex">
        <description lang="eng">Save as LPCM in WAV container</description>
        <description lang="ger">Als LPCM im WAV-Container speichern</description>
    </outputSettings>

    <outputSettings name="flac-best" outputFormat="FLAC">
        <description lang="eng">Save as FLAC (best compression)</description>
        <description lang="ger">Als FLAC speichern (höchste Komprimierungsstufe)</description>
        <extraArgs>-compression_level 12</extraArgs>
    </outputSettings>

    <outputSettings name="flac-fast" outputFormat="FLAC">
        <description lang="eng">Save as FLAC (fast compression)</description>
        <extraArgs>-compression_level 5</extraArgs>
    </outputSettings>

    <!-- Default rule - copy as is -->
    <trackSettings input="default">
        <output outputSettingsName="copy" 
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>

    <!-- Save LPCM mono or stereo as FLAC -->
    <trackSettings input="LPCM-stereo">
		<output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>

    <!-- Save multi-channel LPCM as FLAC -->
    <trackSettings input="LPCM-multi">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>

    <!-- Save TRUEHD as FLAC -->
    <trackSettings input="TRUEHD-stereo">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>
    <trackSettings input="TRUEHD-multi">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>
    <trackSettings input="MLP-stereo">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>
    <trackSettings input="MLP-multi">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>

    <!-- Save DTS-HD as FLAC -->
    <trackSettings input="DTSHDMA-stereo">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDMA-multi">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString,+sel:true">
        </output>
    </trackSettings>

    <!-- Save DTS-HD LBR (low quality) as FLAC (just to decode) -->
    <trackSettings input="DTSHDLBR-stereo">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDLBR-multi">
        <output outputSettingsName="flac-fast"
                defaultSelection="$app_DefaultSelectionString">
        </output>
        <output outputSettingsName="copy"
                defaultSelection="$app_DefaultSelectionString">
        </output>
    </trackSettings>

</profile>
-pd
BobLSL
Posts: 23
Joined: Sun Jun 28, 2015 4:51 am

Re: Keeping Original audio with FLAC profile?

Post by BobLSL »

I had to remove:

Code: Select all

<description lang="ger">Als FLAC speichern (höchste Komprimierungsstufe)</description>
The special character "ö" was preventing the profile to be loaded. I guess that cut & pasting somehow changed it into something invalid.

Once that done, it's perfect.

Thanks, I would not have found the correct syntax by myself.
Post Reply