Log in

View Full Version : LAV Filters - DirectShow Media Splitter and Decoders


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 [229] 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508

clsid
27th June 2012, 15:21
Thanks. Checking based on filename should be fine imo. The worst that can happen for a wrongly named file is incorrect AR. A wrong AR is more likely in the current situation, so changing behavior will only reduce chance of incorrect behavior.

SeeMoreDigital
27th June 2012, 17:47
Personally, I can't see the point of aspect ratio signalling at the container level. Indeed, I don't know of any hardware player that supports it. And there are few software players that do.

Placing aspect ratio signalling at the stream level is supported by most of today's hardware and software media players. And has the added advantage of allowing 4:3 and 16:9 signalled video to be mixed together as a continuous stream within a single container.


Cheers

clsid
27th June 2012, 18:39
The discussion is not about what is the best practice for AR signaling. It is about properly supporting files that use container AR signaling.

mandarinka
27th June 2012, 19:15
Personally, I can't see the point of aspect ratio signalling at the container level. Indeed, I don't know of any hardware player that supports it. And there are few software players that do.

Placing aspect ratio signalling at the stream level is supported by most of today's hardware and software media players. And has the added advantage of allowing 4:3 and 16:9 signalled video to be mixed together as a continuous stream within a single container.


Cheers

I think that relying on container for aspect ratio metadata was actually almost the norm for most users, when outputting matroska.

It might have been due to moving from ASP, where using stream metadata usually had no effect on most players with avi files. But anyway, I'm pretty sure that people encoding to matroska are way more likely to produce a file with proper container metadata but wrong stream metadata (that is usually SAR mistakenly left as 1:1 for anamorphic encodes), than vice versa.

This is also supported by the fact that putting wrong data into mkv header will immediately show with most players, which makes the wrongdoing ripper correct his stuff. Whereas if you neglect to specify sar, the rip usually plays properly as long as the container info in mkv is okay.

TL;DR: The haali way is pretty logic thing to do for matroska files imho. If some files happen to be called *.mkv but are in fact another format, then that's a retarded minority case that shouldn't prevent the software from properly treating a valid majority case, IMHO.

nevcairiel
27th June 2012, 20:12
I agree that for playback stream AR is better.
But its also easier to change the container AR in matroska for example, then it is to change the stream AR, but thats really beside the point of the whole discussion.

SeeMoreDigital
27th June 2012, 21:06
Hmmm...

I remember the days when Mosu's MKVmergeGUI automatically removed aspect ratio signalling from the video stream by default in favour of placing it at the container level. But eventually even he had to see the light in order to maintain compliance with hardware and software players.

So, container level signalling works with Haali's "software" Matroska splitter - But that's where support for container level signalling ends as far as I'm aware.

Anyway, many thanks nev for your continued support. Your LAV filter suite is fantastic. I have it running on three of my nVidia GPU computers ;)

nevcairiel
27th June 2012, 21:09
So, container level signalling works with Haali's "software" Matroska splitter - But that's where support for container level signalling ends as far as I'm aware

Container AR works just fine with LAV Splitter, assuming that either:
- There is no Stream AR
- Or, you can convince the decoder to ignore the stream AR (like LAV has an option for)

What clsid suggested was to make the second option smarter, and add an "auto" mode that doesn't use the stream AR on containers like matroska where files are known to have a working container AR.

SeeMoreDigital
27th June 2012, 21:19
Container AR works just fine with LAV Splitter, assuming that either:
- There is no Stream AR
- Or, you can convince the decoder to ignore the stream AR (like LAV has an option for)

What clsid suggested was to make the second option smarter, and add an "auto" mode that doesn't use the stream AR on containers like matroska where files are known to have a working container AR.
So currently, when you un-check the "Use Stream Aspect Ratio" option. Does your filter use the aspect ratio signalling information from the .MKV container?

nevcairiel
27th June 2012, 21:26
So currently, when you un-check the "Use Stream Aspect Ratio" option. Does your filter use the aspect ratio signalling information from the .MKV container?

Yes, of course. It uses whatever AR comes from the splitter, and with LAV thats the container AR, if available (if no container AR is set, the stream AR is reported by the splitter)

SeeMoreDigital
27th June 2012, 21:33
Yes, of course. It uses whatever AR comes from the splitter, and with LAV thats the container AR, if available (if no container AR is set, the stream AR is reported by the splitter)
That's impressive!

nevcairiel
29th June 2012, 21:47
Hey,

i finally sat down and built the first draft of mixing functionality.

Builds:
x86: http://files.1f0.de/lavf/LAVFilters-0.50.5-46-gd75bb42.zip
x64: http://files.1f0.de/lavf/LAVFilters-0.50.5-46-gd75bb42-x64.zip

You'll need to re-register LAV Audio to be able to access the new configuration page for the mixing options.

The options are still a bit limited, you can basically just choose your speaker layout out of a list of common layouts i just dreamed up (if you think something else should be in that list, let me know), and additionally control if Stereo should be mixed to that layout as well (so you can have stereo untouched, while mixing all surround to 5.1, for example)

Note that for now, only downmixing is performed, so if you select 5.1, you'll always get a 5.1 signal, but with silent channels added when needed.
Basic Upmixing (channel copying) is still on the TODO.

In the short term (next few days), i'll add options to control the mixing bias for the center and surround channels, for people that prefer the center channel to be a bit louder then the other channels, and things like that.
In the long term, i'll be thinking about how to allow more dynamic and manual matrix control. Not sure how that'll look yet.

aufkrawall
29th June 2012, 22:00
Nice. :)
Nev, is there a chance that you will implement a simple normalize function?
http://www.ld-host.de/uploads/thumbnails/ef51d5ccbdb61e8b65b7f127420a7f3c.jpg (http://www.ld-host.de/show/ef51d5ccbdb61e8b65b7f127420a7f3c.jpg)

nevcairiel
29th June 2012, 22:37
Nev, is there a chance that you will implement a simple normalize function?

Nothing like that is planned, no.
Mostly because simple normalization just plainly sucks. One loud noise in your movie, and suddenly everything is quiet, its just impossible to get a consistent experience with stuff like that.

DragonQ
29th June 2012, 22:51
I guess the best way to avoid "pumping" (what you describe with everything going quiet because of one loud noise) is to look ahead but I dunno how you'd do it in real time. I've only ever done compression offline (only when necessary, generally dynamic range compression is bad) where it's easy to handle this.

Honestly, if there was a half-decent normalisation implementation I'd have no need for any other codec/filter package any more, so I hope it happens one day. But it's not a priority and might be difficult so I'm not expecting anything soon. A mixer is cool though. :)

clsid
29th June 2012, 23:13
People seem to be pretty satisfied with the normalization implementation of ffdshow. Audio going quiet isn't a big problem with ffdshow, at least I haven't noticed it nor have I seen reports of it. A similar implementation would be awesome and would make many people very happy.

Normalization is an optional feature, so audiophiles can still get bit-perfect audio at default settings. Others may care more about having enjoyable volume levels than getting the best possible audio quality.

DragonQ
29th June 2012, 23:24
It's not really about audio quality, it's about preserving dynamic range. However, there are certain environments where a lot of dynamic range can be really annoying (e.g. late at night or like when your headphones aren't that loud and max volume isn't loud enough for some quieter audio).

It's also strange that most TV shows, even the ones with barely any dynamic range, don't ever get near the maximum audio level (-0dBFS), which seems like a waste.

e-t172
29th June 2012, 23:28
It's also strange that most TV shows, even the ones with barely any dynamic range, don't ever get near the maximum audio level (-0dBFS), which seems like a waste.

That's because contrary to music, there are standards for average audio levels in movies and broadcast to avoid uneven levels between shows, so they can't simply normalize it. Theoretically, the same result could be achieved by clever use of metadata, but there's no spec for anything like it AFAIK.

Sebastiii
29th June 2012, 23:28
Nice work Nevcairiel :)

DragonQ
29th June 2012, 23:49
That's because contrary to music, there are standards for average audio levels in movies and broadcast to avoid uneven levels between shows, so they can't simply normalize it. Theoretically, the same result could be achieved by clever use of metadata, but there's no spec for anything like it AFAIK.
Except those "standards" are useless because most TV shows have average compression, with HD channels typically having little compression and adverts have massive compression. So levels aren't normalised anyway.

kitame
30th June 2012, 01:58
this is slightly offtopic but its related, i'm using realtek's loudness equalization and it works, but sadly it works horribly with the band equalizer set to 0, solution was pump the band equalizer up by 3-4 points equally. i don't know what happens but everything sounds balanced this way, no distortions either.

Realtek ALC889 =P

kasper93
30th June 2012, 02:34
@nevcairiel: LAV splitter seems to have problems with LPCM audio in m2ts (bluray). Sometimes it work, but most of the time whole playback is jerky. Problem occurs after seeking or changing track or just at start. MPC MPEG Source + LAV A/V decoder works fine.

STaRGaZeR
30th June 2012, 03:07
Sorry to crap on the thread, but can anyone with an AMD GPU run this command and upload the resulting .reg file somewhere? I fucked something up and this may help me fixing it without a full Windows reinstall.

regedit.exe /s /a "Path" "HKEY_CURRENT_USER\Software\ATI"

Change Path to where you want the resulting .reg file, for example: C:\Users\STaRGaZeR\Desktop\ATIREG.reg

ryrynz
30th June 2012, 03:59
STaRGaZeR, I pulled this from an all in one system @ work, I hope it fixes your problem.

http://www.mediafire.com/?qs93d4dgm11j4jb

ageback
30th June 2012, 06:46
avfilter-lav-2.dll this file is no longer used.LAVFilters.iss should be modified.

wanezhiling
30th June 2012, 08:04
I disable "auto-load subtitles" in playback tab and set DirectVobSub to "Prefer", then play a file with embedded subtitle.


http://i.imgur.com/2CymE.png
With the LAV SW/CUVID/QuickSync/DXVA2 CB, VSFilter works fine.

http://i.imgur.com/TdNYX.png
But with the native mode, VSFilter cannot be loaded. Is this a bug, nev? I think lav should fall back to sw and then VSFilter can be loaded when playing back a file with embedded subtitle.

BeNooL
30th June 2012, 08:38
Except those "standards" are useless because most TV shows have average compression, with HD channels typically having little compression and adverts have massive compression. So levels aren't normalised anyway.

Oldest trick in the book. The standard says something like audio level can't exceed 70dB (don't know the actual value).
Normal programs don't exceed it and have a substantial dynamic range.
Adverts on the other hand twisted the definition of that limit and also made it "audio can't go lower than 70db" through use of compression.

Technically both content have a 70db peak, yet the nature of how we perceive audio volume tells us ads are louder.

Mercury_22
30th June 2012, 09:08
Hey,

i finally sat down and built the first draft of mixing functionality.

Builds:
x86: http://files.1f0.de/lavf/LAVFilters-0.50.5-46-gd75bb42.zip
x64: http://files.1f0.de/lavf/LAVFilters-0.50.5-46-gd75bb42-x64.zip

You'll need to re-register LAV Audio to be able to access the new configuration page for the mixing options.

The options are still a bit limited, you can basically just choose your speaker layout out of a list of common layouts i just dreamed up (if you think something else should be in that list, let me know), and additionally control if Stereo should be mixed to that layout as well (so you can have stereo untouched, while mixing all surround to 5.1, for example)

Note that for now, only downmixing is performed, so if you select 5.1, you'll always get a 5.1 signal, but with silent channels added when needed.
Basic Upmixing (channel copying) is still on the TODO.

In the short term (next few days), i'll add options to control the mixing bias for the center and surround channels, for people that prefer the center channel to be a bit louder then the other channels, and things like that.
In the long term, i'll be thinking about how to allow more dynamic and manual matrix control. Not sure how that'll look yet.

Why reinvent the wheel ?
Why don't just use the "Custom channel mapping" (design) idea from MPC / FFD ?
It's the best solution = the most flexible, intuitive / user friendly solution for up/down mixing
Just add independent Volume levels for each channel (see FFD) on the same page and that's it = the best solution ever ! :p


P.S. Some people need non-standard up/down mixing and this is the best way to satisfy all :)

nevcairiel
30th June 2012, 09:50
Why don't just use the "Custom channel mapping" (design) idea from MPC / FFD ?

Thats what manual matrix control would give you, a big box of input fields where you can enter the coefficients for mapping channel A to channel B, much like ffdshows mixer.

Its still nice to have a few easy-to-use preset options, for the common cases, because such a matrix is not easy to setup properly :p

Mercury_22
30th June 2012, 10:16
Thats what manual matrix control would give you, a big box of input fields where you can enter the coefficients for mapping channel A to channel B, much like ffdshows mixer.

Its still nice to have a few easy-to-use preset options, for the common cases, because such a matrix is not easy to setup properly :p

"not easy to setup" ? come on !:D as long as the columns and rows are labeled intuitively the user has to be a....:p not to be able to easy setup the matrix
Anyway nice to see you've started to implement this and I can't wait for the independent volume levels :)

nevcairiel
30th June 2012, 10:17
I disable "auto-load subtitles" in playback tab and set DirectVobSub to "Prefer", then play a file with embedded subtitle.


http://i.imgur.com/2CymE.png
With the LAV SW/CUVID/QuickSync/DXVA2 CB, VSFilter works fine.

http://i.imgur.com/TdNYX.png
But with the native mode, VSFilter cannot be loaded. Is this a bug, nev? I think lav should fall back to sw and then VSFilter can be loaded when playing back a file with embedded subtitle.

This will work with the next version.
Note however that you might as well turn off DXVA in LAV when you set it up like this, because DirectVobSub will always load when you set it as preferred, not only when there are subtitles.

nevcairiel
30th June 2012, 10:19
"not easy to setup" ? come on !:D as long as the columns and rows are labeled intuitively the user has to be a....:p not to be able to easy setup the matrix


For a user its much easier to just select "I have 5.1 speakers, do your magic" then having to figure out how such a matrix works. If they don't know how digital mixing works, they'll probably just enter 1s and 0s everywhere, and get a rather bad result in the end.

Mercury_22
30th June 2012, 10:29
For a user its much easier to just select "I have 5.1 speakers, do your magic" then having to figure out how such a matrix works. If they don't know how digital mixing works, they'll probably just enter 1s and 0s everywhere, and get a rather bad result in the end.

What 1s and 0s ?:confused:
e.g. I'm using MPC's "Custom channel mapping" and all I have to do is to click on (mark) which speaker(s) I want each channel (e.g. front right input) to be outputted on (e.g. front right AND back right or just back right...speaker(s) ) !

ryrynz
30th June 2012, 10:41
Nevcairiel is referring to the ffdshow's audio mixer where 1s and 0s are entered when you choose to enter a custom matrix.

Mercury_22
30th June 2012, 10:52
Nevcairiel is referring to the ffdshow's audio mixer where 1s and 0s are entered when you choose to enter a custom matrix.

Ouch sorry! I haven't used ffd's matrix in a while (years :) )!

Then forget FFD use MPC's matrix (design) idea it's the best = just click/mark the speaker you want to use for each channel

And it also has a default (value) mark for the common / default speaker configuration so most of the user all they have to do is to enable it

@Nev PLEASE take a look at MPC-HC's "Custom channel mapping" it is so easy to use and can satisfy ALL the users needs !

nevcairiel
30th June 2012, 10:58
MPC-HCs thing is too limited, if you just use it like that you'll easily mess up the volume of individual channels, and i don't plan on implementing another mode for people that want proper control.

There will be a simple preset-based thing (like now), and a full custom matrix (like ffdshow). With the full matrix you get full control over channel mixing and volume. And thats it.
Since you already use MPC-HC, you can as well keep using that mixer, if you prefer it. Can't implement every kind of mixing control for everyone. One simple layout, and one advanced layout, thats it.

aufkrawall
30th June 2012, 13:02
Nothing like that is planned, no.
Mostly because simple normalization just plainly sucks. One loud noise in your movie, and suddenly everything is quiet, its just impossible to get a consistent experience with stuff like that.
Hm, I think just ticking "Normalize" in ffdshow (and MPC HC audio switcher), without ticking "Regain volume" just makes everything louder by the same factor, a simple volume gain.

I need it because I got sucky audio hardware which tends to be noisy and if I set the output volume too loud in Windows Audio Mixer, it overdrives. :o
But not with normalize/replay gain etc.

DragonQ
30th June 2012, 13:41
Yes but that creates pumping. I haven't played with the settings in a while but IIRC, Normalize will boost the volume by whatever you say and whenever this would create clipping, it'll reduce the amount of boost to compensate. This makes the audio level suddenly drop after a loud noise, i.e. pumping. If you use Regain Volume, dynamic range compression is applied instead of simply boosting the level uniformly so you get less dynamic range but less/no pumping.

cyberbeing
30th June 2012, 14:19
One simple layout, and one advanced layout, thats it.

Could you add a check-box for something like 'loud downmix' to the simple layout, which keeps the volume of each channel closer to 100% (similar to the ffdshow mixer when 'normalize matrix' is disabled).

The current 5.1->2.0 output volume is too quiet for low-power computer speakers. The ffdshow mixer (normalize matrix disabled) and the Windows default mixer's 5.1->2.0 volume level is much more comfortable.


DirectVobSub will always load when you set it as preferred, not only when there are subtitles.

That's usually why you'd set 'DirectVobSub (Auto-loading version)' to preferred instead of plain 'DirectVobSub'. The Auto-loading version only loads into the final graph when there are subtitles.

But with the native mode, VSFilter cannot be loaded. Is this a bug, nev? I think lav should fall back to sw and then VSFilter can be loaded when playing back a file with embedded subtitle.

With xy-VSFilter (http://code.google.com/p/xy-vsfilter/), LAV Video already does automatically fall-back to from DXVA2(Native)->Software when 'DirectVobSub (Auto-loading version)' is set to prefer, and the video contains subtitles.

VSFilter 2.41 is buggy and slow. There is no reason to use it over the much faster and more functional xy-VSFilter at this point.

STaRGaZeR
30th June 2012, 14:26
STaRGaZeR, I pulled this from an all in one system @ work, I hope it fixes your problem.

http://www.mediafire.com/?qs93d4dgm11j4jb

Thanks mate! Unfortunately it didn't work as expected, stupid CCC. Reinstalling now.

DragonQ
30th June 2012, 15:17
The current 5.1->2.0 output volume is too quiet for low-power computer speakers. The ffdshow mixer (normalize matrix disabled) and the Windows default mixer's 5.1->2.0 volume level is much more comfortable.
But that's only because most channels aren't fully utilised in terms of amplitude/volume. It makes more sense to use a normalised downmix matrix and then apply dynamic range compression, or simple normalisation as outlined above. Making the matrix un-normalised will just result in clipping for loud parts of most audio tracks.

nevcairiel
30th June 2012, 15:19
Could you add a check-box for something like 'loud downmix' to the simple layout, which keeps the volume of each channel closer to 100% (similar to the ffdshow mixer when 'normalize matrix' is disabled).

I can also add an option to disable matrix normalization, but this risks clipping, so i am hesistant to add such things.
Adding two full channels on top of each other without normalizing their mixing coefficients just has a very high risk of overflowing.

Its the same problem as a digital volume increase, there is always the risk of adding clipping, which will just sound bad.

You can use ReClock and use its sound compressor for such situations to apply DRC for weak/cheap speakers.

cyberbeing
30th June 2012, 16:50
With 5.1->2.0 on low-powered computer speakers, I prefer stable loud/full sound which sometimes clips, compared to DRC or Automatic Normalization. Personal preference when stuck with crappy stereo speakers. I don't always have access to my high-powered 5.1 setup.

DRC or Normilization applied before downmixing makes things too quiet. Normilization applied after downmixing makes things louder than an un-normalized downmix matrix if not set properly, and then you potentially experience large down/up volume shifts during/after extremely loud scenes if using normalization which regains volume, else you risk everything becoming too quiet.

You can use ReClock and use its sound compressor for such situations to apply DRC for weak/cheap speakers.

I get worse clipping LAV Audio 5.1->2.0 with the ReClock sound compressor (sets gain in the x4-x5 range even when set to Light), then I do with a quieter un-normalized downmix matrix.

I think non-default check-box for a loud downmix would be useful. When you add an advanced mixing panel, users could always fine-tune the downmix to find some middle ground between the two settings.

Would it be possible to have something like an un-normalized downmix matrix which is then automatically normalized to 100% based on final output volume levels to avoid clipping? Practically speaking, it would seem to make more sense to mix channels at full volume and then normalize downwards to avoid clipping, then it would to mix at greatly reduced volume and then proceeding to apply gain which may have the undesired effect of exceeding the volume levels of the original audio.

nevcairiel
30th June 2012, 17:26
Would it be possible to have something like an un-normalized downmix matrix which is then automatically normalized to 100% based on final output volume levels to avoid clipping?

And, what exactly is the final output volume level?
In the first minute of the movie, it may be X, in the second its Y, and the third its Z. Didn't you want a stable sound?

This is exactly what every normalizer does, just look for the loudest sound, and scale all audio so that that loudest sound is at 100%.
With regain volume, that maximum it detected is slowly scaled down again, so that one big bang won't keep the volume down for ever.

The problem here is that i cannot look into the future. I have the audio which i'm mixing here and now, not more.
Because of this, its impossible to produce a consistent/stable normalizer, or any other solutions that increase the volume without risking clipping.

The best solution for cheap speakers is dynamic range compression, which is something i'm not planning to implement beyond what the ffmpeg decoders already support.
I could implement cheap normalization (even with regain volume) if enough people would find that useful, but it has serious drawbacks.

I will however not add a downmixing mode where i know that it'll clip on most files, because clipping is just ugly, and i'll be the one who has to explain to everyone that the clipping they heard when using that option was no bug.
When there is full matrix control later, you can do whatever to shoot yourself into the foot. ;)

PS:
All mixing is done in float, so the difference between normalized or untouched matrix is just the value scale. No data is lost. If you want to apply normalization afterwards, its practically irrelevant if you used a normalized matrix or not.

cyberbeing
30th June 2012, 18:27
And, what exactly is the final output volume level?
In the first minute of the movie, it may be X, in the second its Y, and the third its Z.

The final volume level would be unclipped output from a downmix which potentially exceeds 1.0

The main reason I dislike normalization is because it applies a positive gain to increase the volume beyond that of the source channel levels, which can lead to distortion at high gain. The opposite of only applying a negative gain, doesn't seem so bad. I'm unable to test this in practice though, since the FFDShow Mixer seems to automatically clip the audio, even if you move Volume to process normalization afterwards.

Didn't you want a stable sound?

Yes, which is why I was asking for a simple un-normalized downmix option. A lot of Blu-ray movies seem to have such wide dynamic range that they rarely clip or reach peaks, even when downmixed with an un-normalized matrix. FFDShow and Reclock try to normalize to 400-500% on a LAV Audio 5.1->2.0 downmix and not dropping below 250% gain on the most extreme loud scenes. That should give you an idea of how horribly quiet it is using normalized matrix without additional normalization gain.

I'll await the advanced matrix configuration.

nevcairiel
30th June 2012, 18:35
The final volume level would be unclipped output from a downmix which potentially exceeds 1.0

So you only want clipping protection by lowering the volume if required, but never increasing it over what it originally was?
Or just want me to cut off such peaks so that you end up with clipping noise?

Honestly, that doesn't make all that much sense to me. The volume is controlled by so many factors, one of which being the strength of the speakers, how do you know what volume you were supposed to listen to that movie anyway?

Anyway, even if that feature existed, you might still end up with a sudden volume change mid-movie, unless i mis-understood that feature.

DragonQ
30th June 2012, 18:56
Also, how would you do that without reading the entire audio stream?

cyberbeing
30th June 2012, 19:05
So you only want clipping protection by lowering the volume if required, but never increasing it over what it originally was?
Yes, basically just clipping protection which reduces the audio level to 1.0, only when 1.0 is exceeded in the downmix.

The volume is controlled by so many factors, one of which being the strength of the speakers, how do you know what volume you were supposed to listen to that movie anyway?

Perceived volume is an entirely different factor. I'm only considering no positive gain in the downmix which exceeds the digital audio level of each channel prior to downmix, and before output to speakers.

Anyway, even if that feature existed, you might still end up with a sudden volume change mid-movie, unless i mis-understood that feature.

Indeed it's a trade-off between risk of clipping VS. risk of sudden volume change.

No solution is perfect when done in real-time at playback. If a multi-channel track was mastered as a loudness war with minimal dynamic range, this method would be near useless.

Also, how would you do that without reading the entire audio stream?
It would work in the same way as a normalization filter, but in reverse, capped at a gain of 1.0

nevcairiel
30th June 2012, 19:06
Yes, basically just clipping protection which reduces the audio level to 1.0, only when 1.0 is exceeded in the downmix

I guess it may be simple enough to support. Disabling normalization for the matrix is just a flag to toggle, and adding a step to analyze the audio and apply a scale factor if required is rather trivial.
I'll try it out, see what happens.

clsid
30th June 2012, 21:21
The current 5.1->2.0 output volume is too quiet for low-power computer speakers. The ffdshow mixer (normalize matrix disabled) and the Windows default mixer's 5.1->2.0 volume level is much more comfortable.If I remember correctly, ffdshow uses a +3dB gain for center channel when downmixing 5.1 to 2.0. Other mixers might do something similar.

I could implement cheap normalization (even with regain volume) if enough people would find that useful, but it has serious drawbacks.
Please do ;) One less reason to use ffdshow.

e-t172
30th June 2012, 22:35
If I remember correctly, ffdshow uses a +3dB gain for center channel when downmixing 5.1 to 2.0. Other mixers might do something similar.

That's the right way to do it, actually, because when you use two sound sources instead of one for the same input signal, you get +3dB SPL, not +6dB SPL as one would expect. That's because when dealing with the digital sample value, x2 translates to x2 voltage, which translates to x2 sound pressure level (+6dB), whereas adding a second source translates to x2 sound power level, which translates to x(sqrt(2)) sound pressure level (+3dB).

In the end, that means the correct way to mix a center channel (one sound source) into stereo (two sound sources) so that the sound pressure level remains the same is to send the center channel signal to both channels with a -3dB (x(1/sqrt(2)) attenuation, not -6dB (x0.5). This is quite counter-intuitive, so don't fall into the trap. ffdshow got this right (as seen by the 0.707 factor in the mixer matrix).

Also, when downmixing 5.1 to stereo, I'm not sure applying an attenuation factor on the whole output because of clipping paranoia is such a good idea. AFAIK, according to Dolby guidelines, the content producer is supposed to check clipping doesn't happen even when the 5.1 track is downmixed to stereo, which makes sense because such downmixing is fully supported in Dolby specs. Attenuating after downmixing would cause some issues, like really low levels (most movies' average levels are already so low that most consumer equipment have barely enough gain for it to be comfortable, so don't make it worse) and high level differences between stereo and 5.1 content.