Help for create a XML profile

Discussion of advanced MakeMKV functionality, expert mode, conversion profiles
Post Reply
YvanCB
Posts: 3
Joined: Wed Jan 25, 2017 5:24 pm

Help for create a XML profile

Post by YvanCB » Wed Jan 25, 2017 5:41 pm

Hello,

I'm French and I'm trying to understand the "Advanced Mode". I have worked several hours but I still have questions.
I want to put on my hard drive a TV serie (Friends in fact) from several DVDs.
I want to have the Video, the English audio track, the French and the English subtitles; no compression.
I have a good results when I put this directly in the "Default selection rule":

Code: Select all

-sel:all,+sel:(eng&audio),+sel:(fre&subtitle),+sel:(eng&subtitle)
How can I translate this in a .xml file?
One more thing:
How can I tell to the soft that I want the French subtitle by default?

Regards.

Woodstock
Posts: 10293
Joined: Sun Jul 24, 2011 11:21 pm

Re: Help for create a XML profile

Post by Woodstock » Wed Jan 25, 2017 8:36 pm

The string is entered into the XML profile as follows:

Code: Select all

    <!-- Settings overridable in preferences -->
    <profileSettings
        app_DefaultSelectionString="-sel:all,+sel:(eng&audio),+sel:(fre&subtitle),+sel:(eng&subtitle)"
    />
If you copy one of the standard profiles to a new file name in your MakeMKV data directory, it will contain the most common settings, which you can edit.

YvanCB
Posts: 3
Joined: Wed Jan 25, 2017 5:24 pm

Re: Help for create a XML profile

Post by YvanCB » Thu Jan 26, 2017 5:55 pm

Hello Woodstock!

I'm so happy that somebody help me! But, but... it doesn't work. Here is the fault:

Code: Select all

MakeMKV v1.10.4 win(x64-release) started
Profile parsing error: Perso.mmcp.xml:18:60 - not well-formed (invalid token)
Profile parsing error: malformed XML
Failed to load conversion profile from file 'E:\Yvan\_SoftWare\Creation videos\Makemkv/Perso.mmcp.xml'
Here is my profile:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<profile>
    <!-- profile name - Default -->
    <name lang="eng">Perso</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:(eng&audio),+sel:(fre&subtitle),+sel:(eng&subtitle)"
    />

    <!-- 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 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>
Can you help me?

Regards.

Woodstock
Posts: 10293
Joined: Sun Jul 24, 2011 11:21 pm

Re: Help for create a XML profile

Post by Woodstock » Thu Jan 26, 2017 10:47 pm

The immediate problem is that any occurrence of an ampersand (the & character) in an XML document MUST be "escaped", which means this line:

Code: Select all

app_DefaultSelectionString="-sel:all,+sel:(eng&audio),+sel:(fre&subtitle),+sel:(eng&subtitle)"
must be written as:

Code: Select all

app_DefaultSelectionString="-sel:all,+sel:(eng&audio),+sel:(fre&subtitle),+sel:(eng&subtitle)"
The parser is trying to figure out what character a "&audio" is, and it can't find one.

Make that change and see how things go.

YvanCB
Posts: 3
Joined: Wed Jan 25, 2017 5:24 pm

Re: Help for create a XML profile

Post by YvanCB » Sun Feb 05, 2017 5:48 pm

Hello Woodstock,

Your little code is OK. It's working. THANK YOU!!! :D
Therefore, how can I tell to the soft that I want the French subtitle by default?

Regards.

Woodstock
Posts: 10293
Joined: Sun Jul 24, 2011 11:21 pm

Re: Help for create a XML profile

Post by Woodstock » Sun Feb 05, 2017 6:12 pm

There is a way to assign higher weighting to a particular language, but that is beyond what I use. I normally process the files afterward with handbrake, which allows more complete control of audio and subtitle tracks, so I do not assign weighting in MakeMKV.

ndjamena
Posts: 830
Joined: Mon Jan 07, 2013 12:23 am

Re: Help for create a XML profile

Post by ndjamena » Fri Feb 10, 2017 8:33 pm

-10:fre

StripLV
Posts: 5
Joined: Tue Nov 13, 2018 3:00 pm

Re: Help for create a XML profile

Post by StripLV » Sat Nov 17, 2018 2:59 am

Woodstock wrote:
Thu Jan 26, 2017 10:47 pm
The immediate problem is that any occurrence of an ampersand (the & character) in an XML document MUST be "escaped", which means this line:

Code: Select all

app_DefaultSelectionString="-sel:all,+sel:(eng&audio),+sel:(fre&subtitle),+sel:(eng&subtitle)"
must be written as:

Code: Select all

app_DefaultSelectionString="-sel:all,+sel:(eng&audio),+sel:(fre&subtitle),+sel:(eng&subtitle)"
The parser is trying to figure out what character a "&audio" is, and it can't find one.

Make that change and see how things go.
Excuse me am I too blind to see the difference? These 2 lines are excactly the same?

Woodstock
Posts: 10293
Joined: Sun Jul 24, 2011 11:21 pm

Re: Help for create a XML profile

Post by Woodstock » Sat Nov 17, 2018 4:13 am

The problem is that something has happened in the last year that made the two lines look identical NOW. They were originally different; One used the ampersand character as "&". The other replaced it with the html entity for &, which I'll space out here so that the browser doesn't hide it:

& a m p ;

In XML, the & character is the start of an escape sequence. If you want it to be treated as an ampersand, you have to use the escape sequence to represent it.

Putting things inside of "code" markers is SUPPOSED to make literals like this come through, but... remember how I said something happened? Well, after this topic was posted, Mike did a software update, and it read the old data from the forum, and wrote it to the new forum tables... screwing up the encoding, so &amp; became just &.

This has become a moot discussion with changes made in version 1.14.x and later, but the original suggested change was:

Code: Select all

app_DefaultSelectionString="-sel:all,+sel:(eng&amp;audio),+sel:(fre&amp;subtitle),+sel:(eng&amp;subtitle)"

Post Reply