Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 Encoder GUIs

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th April 2018, 18:59   #21  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,253
Quote:
Originally Posted by mkver View Post
1. If I use -ac2 the only difference I get is that it now reports "auto_resampler", not the explicitly called "Parsed_aresample"
I finally got a chance to have a play, and it appears ffmpeg uses different downmix coefficients according to the input bitdepth. I guess if it's decoding, it'd depend how it's decoding the audio. I only tested with a piped input courtesy of foobar2000 and the following command line.

-report -loglevel debug -i - -ignore_length true -ac 2 -c:a libmp3lame -q:a 2 -id3v2_version 3 %d

The same source file (5.1ch AC3) was used each time, but for each I changed the maximum bitdepth in the fb2k encoder configuration.

32 bit float:

Quote:
Stream mapping:
Stream #0:0 -> #0:0 (pcm_f32le (native) -> mp3 (libmp3lame))
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
detected 4 logical cores
[graph_0_in_0_0 @ 039abb40] Setting 'time_base' to value '1/48000'
[graph_0_in_0_0 @ 039abb40] Setting 'sample_rate' to value '48000'
[graph_0_in_0_0 @ 039abb40] Setting 'sample_fmt' to value 'flt'
[graph_0_in_0_0 @ 039abb40] Setting 'channel_layout' to value '0x3f'
[graph_0_in_0_0 @ 039abb40] tb:1/48000 samplefmt:flt samplerate:48000 chlayout:0x3f
[format_out_0_0 @ 039acc80] Setting 'sample_fmts' to value 's32p|fltp|s16p'
[format_out_0_0 @ 039acc80] Setting 'sample_rates' to value '44100|48000|32000|22050|24000|16000|11025|12000|8000'
[format_out_0_0 @ 039acc80] Setting 'channel_layouts' to value '0x3'
[format_out_0_0 @ 039acc80] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 0393c400] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 039ad680] picking fltp out of 3 ref:flt
[auto_resampler_0 @ 039ad680] [SWR @ 039adc80] Using fltp internally between filters
[auto_resampler_0 @ 039ad680] [SWR @ 039adc80] Matrix coefficients:
[auto_resampler_0 @ 039ad680] [SWR @ 039adc80] FL: FL:1.000000 FR:0.000000 FC:0.707107 LFE:0.000000 BL:0.707107 BR:0.000000
[auto_resampler_0 @ 039ad680] [SWR @ 039adc80] FR: FL:0.000000 FR:1.000000 FC:0.707107 LFE:0.000000 BL:0.000000 BR:0.707107

[auto_resampler_0 @ 039ad680] ch:6 chl:5.1 fmt:flt r:48000Hz -> ch:2 chl:stereo fmt:fltp r:48000Hz
Output #0, mp3, to 'test.mp3':
Metadata:
TSSE : Lavf58.9.100
Stream #0:0, 0, 1/48000: Audio: mp3 (libmp3lame), 48000 Hz, stereo, fltp, delay 1105
Metadata:
encoder : Lavc58.11.101 libmp3lame
24 bit integer:

Quote:
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s24le (native) -> mp3 (libmp3lame))
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
detected 4 logical cores
[graph_0_in_0_0 @ 039abc80] Setting 'time_base' to value '1/48000'
[graph_0_in_0_0 @ 039abc80] Setting 'sample_rate' to value '48000'
[graph_0_in_0_0 @ 039abc80] Setting 'sample_fmt' to value 's32'
[graph_0_in_0_0 @ 039abc80] Setting 'channel_layout' to value '0x3f'
[graph_0_in_0_0 @ 039abc80] tb:1/48000 samplefmt:s32 samplerate:48000 chlayout:0x3f
[format_out_0_0 @ 039ace00] Setting 'sample_fmts' to value 's32p|fltp|s16p'
[format_out_0_0 @ 039ace00] Setting 'sample_rates' to value '44100|48000|32000|22050|24000|16000|11025|12000|8000'
[format_out_0_0 @ 039ace00] Setting 'channel_layouts' to value '0x3'
[format_out_0_0 @ 039ace00] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 0393a280] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 039ad3c0] picking s32p out of 3 ref:s32
[auto_resampler_0 @ 039ad3c0] [SWR @ 039addc0] Using fltp internally between filters
[auto_resampler_0 @ 039ad3c0] [SWR @ 039addc0] Matrix coefficients:
[auto_resampler_0 @ 039ad3c0] [SWR @ 039addc0] FL: FL:0.414214 FR:0.000000 FC:0.292893 LFE:0.000000 BL:0.292893 BR:0.000000
[auto_resampler_0 @ 039ad3c0] [SWR @ 039addc0] FR: FL:0.000000 FR:0.414214 FC:0.292893 LFE:0.000000 BL:0.000000 BR:0.292893

[auto_resampler_0 @ 039ad3c0] ch:6 chl:5.1 fmt:s32 r:48000Hz -> ch:2 chl:stereo fmt:s32p r:48000Hz
Output #0, mp3, to 'test.mp3':
Metadata:
TSSE : Lavf58.9.100
Stream #0:0, 0, 1/48000: Audio: mp3 (libmp3lame), 48000 Hz, stereo, s32p (24 bit), delay 1105
Metadata:
encoder : Lavc58.11.101 libmp3lame
16 bit integer:

Quote:
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> mp3 (libmp3lame))
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
detected 4 logical cores
[graph_0_in_0_0 @ 0397d840] Setting 'time_base' to value '1/48000'
[graph_0_in_0_0 @ 0397d840] Setting 'sample_rate' to value '48000'
[graph_0_in_0_0 @ 0397d840] Setting 'sample_fmt' to value 's16'
[graph_0_in_0_0 @ 0397d840] Setting 'channel_layout' to value '0x3f'
[graph_0_in_0_0 @ 0397d840] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x3f
[format_out_0_0 @ 03971d40] Setting 'sample_fmts' to value 's32p|fltp|s16p'
[format_out_0_0 @ 03971d40] Setting 'sample_rates' to value '44100|48000|32000|22050|24000|16000|11025|12000|8000'
[format_out_0_0 @ 03971d40] Setting 'channel_layouts' to value '0x3'
[format_out_0_0 @ 03971d40] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 039edc40] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 03971b00] picking s16p out of 3 ref:s16
[auto_resampler_0 @ 03971b00] [SWR @ 03a25080] Using s16p internally between filters
[auto_resampler_0 @ 03971b00] [SWR @ 03a25080] Matrix coefficients:
[auto_resampler_0 @ 03971b00] [SWR @ 03a25080] FL: FL:0.414214 FR:0.000000 FC:0.292893 LFE:0.000000 BL:0.292893 BR:0.000000
[auto_resampler_0 @ 03971b00] [SWR @ 03a25080] FR: FL:0.000000 FR:0.414214 FC:0.292893 LFE:0.000000 BL:0.000000 BR:0.292893

[auto_resampler_0 @ 03971b00] ch:6 chl:5.1 fmt:s16 r:48000Hz -> ch:2 chl:stereo fmt:s16p r:48000Hz
Output #0, mp3, to 'test.mp3':
Metadata:
TSSE : Lavf58.9.100
Stream #0:0, 0, 1/48000: Audio: mp3 (libmp3lame), 48000 Hz, stereo, s16p, delay 1105
Metadata:
encoder : Lavc58.11.101 libmp3lame
I dunno.... it seems kind of odd to me it's not consistent.

Last edited by hello_hello; 9th April 2018 at 19:32.
hello_hello is offline   Reply With Quote
Old 9th April 2018, 19:20   #22  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,253
To make it even more interesting, ffmpeg changes downmix coefficients according to the output format.

-report -loglevel debug -i - -ignore_length true -ac 2 -c:a aac %d

32 bit float:

Quote:
Stream mapping:
Stream #0:0 -> #0:0 (pcm_f32le (native) -> aac (native))
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
detected 4 logical cores
[graph_0_in_0_0 @ 039aad00] Setting 'time_base' to value '1/48000'
[graph_0_in_0_0 @ 039aad00] Setting 'sample_rate' to value '48000'
[graph_0_in_0_0 @ 039aad00] Setting 'sample_fmt' to value 'flt'
[graph_0_in_0_0 @ 039aad00] Setting 'channel_layout' to value '0x3f'
[graph_0_in_0_0 @ 039aad00] tb:1/48000 samplefmt:flt samplerate:48000 chlayout:0x3f
[format_out_0_0 @ 039abe80] Setting 'sample_fmts' to value 'fltp'
[format_out_0_0 @ 039abe80] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[format_out_0_0 @ 039abe80] Setting 'channel_layouts' to value '0x3'
[format_out_0_0 @ 039abe80] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 039aa180] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 039ac8c0] [SWR @ 039acf80] Using fltp internally between filters
[auto_resampler_0 @ 039ac8c0] [SWR @ 039acf80] Matrix coefficients:
[auto_resampler_0 @ 039ac8c0] [SWR @ 039acf80] FL: FL:1.000000 FR:0.000000 FC:0.707107 LFE:0.000000 BL:0.707107 BR:0.000000
[auto_resampler_0 @ 039ac8c0] [SWR @ 039acf80] FR: FL:0.000000 FR:1.000000 FC:0.707107 LFE:0.000000 BL:0.000000 BR:0.707107

[auto_resampler_0 @ 039ac8c0] ch:6 chl:5.1 fmt:flt r:48000Hz -> ch:2 chl:stereo fmt:fltp r:48000Hz
Output #0, ipod, to 'test.m4a':
Metadata:
encoder : Lavf58.9.100
Stream #0:0, 0, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, delay 1024, 128 kb/s
Metadata:
encoder : Lavc58.11.101 aac
24 bit integer:

Quote:
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s24le (native) -> aac (native))
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
detected 4 logical cores
[graph_0_in_0_0 @ 039ab4c0] Setting 'time_base' to value '1/48000'
[graph_0_in_0_0 @ 039ab4c0] Setting 'sample_rate' to value '48000'
[graph_0_in_0_0 @ 039ab4c0] Setting 'sample_fmt' to value 's32'
[graph_0_in_0_0 @ 039ab4c0] Setting 'channel_layout' to value '0x3f'
[graph_0_in_0_0 @ 039ab4c0] tb:1/48000 samplefmt:s32 samplerate:48000 chlayout:0x3f
[format_out_0_0 @ 039ac100] Setting 'sample_fmts' to value 'fltp'
[format_out_0_0 @ 039ac100] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[format_out_0_0 @ 039ac100] Setting 'channel_layouts' to value '0x3'
[format_out_0_0 @ 039ac100] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 039aa980] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 039ad080] [SWR @ 039ad740] Using fltp internally between filters
[auto_resampler_0 @ 039ad080] [SWR @ 039ad740] Matrix coefficients:
[auto_resampler_0 @ 039ad080] [SWR @ 039ad740] FL: FL:1.000000 FR:0.000000 FC:0.707107 LFE:0.000000 BL:0.707107 BR:0.000000
[auto_resampler_0 @ 039ad080] [SWR @ 039ad740] FR: FL:0.000000 FR:1.000000 FC:0.707107 LFE:0.000000 BL:0.000000 BR:0.707107

[auto_resampler_0 @ 039ad080] ch:6 chl:5.1 fmt:s32 r:48000Hz -> ch:2 chl:stereo fmt:fltp r:48000Hz
Output #0, ipod, to 'test.m4a':
Metadata:
encoder : Lavf58.9.100
Stream #0:0, 0, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp (24 bit), delay 1024, 128 kb/s
Metadata:
encoder : Lavc58.11.101 aac
16 bit integer:

Quote:
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (native))
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
detected 4 logical cores
[graph_0_in_0_0 @ 0399e880] Setting 'time_base' to value '1/48000'
[graph_0_in_0_0 @ 0399e880] Setting 'sample_rate' to value '48000'
[graph_0_in_0_0 @ 0399e880] Setting 'sample_fmt' to value 's16'
[graph_0_in_0_0 @ 0399e880] Setting 'channel_layout' to value '0x3f'
[graph_0_in_0_0 @ 0399e880] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x3f
[format_out_0_0 @ 03af3a80] Setting 'sample_fmts' to value 'fltp'
[format_out_0_0 @ 03af3a80] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[format_out_0_0 @ 03af3a80] Setting 'channel_layouts' to value '0x3'
[format_out_0_0 @ 03af3a80] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 03920f80] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 03985580] [SWR @ 03a4f240] Using fltp internally between filters
[auto_resampler_0 @ 03985580] [SWR @ 03a4f240] Matrix coefficients:
[auto_resampler_0 @ 03985580] [SWR @ 03a4f240] FL: FL:1.000000 FR:0.000000 FC:0.707107 LFE:0.000000 BL:0.707107 BR:0.000000
[auto_resampler_0 @ 03985580] [SWR @ 03a4f240] FR: FL:0.000000 FR:1.000000 FC:0.707107 LFE:0.000000 BL:0.000000 BR:0.707107

[auto_resampler_0 @ 03985580] ch:6 chl:5.1 fmt:s16 r:48000Hz -> ch:2 chl:stereo fmt:fltp r:48000Hz
Output #0, ipod, to 'test.m4a':
Metadata:
encoder : Lavf58.9.100
Stream #0:0, 0, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, delay 1024, 128 kb/s
Metadata:
encoder : Lavc58.11.101 aac

Last edited by hello_hello; 9th April 2018 at 19:35.
hello_hello is offline   Reply With Quote
Old 13th April 2018, 03:53   #23  |  Link
doomleox999
Registered User
 
Join Date: Nov 2015
Posts: 78
Sadly, I'm still getting the same result. I checked the ffmpeg report and this is how it mixes (you know what I mean) the channels:

Code:
[auto_resampler_0 @ 000002e30d6f3d80] [SWR @ 000002e30d6f3e80] FL: FL:1.000000 FR:0.000000 FC:0.707107 LFE:0.000000 BL:0.707107 BR:0.000000 
[auto_resampler_0 @ 000002e30d6f3d80] [SWR @ 000002e30d6f3e80] FR: FL:0.000000 FR:1.000000 FC:0.707107 LFE:0.000000 BL:0.000000 BR:0.707107
Is it possible to write a script so MeGUI can do the same?

What about this "Extra" tab? Can you add something here to make MeGUI use other matrix when downmixing the channels?


Last edited by doomleox999; 13th April 2018 at 07:50.
doomleox999 is offline   Reply With Quote
Old 13th April 2018, 09:19   #24  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,805
Quote:
Originally Posted by doomleox999 View Post
Is it possible to write a script so MeGUI can do the same?
Of course replace the part of my script:

Code:
  fl_sl = MixAudio(fl, sl, 0.414214, 0.292893)
  fr_sr = MixAudio(fr, sr, 0.414214, 0.292893)
  l = MixAudio(fl_sl, fc, 1.0, 0.292893)
  r = MixAudio(fr_sr, fc, 1.0, 0.292893)
  MergeChannels(l, r)

Normalize()
with:
Code:
  fl_sl = MixAudio(fl, sl, 1.0, 0.707107)
  fr_sr = MixAudio(fr, sr, 1.0, 0.707107)
  l = MixAudio(fl_sl, fc, 1.0, 0.707107)
  r = MixAudio(fr_sr, fc, 1.0, 0.707107)
  MergeChannels(l, r)
Don't use Normalize() because you can obtain the same than before.
Now you can have clips in all volume values between 1.0 and 2.4
Like my image in https://forum.doom9.org/showthread.p...46#post1838646

Quote:
What about this "Extra" tab? Can you add something here to make MeGUI use other matrix when downmixing the channels?
Nope, the Custom Command Line is for add parameters to NeroAacEnc.
Nothing usefull can be added here.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 13th April 2018 at 09:22.
tebasuna51 is offline   Reply With Quote
Old 19th April 2018, 08:41   #25  |  Link
doomleox999
Registered User
 
Join Date: Nov 2015
Posts: 78
I still don't get the same result I get when encoding with ffmpeg (2ch sounds the same as original 6ch) so maybe I should give you more info about this whole situation.

The original file is a mkv with video, audio and some subtitles. This is what MediaInfo says about the audio:

Code:
Audio
ID                          : 2
Format                      : AAC
Format/Info                 : Advanced Audio Codec
Format profile              : HE-AAC / LC
Format settings             : Explicit
Codec ID                    : A_AAC-2
Duration                    : 1 h 26 min
Bit rate                    : 141 kb/s
Channel(s)                  : 6 channels
Channel positions           : Front: L C R, Side: L R, LFE
Sampling rate               : 48.0 kHz / 24.0 kHz
Frame rate                  : 23.438 FPS (1024 SPF)
Compression mode            : Lossy
Stream size                 : 87.6 MiB (7%)

Is it OK to encode the mkv directly to aac or m4a or is better to extract the audio and encode that file? Because something weird happens when I extract the audio. If I open it, MPC-HC tells me its lenght is 1 h 22 min but Windows Explorer says 3 h 46 min.

I use this script:

Code:
AddAutoloadDir("C:\Users\LTX\BACKUP\MeGUI\tools\avs\plugins")
LoadPlugin("C:\Users\LTX\BACKUP\MeGUI\tools\lsmash\LSMASHSource.dll")
a=LWLibavAudioSource("C:\Users\LTX\Desktop\EOE_6CH.mkv")

  fl = GetChannel(a, 1)
  fr = GetChannel(a, 2)
  fc = GetChannel(a, 3)
#  lf = GetChannel(a, 4)
  sl = GetChannel(a, 5)
  sr = GetChannel(a, 6)
  fl_sl = MixAudio(fl, sl, 1.0, 0.707107)
  fr_sr = MixAudio(fr, sr, 1.0, 0.707107)
  l = MixAudio(fl_sl, fc, 1.0, 0.707107)
  r = MixAudio(fr_sr, fc, 1.0, 0.707107)
  MergeChannels(l, r)
But when I check the MeGUI log I think the program is ignoring the script, maybe because of the options I choose:



And those are the options I want. Another weird thing is that MeGUI takes like 50 min to encode the audio, while ffmpeg is super fast and gives me a better result.
doomleox999 is offline   Reply With Quote
Old 19th April 2018, 09:24   #26  |  Link
mkver
Registered User
 
Join Date: May 2016
Posts: 194
I somehow forgot about this thread, but now that I see hello_hellos results I see a system behind it: If ffmpeg downmixes to 32b float, it uses the one set of coefficients, if it downmixes to pcm it uses the other set of coefficients. The most direct way to test this is by not using the aac or libmp3lame encoders, but -c:a pcm_s16le, pcm_s24le, pcm_f32le. And if one does it, the results confirm the preceding statement. The aac encoder probably accepts float input only (or prefers it) so that the auto_resampler resamples everything to float, whereas libmp3lame seems to accept everything so that downmixing in this case only changes the number of channels, not the sample format.
But does anybody have a definitive answer why ffmpeg uses different coefficients for float and non-float? In both cases the ratios coincide: 1/0.707107 and 0.414214/0.292893 are both very good approximations for 2^(0.5) which is probably the value that they are supposed to be. Probably it is because one doesn't need to care about clipping that much if one uses float output.

Last edited by mkver; 19th April 2018 at 09:30.
mkver is offline   Reply With Quote
Old 19th April 2018, 10:39   #27  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,805
Quote:
Originally Posted by doomleox999 View Post
I still don't get the same result I get when encoding with ffmpeg (2ch sounds the same as original 6ch)
I can't understand how 2 ch sound the same as 6 ch.
2 speakers can supply the same volume than 6 speakers?
Do you listen the 6 ch in a 6 speakers system?

Quote:
Is it OK to encode the mkv directly to aac or m4a or is better to extract the audio and encode that file?
It is the same, some soft (eac3to, ffmpeg) can do the 4 task (extract, decode, downmix and recode) in 1 job.

Quote:
Because something weird happens when I extract the audio. If I open it, MPC-HC tells me its lenght is 1 h 22 min but Windows Explorer says 3 h 46 min.
If you want know exactly the info about a AAC audio you need extract the aac and use a soft than read the full file like LeeAudBi, you can't trust in MPC-HC, Windows Explorer or MediaInfo.

Quote:
But when I check the MeGUI log I think the program is ignoring the script, maybe because of the options I choose:
Another weird thing is that MeGUI takes like 50 min to encode the audio,
It is not normal, please supply the MeGUI log.

Quote:
Originally Posted by mkver View Post
But does anybody have a definitive answer why ffmpeg uses different coefficients for float and non-float?
Good question, but we can force the coefficients using the filter -af "pan=stereo..."

Then you can select the coefficients with ffmpeg and with AviSinth, and obtain the same.

Quote:
Probably it is because one doesn't need to care about clipping that much if one uses float output.
But at some point in the chain of conversion between digital to analog audio all values over 1.0 are clipped.

You need Normalize or accept distort audio, maybe only a few points and you don't care in this sample, but we can't expect that always.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 19th April 2018 at 10:43.
tebasuna51 is offline   Reply With Quote
Old 20th April 2018, 04:57   #28  |  Link
doomleox999
Registered User
 
Join Date: Nov 2015
Posts: 78
Quote:
I can't understand how 2 ch sound the same as 6 ch.
2 speakers can supply the same volume than 6 speakers?
Do you listen the 6 ch in a 6 speakers system?
I use headphones. The best way to explain the difference I hear would be sending you samples from the original 6ch, the MeGUI 2ch encode, and the ffmpeg 2ch encode, because my vocabulary regarding audio is limited, I can't explain myself well (even in my first language haha) but I'm not sure if that's allowed.

This is the MeGUI log using the script from my previous reply:
(I had to edit it so I could post it, I removed every "[NoImage]")

Quote:
[Information] Log
-[Information] Versions
--[Information] MeGUI: 2828 x86
--[Information] Update Check: stable update server
--[Information] System Information
---[Information] Operating System: Windows 10 (CORE_SINGLELANGUAGE) 1709 x64 (10.0.16299.309)
---[Information] .NET Framework: 4.0 (4.0.0.0)
---[Information] .NET Framework: 4.7 (4.7.02556)
---[Information] DPI: 100% (96/96)
---[Information] Monitor 1
----[Information] Resolution: 1366x768
----[Information] Primary Screen: True
--[Information] Component Information
---[Information] Haali Media Splitter: not installed
---[Information] Haali DSS2: not installed
---[Information] ICSharpCode.SharpZipLib: 0.85.5.452 (07-08-2008)
---[Information] MediaInfo: 17.12.0.0 (21-12-2017)
---[Information] SevenZipSharp: 0.64.3890.29348 (02-01-2011)
---[Information] 7z: 9.20 (18-11-2010)
--[Information] AviSynth Information
---[Information] AviSynth Wrapper
----[Information] Version: 1.0.2721.0
----[Information] Date: 29-04-2017
----[Information] Interface: 3
---[Information] AviSynth
----[Information] not installed
---[Information] AviSynth portable
----[Information] File Version: 0.1
----[Information] Date: 27-12-2017
----[Information] Name: AviSynth+ 0.1 (r2580, MT, i386)
----[Information] Version: AviSynth+ 0.1 (r2580, MT, i386)
----[Information] AviSynth+: true
----[Information] MT: true
----[Information] Status: active
-[Information] Update detection
--[Information] [19/04/18 22:42:19] Connected to server: http://megui.org/auto/stable/
--[Information] [19/04/18 22:42:19] No package requires an update
-[Information] Log for job1 (audio, EOE_6CH.avs -> EOE_6CH.m4a)
--[Information] [19/04/18 22:59:33] Started handling job
--[Information] [19/04/18 22:59:33] Preprocessing
--[Information] [19/04/18 22:59:34] MediaInfo
---[Information] [19/04/18 22:59:34] File: C:\Users\LTX\Desktop\MeGUI Output\EOE_6CH.avs
---[Information] AVS input file detected. Getting media information from AviSynth.
---[Information] General
----[Information] Format: AVS
----[Information] FormatString: AviSynth Script
----[Information] FileSize: 536
----[Information] PlayTime: 01:26:49.1310000
---[Information] Audio
----[Information] ID: 0
----[Information] StreamOrder:
----[Information] Format: AVS
----[Information] FormatProfile:
----[Information] FormatSettingsSBR:
----[Information] FormatSettingsPS:
----[Information] Muxing Mode:
----[Information] SamplingRate: 48000
----[Information] SamplingRateString: 48000
----[Information] Channels: 2
----[Information] ChannelsString: 2 channels
----[Information] ChannelPositionsString2:
----[Information] BitRateMode: CBR
----[Information] Delay: 0
----[Information] Title:
----[Information] Language:
----[Information] LanguageString:
----[Information] Default:
----[Information] DefaultString:
----[Information] Forced:
----[Information] ForcedString:
----[Information] [19/04/18 22:59:43] The language information is not available for this track. The default MeGUI language has been selected.
--[Information] [19/04/18 22:59:50] Ignoring downmix as there is only 2 channel(s)
--[Information] [19/04/18 22:59:50] AviSynth script
--- ClearAutoloadDirs()
--- AddAutoloadDir("C:\Users\LTX\BACKUP\MeGUI\tools\avs\plugins")
--- Import("C:\Users\LTX\Desktop\MeGUI Output\EOE_6CH.avs")
--- # detected channels: 2
--- # detected channel positions:
--- Normalize()
--- return last
--- # 5.1 Channels L,R,C,LFE,SL,SR -> stereo + LFE
--- function c6_stereo(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- lf = GetChannel(a, 4)
--- sl = GetChannel(a, 5)
--- sr = GetChannel(a, 6)
--- fl_sl = MixAudio(fl, sl, 0.2929, 0.2929)
--- fr_sr = MixAudio(fr, sr, 0.2929, 0.2929)
--- fc_lf = MixAudio(fc, lf, 0.2071, 0.2071)
--- l = MixAudio(fl_sl, fc_lf, 1.0, 1.0)
--- r = MixAudio(fr_sr, fc_lf, 1.0, 1.0)
--- return MergeChannels(l, r)
--- }
--- # 5 Channels L,R,C,SL,SR or L,R,LFE,SL,SR-> Stereo
--- function c5_stereo(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- sl = GetChannel(a, 4)
--- sr = GetChannel(a, 5)
--- fl_sl = MixAudio(fl, sl, 0.3694, 0.3694)
--- fr_sr = MixAudio(fr, sr, 0.3694, 0.3694)
--- l = MixAudio(fl_sl, fc, 1.0, 0.2612)
--- r = MixAudio(fr_sr, fc, 1.0, 0.2612)
--- return MergeChannels(l, r)
--- }
--- # 5 Channels L,R,C,LFE,S -> Stereo
--- function c52_stereo(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- lf = GetChannel(a, 4)
--- bc = GetChannel(a, 5)
--- fl_bc = MixAudio(fl, bc, 0.3205, 0.2265)
--- fr_bc = MixAudio(fr, bc, 0.3205, 0.2265)
--- fc_lf = MixAudio(fc, lf, 0.2265, 0.2265)
--- l = MixAudio(fl_bc, fc_lf, 1.0, 1.0)
--- r = MixAudio(fr_bc, fc_lf, 1.0, 1.0)
--- return MergeChannels(l, r)
--- }
--- # 4 Channels Quadro L,R,SL,SR -> Stereo
--- function c4_stereo(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- sl = GetChannel(a, 3)
--- sr = GetChannel(a, 4)
--- l = MixAudio(fl, sl, 0.5, 0.5)
--- r = MixAudio(fr, sr, 0.5, 0.5)
--- return MergeChannels(l, r)
--- }
--- # 4 Channels L,R,C,LFE or L,R,S,LFE or L,R,C,S -> Stereo
--- function c42_stereo(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- lf = GetChannel(a, 4)
--- fc_lf = MixAudio(fc, lf, 0.2929, 0.2929)
--- l = MixAudio(fl, fc_lf, 0.4142, 1.0)
--- r = MixAudio(fr, fc_lf, 0.4142, 1.0)
--- return MergeChannels(l, r)
--- }
--- # 3 Channels L,R,C or L,R,S or L,R,LFE -> Stereo
--- function c3_stereo(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- l = MixAudio(fl, fc, 0.5858, 0.4142)
--- r = MixAudio(fr, fc, 0.5858, 0.4142)
--- return MergeChannels(l, r)
--- }
--- # 5.1 Channels L,R,C,LFE,SL,SR -> Dolby ProLogic
--- function c6_dpl(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- sl = GetChannel(a, 5)
--- sr = GetChannel(a, 6)
--- bc = MixAudio(sl, sr, 0.2265, 0.2265)
--- fl_fc = MixAudio(fl, fc, 0.3205, 0.2265)
--- fr_fc = MixAudio(fr, fc, 0.3205, 0.2265)
--- l = MixAudio(fl_fc, bc, 1.0, 1.0)
--- r = MixAudio(fr_fc, bc, 1.0, -1.0)
--- return MergeChannels(l, r)
--- }
--- # 5 Channels L,R,C,SL,SR -> Dolby ProLogic
--- function c5_dpl(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- sl = GetChannel(a, 4)
--- sr = GetChannel(a, 5)
--- bc = MixAudio(sl, sr, 0.2265, 0.2265)
--- fl_fc = MixAudio(fl, fc, 0.3205, 0.2265)
--- fr_fc = MixAudio(fr, fc, 0.3205, 0.2265)
--- l = MixAudio(fl_fc, bc, 1.0, 1.0)
--- r = MixAudio(fr_fc, bc, 1.0, -1.0)
--- return MergeChannels(l, r)
--- }
--- # 5 Channels L,R,LFE,SL,SR -> Dolby ProLogic
--- function c52_dpl(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- sl = GetChannel(a, 4)
--- sr = GetChannel(a, 5)
--- bc = MixAudio(sl, sr, 0.2929, 0.2929)
--- l = MixAudio(fl, bc, 0.4142, 1.0)
--- r = MixAudio(fr, bc, 0.4142, -1.0)
--- return MergeChannels(l, r)
--- }
--- # 5 Channels L,R,C,LFE,S -> Dolby ProLogic
--- function c53_dpl(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- bc = GetChannel(a, 5)
--- fl_fc = MixAudio(fl, fc, 0.4142, 0.2929)
--- fr_fc = MixAudio(fr, fc, 0.4142, 0.2929)
--- l = MixAudio(fl_fc, bc, 1.0, 0.2929)
--- r = MixAudio(fr_fc, bc, 1.0, -0.2929)
--- return MergeChannels(l, r)
--- }
--- # 4 Channels Quadro L,R,SL,SR -> Dolby ProLogic
--- function c4_dpl(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- sl = GetChannel(a, 3)
--- sr = GetChannel(a, 4)
--- bc = MixAudio(sl, sr, 0.2929, 0.2929)
--- l = MixAudio(fl, bc, 0.4142, 1.0)
--- r = MixAudio(fr, bc, 0.4142, -1.0)
--- return MergeChannels(l, r)
--- }
--- # 4 Channels L,R,LFE,S -> Dolby ProLogic
--- function c42_dpl(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- bc = GetChannel(a, 4)
--- l = MixAudio(fl, bc, 0.5858, 0.4142)
--- r = MixAudio(fr, bc, 0.5858, -0.4142)
--- return MergeChannels(l, r)
--- }
--- # 4 Channels L,R,C,S -> Dolby ProLogic
--- function c43_dpl(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- bc = GetChannel(a, 4)
--- fl_fc = MixAudio(fl, fc, 0.4142, 0.2929)
--- fr_fc = MixAudio(fr, fc, 0.4142, 0.2929)
--- l = MixAudio(fl_fc, bc, 1.0, 0.2929)
--- r = MixAudio(fr_fc, bc, 1.0, -0.2929)
--- return MergeChannels(l, r)
--- }
--- # 3 Channels L,R,S -> Dolby ProLogic
--- function c3_dpl(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- bc = GetChannel(a, 3)
--- l = MixAudio(fl, bc, 0.5858, 0.4142)
--- r = MixAudio(fr, bc, 0.5858, -0.4142)
--- return MergeChannels(l, r)
--- }
--- # 5.1 Channels L,R,C,LFE,SL,SR -> Dolby ProLogic II
--- function c6_dpl2(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- sl = GetChannel(a, 5)
--- sr = GetChannel(a, 6)
--- ssl = MixAudio(sl, sr, 0.2818, 0.1627)
--- ssr = MixAudio(sl, sr, -0.1627, -0.2818)
--- fl_fc = MixAudio(fl, fc, 0.3254, 0.2301)
--- fr_fc = MixAudio(fr, fc, 0.3254, 0.2301)
--- l = MixAudio(fl_fc, ssl, 1.0, 1.0)
--- r = MixAudio(fr_fc, ssr, 1.0, 1.0)
--- return MergeChannels(l, r)
--- }
--- # 5 Channels L,R,C,SL,SR -> Dolby ProLogic II
--- function c5_dpl2(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- fc = GetChannel(a, 3)
--- sl = GetChannel(a, 4)
--- sr = GetChannel(a, 5)
--- ssl = MixAudio(sl, sr, 0.2818, 0.1627)
--- ssr = MixAudio(sl, sr, -0.1627, -0.2818)
--- fl_fc = MixAudio(fl, fc, 0.3254, 0.2301)
--- fr_fc = MixAudio(fr, fc, 0.3254, 0.2301)
--- l = MixAudio(fl_fc, ssl, 1.0, 1.0)
--- r = MixAudio(fr_fc, ssr, 1.0, 1.0)
--- return MergeChannels(l, r)
--- }
--- # 5 Channels L,R,LFE,SL,SR -> Dolby ProLogic II
--- function c52_dpl2(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- sl = GetChannel(a, 4)
--- sr = GetChannel(a, 5)
--- ssl = MixAudio(sl, sr, 0.3714, 0.2144)
--- ssr = MixAudio(sl, sr, -0.2144, -0.3714)
--- l = MixAudio(fl, ssl, 0.4142, 1.0)
--- r = MixAudio(fr, ssr, 0.4142, 1.0)
--- return MergeChannels(l, r)
--- }
--- # 4 Channels Quadro L,R,SL,SR -> Dolby ProLogic II
--- function c4_dpl2(clip a)
--- {
--- fl = GetChannel(a, 1)
--- fr = GetChannel(a, 2)
--- sl = GetChannel(a, 3)
--- sr = GetChannel(a, 4)
--- ssl = MixAudio(sl, sr, 0.3714, 0.2144)
--- ssr = MixAudio(sl, sr, -0.2144, -0.3714)
--- l = MixAudio(fl, ssl, 0.4142, 1.0)
--- r = MixAudio(fr, ssr, 0.4142, 1.0)
--- return MergeChannels(l, r)
--- }
--[Information] [19/04/18 22:59:50] Command line used: -ignorelength -br 128000 -if - -of "{0}"
--[Information] [19/04/18 22:59:50] AviSynth script environment opened
--[Information] [19/04/18 22:59:56] Script loaded
--[Information] [19/04/18 22:59:56] Output Decoder
---[Information] [19/04/18 22:59:56] Channels: 2
---[Information] [19/04/18 22:59:56] Bits per sample: 32
---[Information] [19/04/18 22:59:56] Sample rate: 48000
--[Information] [19/04/18 22:59:56] Job command line: C:\Users\LTX\BACKUP\MeGUI\tools\eac3to\neroAacEnc.exe -ignorelength -br 128000 -if - -of "C:\Users\LTX\Desktop\MeGUI Output\EOE_6CH.m4a"
--[Information] [19/04/18 22:59:58] Process started
--[Information] [19/04/18 22:59:58] Standard output stream
--[Information] [19/04/18 22:59:58] Standard error stream
---[Information] [19/04/18 23:09:30] *************************************************************
---[Information] [19/04/18 23:09:30] * *
---[Information] [19/04/18 23:09:30] * Nero AAC Encoder *
---[Information] [19/04/18 23:09:30] * Copyright 2009 Nero AG *
---[Information] [19/04/18 23:09:30] * All Rights Reserved Worldwide *
---[Information] [19/04/18 23:09:30] * *
---[Information] [19/04/18 23:09:30] * Package build date: Feb 18 2010 *
---[Information] [19/04/18 23:09:30] * Package version: 1.5.4.0 *
---[Information] [19/04/18 23:09:30] * *
---[Information] [19/04/18 23:09:30] * See -help for a complete list of available parameters. *
---[Information] [19/04/18 23:09:30] * *
---[Information] [19/04/18 23:09:30] *************************************************************
--[Information] [19/04/18 23:47:51] MediaInfo
---[Information] [19/04/18 23:47:51] File: C:\Users\LTX\Desktop\MeGUI Output\EOE_6CH.m4a
---[Information] General
----[Information] Format: MPEG-4
----[Information] FormatString: MPEG-4
----[Information] FileSize: 84327816
----[Information] PlayTime: 01:26:49.195
---[Information] Audio
----[Information] ID: 1
----[Information] StreamOrder: 0
----[Information] Format: AAC
----[Information] FormatProfile: LC
----[Information] FormatSettingsSBR: No (Explicit)
----[Information] FormatSettingsPS:
----[Information] Muxing Mode:
----[Information] SamplingRate: 48000
----[Information] SamplingRateString: 48.0 kHz
----[Information] Channels: 2
----[Information] ChannelsString: 2 channels
----[Information] ChannelPositionsString2: 2/0/0
----[Information] BitRateMode: VBR
----[Information] Delay:
----[Information] Title:
----[Information] Language:
----[Information] LanguageString:
----[Information] Default:
----[Information] DefaultString:
----[Information] Forced:
----[Information] ForcedString:
----[Information] [19/04/18 23:47:51] The language information is not available for this track. The default MeGUI language has been selected.
--[Information] [19/04/18 23:47:51] Postprocessing
---[Information] [19/04/18 23:47:51] Deleting intermediate files
--[Information] [19/04/18 23:47:51] Job completed

Quote:
Ignoring downmix as there is only 2 channel(s)
What? Why? It has 6 channels for sure!

Last edited by tebasuna51; 20th April 2018 at 12:53. Reason: code -> quote
doomleox999 is offline   Reply With Quote
Old 20th April 2018, 13:17   #29  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,805
Quote:
Originally Posted by doomleox999 View Post
I use headphones.
In any point of your audio chain there are a downmix to send audio to your headphones with only 2 speakers.

You are comparing a downmix method with other, not the original and the downmixed.

Quote:
The best way to explain the difference I hear would be sending you samples from the original 6ch, ... but I'm not sure if that's allowed.
You can cut a sample and upload in http://www.sendspace.com for instance.

Quote:
This is the MeGUI log using the script from my previous reply:

-- Ignoring downmix as there is only 2 channel(s)
Code:
... 
Import("C:\Users\LTX\Desktop\MeGUI Output\EOE_6CH.avs")
# detected channels: 2
Normalize()
return last
...
What? Why? It has 6 channels for sure!
The original have 6 channels but now the input is EOE_6CH.avs
And inside EOE_6CH.avs there are already the desired downmix to 2.0, and also a Normalize(), duplicated now.

See my image in https://forum.doom9.org/showthread.p...18#post1839018
When the input is a .avs with the desired downmix you can select:
Keep Original channels
and if the Normalize() is included in the .avs, uncheck the Normalize peaks or you waste time with 2 Normalize() functions.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 22nd April 2018, 01:20   #30  |  Link
doomleox999
Registered User
 
Join Date: Nov 2015
Posts: 78
So, I used this script:

Code:
ClearAutoloadDirs()
AddAutoloadDir("C:\Users\LTX\BACKUP\MeGUI\tools\avs\plugins")
LoadPlugin("C:\Users\LTX\BACKUP\MeGUI\tools\lsmash\LSMASHSource.dll")
a=LWLibavAudioSource("C:\Users\LTX\Desktop\EOE_6CH.mkv")

  fl = GetChannel(a, 1)
  fr = GetChannel(a, 2)
  fc = GetChannel(a, 3)
#  lf = GetChannel(a, 4)
  sl = GetChannel(a, 5)
  sr = GetChannel(a, 6)
  fl_sl = MixAudio(fl, sl, 1.0, 0.707107)
  fr_sr = MixAudio(fr, sr, 1.0, 0.707107)
  l = MixAudio(fl_sl, fc, 1.0, 0.707107)
  r = MixAudio(fr_sr, fc, 1.0, 0.707107)
  MergeChannels(l, r)

Normalize()
return last
With this audio configuration:



And I'm still getting the same result. Here's the log:

Quote:
[Information] Log
-[Information] Versions
--[Information] MeGUI: 2828 x86
--[Information] Update Check: stable update server
--[Information] System Information
---[Information] Operating System: Windows 10 (CORE_SINGLELANGUAGE) 1709 x64 (10.0.16299.309)
---[Information] .NET Framework: 4.0 (4.0.0.0)
---[Information] .NET Framework: 4.7 (4.7.02556)
---[Information] DPI: 100% (96/96)
---[Information] Monitor 1
----[Information] Resolution: 1366x768
----[Information] Primary Screen: True
--[Information] Component Information
---[Information] Haali Media Splitter: not installed
---[Information] Haali DSS2: not installed
---[Information] ICSharpCode.SharpZipLib: 0.85.5.452 (07-08-2008)
---[Information] MediaInfo: 17.12.0.0 (21-12-2017)
---[Information] SevenZipSharp: 0.64.3890.29348 (02-01-2011)
---[Information] 7z: 9.20 (18-11-2010)
--[Information] AviSynth Information
---[Information] AviSynth Wrapper
----[Information] Version: 1.0.2721.0
----[Information] Date: 29-04-2017
----[Information] Interface: 3
---[Information] AviSynth
----[Information] not installed
---[Information] AviSynth portable
----[Information] File Version: 0.1
----[Information] Date: 27-12-2017
----[Information] Name: AviSynth+ 0.1 (r2580, MT, i386)
----[Information] Version: AviSynth+ 0.1 (r2580, MT, i386)
----[Information] AviSynth+: true
----[Information] MT: true
----[Information] Status: active
-[Information] Update detection
--[Information] [21/04/18 06:51:22] Using cached update config and server: http://megui.org/auto/stable/
--[Information] [21/04/18 06:51:22] No package requires an update
-[Information] Log for job1 (audio, EOE_6CH.avs -> EOE_6CH_custom_script.m4a)
--[Information] [21/04/18 06:55:22] Started handling job
--[Information] [21/04/18 06:55:22] Preprocessing
--[Information] [21/04/18 06:55:23] MediaInfo
---[Information] [21/04/18 06:55:23] File: C:\Users\LTX\Desktop\MeGUI Output\EOE_6CH.avs
---[Information] AVS input file detected. Getting media information from AviSynth.
---[Information] General
----[Information] Format: AVS
----[Information] FormatString: AviSynth Script
----[Information] FileSize: 585
----[Information] PlayTime: 01:26:49.1310000
---[Information] Audio
----[Information] ID: 0
----[Information] StreamOrder:
----[Information] Format: AVS
----[Information] FormatProfile:
----[Information] FormatSettingsSBR:
----[Information] FormatSettingsPS:
----[Information] Muxing Mode:
----[Information] SamplingRate: 48000
----[Information] SamplingRateString: 48000
----[Information] Channels: 2
----[Information] ChannelsString: 2 channels
----[Information] ChannelPositionsString2:
----[Information] BitRateMode: CBR
----[Information] Delay: 0
----[Information] Title:
----[Information] Language:
----[Information] LanguageString:
----[Information] Default:
----[Information] DefaultString:
----[Information] Forced:
----[Information] ForcedString:
----[Information] [21/04/18 06:55:31] The language information is not available for this track. The default MeGUI language has been selected.
--[Information] [21/04/18 06:55:40] AviSynth script
---[NoImage] ClearAutoloadDirs()
---[NoImage] AddAutoloadDir("C:\Users\LTX\BACKUP\MeGUI\tools\avs\plugins")
---[NoImage] Import("C:\Users\LTX\Desktop\MeGUI Output\EOE_6CH.avs")
---[NoImage] # detected channels: 2
---[NoImage] # detected channel positions:
---[NoImage] return last
--[Information] [21/04/18 06:55:40] Command line used: -ignorelength -q 0.4 -if - -of "{0}"
--[Information] [21/04/18 06:55:40] AviSynth script environment opened
--[Information] [21/04/18 06:55:47] Script loaded
--[Information] [21/04/18 06:55:47] Output Decoder
---[Information] [21/04/18 06:55:47] Channels: 2
---[Information] [21/04/18 06:55:47] Bits per sample: 32
---[Information] [21/04/18 06:55:47] Sample rate: 48000
--[Information] [21/04/18 06:55:47] Job command line: C:\Users\LTX\BACKUP\MeGUI\tools\eac3to\neroAacEnc.exe -ignorelength -q 0.4 -if - -of "C:\Users\LTX\Desktop\MeGUI Output\EOE_6CH_custom_script.m4a"
--[Information] [21/04/18 06:55:49] Process started
--[Information] [21/04/18 06:55:49] Standard output stream
--[Information] [21/04/18 06:55:49] Standard error stream
---[Information] [21/04/18 07:12:27] *************************************************************
---[Information] [21/04/18 07:12:27] * *
---[Information] [21/04/18 07:12:27] * Nero AAC Encoder *
---[Information] [21/04/18 07:12:27] * Copyright 2009 Nero AG *
---[Information] [21/04/18 07:12:27] * All Rights Reserved Worldwide *
---[Information] [21/04/18 07:12:27] * *
---[Information] [21/04/18 07:12:27] * Package build date: Feb 18 2010 *
---[Information] [21/04/18 07:12:27] * Package version: 1.5.4.0 *
---[Information] [21/04/18 07:12:27] * *
---[Information] [21/04/18 07:12:27] * See -help for a complete list of available parameters. *
---[Information] [21/04/18 07:12:27] * *
---[Information] [21/04/18 07:12:27] *************************************************************
--[Information] [21/04/18 08:02:15] MediaInfo
---[Information] [21/04/18 08:02:15] File: C:\Users\LTX\Desktop\MeGUI Output\EOE_6CH_custom_script.m4a
---[Information] General
----[Information] Format: MPEG-4
----[Information] FormatString: MPEG-4
----[Information] FileSize: 74149830
----[Information] PlayTime: 01:26:49.195
---[Information] Audio
----[Information] ID: 1
----[Information] StreamOrder: 0
----[Information] Format: AAC
----[Information] FormatProfile: LC
----[Information] FormatSettingsSBR: No (Explicit)
----[Information] FormatSettingsPS:
----[Information] Muxing Mode:
----[Information] SamplingRate: 48000
----[Information] SamplingRateString: 48.0 kHz
----[Information] Channels: 2
----[Information] ChannelsString: 2 channels
----[Information] ChannelPositionsString2: 2/0/0
----[Information] BitRateMode: VBR
----[Information] Delay:
----[Information] Title:
----[Information] Language:
----[Information] LanguageString:
----[Information] Default:
----[Information] DefaultString:
----[Information] Forced:
----[Information] ForcedString:
----[Information] [21/04/18 08:02:17] The language information is not available for this track. The default MeGUI language has been selected.
--[Information] [21/04/18 08:02:17] Postprocessing
---[Information] [21/04/18 08:02:17] Deleting intermediate files
--[Information] [21/04/18 08:02:17] Job completed
BTW, these are the first 15 seconds of the file. The samples are from the original mkv file, the ffmpeg encode and the MeGUI encode.

6 CH ORIGINAL MKV.aac
2 CH FFMPEG.aac
2 CH MEGUI.aac

I hope this is enough for you to note the difference between the 2 encodes, if it's not, let me know and I'll upload more.

Last edited by tebasuna51; 24th April 2018 at 21:28.
doomleox999 is offline   Reply With Quote
Old 22nd April 2018, 12:58   #31  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,805
The audio volume is proportional to RMS value of audio signals, your 6 CH original sample:

Code:
                6 CH ORIGINAL MKV.aac
                ---------------------
RMS power ch0:  3.56%   (-28.98 dB)
RMS power ch1:  2.27%   (-32.87 dB)
RMS power ch2:  1.80%   (-34.91 dB)
RMS power ch3:  3.15%   (-30.04 dB)
RMS power ch4:  2.44%   (-32.26 dB)
RMS power ch5:  2.43%   (-32.28 dB)
               ------
               15.65
And the recodec ones:

Code:
              2 CH FFMPEG.aac       2 CH MEGUI.aac
              -------------------  -------------------
RMS power L:  4.45%   (-27.03 dB)  3.19%   (-29.91 dB)
RMS power R:  3.58%   (-28.92 dB)  2.53%   (-31.92 dB)
              -----                -----
              8.03                 5.72

Min value L:  -40.22% (-7.91 dB)   -28.36% (-10.95 dB)
Min value R:  -26.14% (-11.65 dB)  -18.59% (-14.61 dB)
Max value L:  39.02%  (-8.17 dB)   27.20%  (-11.31 dB)
Max value R:  25.67%  (-11.81 dB)  16.95%  (-15.42 dB)
The volume of ffmpeg sample is half of original, and the megui sample is the third part of original (like can be expected with 2 speakers instead 6).

But recoding your sample with the same methods than you, instead the original, and cut the first 15 sec.:

Code:
              ffmpeg_stereo.aac    Megui_stereo.m4a
              -------------------  -------------------
RMS power L:  4.45%   (-27.03 dB)  11.11%  (-19.09 dB)
RMS power R:  3.58%   (-28.93 dB)   8.82%  (-21.10 dB)
              -----                ------
              8.03                 19.93

Min value L:  -28.36% (-10.95 dB)  -100.00%  (0.00 dB)
Min value R:  -18.59% (-14.61 dB)  -66.13% (-3.59 dB)
Max value L:  27.20%  (-11.31 dB)  97.13%  (-0.25 dB)
Max value R:  16.95%  (-15.42 dB)  61.68%  (-4.20 dB)
The ffmpeg sample have identical volume than before, but the megui-avisynth have bigger volume than original.

The difference is related to Normalize().
Now Normalize amplify the volume to reach the max volume without distort:

Min value L: -28.36% (-10.95 dB) -100.00% (0.00 dB)

But normalizing the full stream reach the max volume at a point not included in the sample and, in the sample, the máx volume value is:

Min value L: -40.22% (-7.91 dB) -28.36% (-10.95 dB)

That means than the ffmpeg downmix have parts with samples clipped.
If you want the same result don't Normalize().
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 22nd April 2018 at 13:02.
tebasuna51 is offline   Reply With Quote
Old 23rd April 2018, 16:03   #32  |  Link
doomleox999
Registered User
 
Join Date: Nov 2015
Posts: 78
I didn't normalize and the result is the same. BTW, I noticed in the last log that MeGUI doesn't mention anything about the matrix thing, so maybe it didn't work.

I'm talking about this part in the custom script:

Code:
  fl_sl = MixAudio(fl, sl, 1.0, 0.707107)
  fr_sr = MixAudio(fr, sr, 1.0, 0.707107)
  l = MixAudio(fl_sl, fc, 1.0, 0.707107)
  r = MixAudio(fr_sr, fc, 1.0, 0.707107)
doomleox999 is offline   Reply With Quote
Old 23rd April 2018, 20:44   #33  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,805
Quote:
Originally Posted by doomleox999 View Post
I didn't normalize and the result is the same.
Is not possible, without the Normalize() we must obtain similar values than ffmpeg:

Code:
              2 CH FFMPEG.aac      2 CH MEGUI_Not-Nor.
              -------------------  -------------------
RMS power L:  4.45%   (-27.03 dB)  4.45%   (-27.04 dB)
RMS power R:  3.58%   (-28.92 dB)  3.53%   (-29.05 dB)
              -----                -----
              8.03                 7.98

Min value L:  -40.22% (-7.91 dB)   -40.70% (-7.81 dB)
Min value R:  -26.14% (-11.65 dB)  -27.07% (-11.35 dB)
Max value L:  39.02%  (-8.17 dB)   38.43%  (-8.31 dB)
Max value R:  25.67%  (-11.81 dB)  23.76%  (-12.48 dB)
Quote:
BTW, I noticed in the last log that MeGUI doesn't mention anything about the matrix thing, so maybe it didn't work.
Is not showed in the log because MeGUI don't add the downmix, is included in the Import().
If you obtain only two channels the downmix work.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 24th April 2018, 19:40   #34  |  Link
doomleox999
Registered User
 
Join Date: Nov 2015
Posts: 78
These are the scripts I used and 15 seconds samples of both results:

Code:
ClearAutoloadDirs()
AddAutoloadDir("C:\Users\LTX\BACKUP\MeGUI\tools\avs\plugins")
LoadPlugin("C:\Users\LTX\BACKUP\MeGUI\tools\lsmash\LSMASHSource.dll")
a=LWLibavAudioSource("C:\Users\LTX\Desktop\EOE_6CH.mkv")

  fl = GetChannel(a, 1)
  fr = GetChannel(a, 2)
  fc = GetChannel(a, 3)
#  lf = GetChannel(a, 4)
  sl = GetChannel(a, 5)
  sr = GetChannel(a, 6)
  fl_sl = MixAudio(fl, sl, 1.0, 0.707107)
  fr_sr = MixAudio(fr, sr, 1.0, 0.707107)
  l = MixAudio(fl_sl, fc, 1.0, 0.707107)
  r = MixAudio(fr_sr, fc, 1.0, 0.707107)
  MergeChannels(l, r)

Normalize()
return last
EOE_6CH.aac


Code:
ClearAutoloadDirs()
AddAutoloadDir("C:\Users\LTX\BACKUP\MeGUI\tools\avs\plugins")
LoadPlugin("C:\Users\LTX\BACKUP\MeGUI\tools\lsmash\LSMASHSource.dll")
a=LWLibavAudioSource("C:\Users\LTX\Desktop\EOE_6CH.mkv")

  fl = GetChannel(a, 1)
  fr = GetChannel(a, 2)
  fc = GetChannel(a, 3)
#  lf = GetChannel(a, 4)
  sl = GetChannel(a, 5)
  sr = GetChannel(a, 6)
  fl_sl = MixAudio(fl, sl, 1.0, 0.707107)
  fr_sr = MixAudio(fr, sr, 1.0, 0.707107)
  l = MixAudio(fl_sl, fc, 1.0, 0.707107)
  r = MixAudio(fr_sr, fc, 1.0, 0.707107)
  MergeChannels(l, r)

return last
EOE_6CH - NO NORM.aac
doomleox999 is offline   Reply With Quote
Old 24th April 2018, 21:26   #35  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,805
Quote:
Originally Posted by doomleox999 View Post
a=LWLibavAudioSource("C:\Users\LTX\Desktop\EOE_6CH.mkv")
You need use:

a=LWLibavAudioSource("6 CH ORIGINAL MKV.aac")

not the full stream and after cut, in order to see the effect of Normalize()
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 25th April 2018, 03:21   #36  |  Link
doomleox999
Registered User
 
Join Date: Nov 2015
Posts: 78
I used the original mkv file, not the 15 seconds sample. You told me that using the mkv or an aac (extracted audio) is the same.
doomleox999 is offline   Reply With Quote
Old 25th April 2018, 09:18   #37  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,805
Quote:
Originally Posted by doomleox999 View Post
I used the original mkv file, not the 15 seconds sample. You told me that using the mkv or an aac (extracted audio) is the same.
Yes, but is not the same use the full aac or mkv than use only the first 15 seconds.

Normalize() amplify the source until reach a max value, in the first 15 seconds (100% in my Megui_stereo.m4a), using the full stream the 100% is in another point out of first 15 sec. and can't be amplified more.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 30th April 2018, 18:22   #38  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,253
Quote:
Originally Posted by mkver View Post
I somehow forgot about this thread, but now that I see hello_hellos results I see a system behind it: If ffmpeg downmixes to 32b float, it uses the one set of coefficients, if it downmixes to pcm it uses the other set of coefficients. The most direct way to test this is by not using the aac or libmp3lame encoders, but -c:a pcm_s16le, pcm_s24le, pcm_f32le. And if one does it, the results confirm the preceding statement. The aac encoder probably accepts float input only (or prefers it) so that the auto_resampler resamples everything to float, whereas libmp3lame seems to accept everything so that downmixing in this case only changes the number of channels, not the sample format.
But does anybody have a definitive answer why ffmpeg uses different coefficients for float and non-float? In both cases the ratios coincide: 1/0.707107 and 0.414214/0.292893 are both very good approximations for 2^(0.5) which is probably the value that they are supposed to be. Probably it is because one doesn't need to care about clipping that much if one uses float output.
Personally, I think the way ffmpeg changes the coefficients is somewhat strange. I don't think it's unreasonable to expect the same command line would always produce the same result (aside from the output format).

The coefficients might relate to the ability of the output format/codec to encode peaks above 0dB. I can't speak for ffmpeg's AAC encoder, but QAAC doesn't clip peaks when the input is float. I vaguely remember someone in another forum testing it and QAAC coped with peaks well over 0dB.

I'm not sure about the LAME encoder. The stand-alone version accepts 32 bit float but downsamples to 24 bit integer before encoding, so peaks greater than 0dB would be clipped.
ffmeg's built-in LAME encoder seems to accept 32 bit float though. I've compared it to the standalone LAME, and ffmpeg's LAME encodes peaks above 0dB, at least according to a true peak scan of the encoded audio. Whether those peaks are encoded accurately.... that might be a different story.

Last edited by hello_hello; 30th April 2018 at 19:07.
hello_hello is offline   Reply With Quote
Old 30th April 2018, 19:05   #39  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,253
doomleox999,
as an alternative you could try downmixing and encoding with foobar2000. I use it for 99.9% of my audio encoding. You can add DSPs to both the playback and conversion chains and conversion configurations can be saved as presets. There's plugins for decoding audio it can't decode "out of the box" (DTS and AC3 are the main examples) and there's even a plugin for decoding Avisynth scripts.

Not that I downmix much these days, but if I downmix and encode a bunch of related files (episodes of a TV show etc) I usually downmix with the matrix mixer DSP while reducing the over-all volume by 6dB. It's not quite enough to guarantee there won't be clipping, but it's enough most of the time, and that way the relative volumes of each track doesn't change. Once it's encoded, I run a ReplayGain scan on the encoded audio to check the peak levels (I encode with either QAAC or ffmpeg's MP3 encoder so the peaks aren't clipped before encoding). If a track or two has peaks above 0dB I'd probably re-encode them with a limiter DSP in the conversion chain. On the rare occasion there's lots of tracks with peaks above 0dB, I'd decrease the volume of each output file by an appropriate amount (so the relative volumes remain the same). Foobar2000 can losslessly adjust the volume of MP3 and AAC audio in an MP4 or MKV container, or alternatively you could reduce the downmix volume and re-encode them all a second time, which isn't as bad as it sounds as you can encode multiple files simultaneously.
Fb2k comes with it's own downmix DSP but it's not configurable and it doesn't reduce the volume to prevent clipping.

There's a screenshot of the matrix mixer DSP below. The coefficients are specified as a percentage, as they are when downmixing with Avisynth or ffmpeg. This is my standard 5.1ch to stereo downmix preset with an overall 6dB volume reduction. Both the back and side channels need to be included for 5.1ch, as the surround channels can be in either the back or side.


Last edited by hello_hello; 30th April 2018 at 19:10.
hello_hello is offline   Reply With Quote
Reply

Tags
6channels, ffmpeg, megui, stereo

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:45.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.