Feature request - lossy audio conversion

Discussion of advanced MakeMKV functionality, expert mode, conversion profiles
Post Reply
tebasuna51
Posts: 16
Joined: Fri Oct 10, 2014 9:58 am

Feature request - lossy audio conversion

Post by tebasuna51 »

Is know than convert lossy audio (DTS,E-AC3,AC3) to lossles audio (FLAC,LPCM) can be most the times useless, but can be interesting when we need edit (downmix, cut, ...) or recode (for instance to AC3 for players without DTS or E-AC3 support).

Now the 'wavex' output is always 16 bits but to edit/recode is more convenient a 24 bits output.
And don't know how force this output, see http://www.makemkv.com/forum2/viewtopic ... 886#p35886

If ffmpeg is used we only need add -acodec pcm_s24le instead -acodec pcm_s16le.

Is possible use the 24 bits output like default or, at least, add a option to select the bitdepth?

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

Re: Feature request - lossy audio conversion

Post by ndjamena »

As the track title suggests, this used to be 5.1 DTS.

Code: Select all

Audio
ID                                       : 2
Format                                   : PCM
Codec ID                                 : 00001000-0000-0100-8000-00AA00389B71
Duration                                 : 25mn 45s
Bit rate mode                            : Constant
Bit rate                                 : 6 912 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 24 bits
Stream size                              : 1.24 GiB (56%)
Title                                    : English DTS(5.1)
Language                                 : English
Default                                  : Yes
Forced                                   : No
tebasuna51
Posts: 16
Joined: Fri Oct 10, 2014 9:58 am

Re: Feature request - lossy audio conversion

Post by tebasuna51 »

Sorry but I never obtain Bit depth: 24 bits.

Using Windows 7 64 bits, with or without audioMix="ConvertTo24bit", with dtsdecoderdll.dll v1.1.0.0 or v1.1.0.8.

My source:

Code: Select all

MKV, 1 video track, 1 audio track, 0:00:21, 25p
1: h264/AVC, English, 720p25
2: DTS, English, 5.1 channels, 1509kbps, 48kHz
MakeMKV log:

Code: Select all

MakeMKV v1.8.13 win(x64-release) comenzado
Operaci?n completada con ?xito
Saving 1 titles into directory D:/tmp using profile 'WDTV' from file 'D:\Programa\ManejoCD\MakeMKV_/wdtv.mmcp.xml'
1 t?tulos guardados
The output always:

Code: Select all

MKV, 1 video track, 1 audio track, 0:00:21, 25p
1: h264/AVC, English, 720p25
2: RAW/PCM, English, 5.1 channels, 16 bits, 48kHz
   "Surround 5.1"
ndjamena
Posts: 830
Joined: Mon Jan 07, 2013 12:23 am

Re: Feature request - lossy audio conversion

Post by ndjamena »

I've tried everything I can think of and can't manage to get MakeMKV to NOT convert to 24 bit when told to so here's a complete profile that does nothing but convert all audio types to 24 bit PCM. If this doesn't work then there's definitely something wrong on your end.

Code: Select all

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

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

    <!-- Settings overridable in preferences -->
    <profileSettings
        app_DefaultSelectionString="-sel:all,+sel:(favlang|nolang),+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>
    </outputSettings>

    <outputSettings name="wavex" outputFormat="LPCM-wavex">
        <description lang="eng">Save as LPCM in WAV container</description>
    </outputSettings>
	
    <audioMixSettings name="ConvertTo24bit"
        outputBPS="24">
    </audioMixSettings>

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

    <!-- Save all audio as 24 bit PCM -->
    <trackSettings input="LPCM-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="LPCM-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="TRUEHD-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="TRUEHD-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="AC3-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="AC3-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="EAC3-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="EAC3-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="MLP-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="MLP-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDMA-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDMA-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTSHD-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTSHD-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTS-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTS-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTSHD-core-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTSHD-core-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDLBR-stereo">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>
    <trackSettings input="DTSHDLBR-multi">
        <output outputSettingsName="wavex"
                defaultSelection="$app_DefaultSelectionString"
                audioMix="ConvertTo24bit">
        </output>
    </trackSettings>   
</profile>
tebasuna51
Posts: 16
Joined: Fri Oct 10, 2014 9:58 am

Re: Feature request - lossy audio conversion

Post by tebasuna51 »

Thanks ndjamena for your effort. That works fine.

My fault. I found the problem in my profile:

<output outputSettingsName="wavex"
defaultSelection="$app_DefaultSelectionString,+sel:true">
audioMix="ConvertTo24bit">
</output>

The audioMix was never executed.

One last question about audioMix:

Code: Select all

    <audioMixSettings name="ConvertTo24bit"
        outputBPS="24">
    </audioMixSettings>
How work this?
Upsample the default 16 bits, or override the default downsample from float samples supplied by the decoder?

Thanks.

EDIT:
I answer my question.
This audioMix method is useless because:

MKV, 1 video track, 1 audio track, 0:00:21, 25p
1: h264/AVC, English, 720p25
2: RAW/PCM, English, 5.1 channels, 24 bits, 48kHz
"Surround 5.1"
[a02] Extracting audio track number 2...
[a02] Reading RAW/PCM...
[a02] Writing WAV...
[a02] Creating file "D:\tmp\title00.mkv_2eng.wav"...
[a02] The original audio track has a constant bit depth of 16 bits.
[a02] Superfluous zero bytes detected, will be stripped in 2nd pass.
[a02] Starting 2nd pass...
[a02] Reading WAV...
[a02] Stripping zero bytes...
[a02] Writing WAV...
[a02] Creating file "D:\tmp\title00.mkv_2eng.wav"...

We finish with a 16 bit wav.
We need change the conversion from decoder float samples to 24 bits like eac3to do.
ndjamena
Posts: 830
Joined: Mon Jan 07, 2013 12:23 am

Re: Feature request - lossy audio conversion

Post by ndjamena »

Yup, I get the same thing. If I extract the PCM into a wav with eac3to and look at the wav with a hex editor I can see every third byte is a zero. So not only does it convert to 16 bit and then to 24 bit, it does it without dithering. I guess that's to keep it lossless.
Post Reply