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

dukey
19th February 2013, 12:24
You can't dynamically switch between DXVA and Software, or the other way around. You need a full reconnect to do this.

I see, that makes sense I suppose. So what is required, stopping the graph, breaking the pins and reconnecting them ?

dukey
19th February 2013, 23:26
In graph edit. I tried stopping the graph, breaking all the connections, and reconnecting the pins, but it refuses to use DXVA. The only way seems to be to remove the decoder, then render the pin (which brings back LAV) and it works.

THX-UltraII
20th February 2013, 09:22
Someone knows what the av sync option in the audio filter does?

paradoxical
20th February 2013, 16:35
Yes (http://forum.doom9.org/showpost.php?p=1529046&postcount=5751).

Mercury_22
21st February 2013, 11:32
@Nev I just saw that XBMC claims to support "DTS-HD MA" now (http://wiki.xbmc.org/index.php?title=AudioEngine#Features) (ffmpeg AFAIK) does this mean that LAV will do too (without the DLL :)) ?

nevcairiel
21st February 2013, 11:34
The only thing they finally support is bitstreaming, years too late.

Vasilich
21st February 2013, 11:51
nev, is that technically possible to "bitstream" AC3 core in case of EAC3 audio?
i have an old AV receiver connected to my HTPC via optical SPDIF. Receiver supports only AC3, so if i want to watch TV with AC3+ (e.g. Servus TV HD) i get only stereo, because SPDIF is capable to transfer AC3-encoded 5.1, and for EAC3 LAV decodes it completely, and SPDIF gets only stereo PCM

nevcairiel
21st February 2013, 11:52
EAC3 has no "AC3 core", so its not possible.

madshi
21st February 2013, 12:00
Blu-Ray E-AC3 primary audio tracks do have an AC3 core. Blu-Ray E-AC3 secondary audio tracks do not, nor do HD DVD E-AC3 primary tracks.

nevcairiel
21st February 2013, 12:02
He inquired about broadcast TV primarily :)
Primary Blu-ray EAC3 tracks are in a rather special position there, and can't be compared with anything else.

Vasilich
21st February 2013, 12:07
So for me the only chance is to disable support in LAV and use FFDShow with enabled AC3 encoder for those formats that do not pass in SPDIF bandwidht and can't be understood by my receiver.
Thanks for explanation!

madshi
21st February 2013, 12:11
He inquired about broadcast TV primarily :)
Oh, right. Sorry, seems I flew over the question text too fast...

Niyawa
21st February 2013, 20:16
Hey nev, a user of my guide asked the following question: "What's the reason for AYUV being disabled in the LAV video decoder?" I'm not really sure myself so I'm asking you that directly.

I did a search before in the forum and around the net but never found any details.

JEEB
21st February 2013, 20:42
Hey nev, a user of my guide asked the following question: "What's the reason for AYUV being disabled in the LAV video decoder?" I'm not really sure myself so I'm asking you that directly.
MS renderers such as EVR were meant to take in AYUV for the separate subtitle pin. At least, that was their meaning, and the YCbCr->sRGB conversion path is far from optimized for this format.

But then it was found out that the renderer(s) accept AYUV with the main pin as well, and... that leads to the fact that converting to RGB in the decoder and then rendering that is much more faster than trying to play 4:4:4 YCbCr content by saying that an AYUV connection is available. In other words, feeding AYUV to the MS renderers as the main pin's content pretty much means a slideshow. Also, EVR-CP (MPC-HC's customized EVR renderer, also their default), if I recall correctly, is not capable of switching types on the fly, so I guess it was just found out to be simpler to just block it altogether unless the user specifically wants 8bit 4:4:4 YCbCr output.

Niyawa
21st February 2013, 21:23
MS renderers such as EVR were meant to take in AYUV for the separate subtitle pin. At least, that was their meaning, and the YCbCr->sRGB conversion path is far from optimized for this format.

But then it was found out that the renderer(s) accept AYUV with the main pin as well, and... that leads to the fact that converting to RGB in the decoder and then rendering that is much more faster than trying to play 4:4:4 YCbCr content by saying that an AYUV connection is available. In other words, feeding AYUV to the MS renderers as the main pin's content pretty much means a slideshow. Also, EVR-CP (MPC-HC's customized EVR renderer, also their default), if I recall correctly, is not capable of switching types on the fly, so I guess it was just found out to be simpler to just block it altogether unless the user specifically wants 8bit 4:4:4 YCbCr output.
Thank you very much for the answer. I probably would never realized such thing myself.

aufkrawall
21st February 2013, 21:51
EVR doesn't render AYUV correctly, brightness is slightly wrong.

cyberbeing
21st February 2013, 22:11
At the moment, using xy-VSFilter with madVR would be the primary reason to enable AYUV in LAV Video.

Note: Adding YV24 support to xy-VSFilter is something on our to-do list. AYUV was just an easier first target since it was already supported internally.

nevcairiel
21st February 2013, 23:03
As it was already explained, EVR/hardware support for AYUV is just so bad that it was better to disable it. madVR also accepts YV24, so no reason to active it for madVR alone.

dansrfe
22nd February 2013, 20:19
What are the recommended mix levels for 5.1 audio output? Also, if the number of source channels matches the output channels then no mixing occurs correct?


I wish there was a table listing all the recommended mix levels for all output speaker configurations.

paradoxical
22nd February 2013, 20:21
I'm pretty sure no mixing occurs.

e-t172
22nd February 2013, 20:47
What are the recommended mix levels for 5.1 audio output?

Again, the authoritative, official, recognized source for downmix coefficients is Rec. ITU-R BS.775 (http://www.itu.int/rec/R-REC-BS.775-3-201208-I/). See table 2 at page 11.

Regarding LFE: it is recommended to discard LFE (i.e. zero coefficient), unless you're sure your system is capable of handling high-level low frequency signals (i.e. you have an expensive subwoofer). If you do want to downmix LFE, the correct coefficient is (assuming stereo output) 1.58 (+10dB standard LFE boost -6dB because of additive bass output from the two stereo speakers or from remixing in bass management = +4dB = 1.58).

nevcairiel
22nd February 2013, 20:49
The LAV default settings are fine (with no LFE). It should exactly match the ITU recommendation for a 5.1 -> Stereo downmix.
Adjust to personal preference.

dansrfe
22nd February 2013, 23:44
My output is to 5.1, not to stereo.

Pomegranate
22nd February 2013, 23:59
The LAV default settings are fine (with no LFE). It should exactly match the ITU recommendation for a 5.1 -> Stereo downmix.
Adjust to personal preference.

What if one wants to do 7.1 to stereo?

E.g. watching the Avengers BD with headphones.

nevcairiel
23rd February 2013, 09:04
Its still fine for 7.1 -> Stereo or 7.1 -> 5.1, its just another set of surround channels to mix.

Mangix
23rd February 2013, 10:03
I found an annoying bug with CUVID on my system. It's giving me artifacting. I can't replicate with DXVA2(native/copy-back) or with the software decoder. Here are screenshots as well as the sample.

https://dl.dropbox.com/u/102011983/LAV%20Bugs/weird%20spots.png
https://dl.dropbox.com/u/102011983/LAV%20Bugs/no%20spots.png

https://dl.dropbox.com/u/102011983/LAV%20Bugs/vmr9-test.avi

I have nothing special enabled in the nvidia control panel. Then again if I did, it should also show up in the second picture which was done with copy-back mode.

This is with the latest 314.07 drivers.

nevcairiel
23rd February 2013, 10:31
This clip is MPEG-4 ASP, DXVA2 in LAV does not support this format, CUVID is the only HW implementation which supports it at this time, so its very well possible that the hw decoder is not perfect. MPEG-4 ASP is also disabled by default for HW decoding because it is known to have some issues.
I suggest to turn it off again. :p

6233638
23rd February 2013, 17:22
I have a question: when downmixing surround to stereo, there is a large decrease in volume with normalization enabled - as you would expect. This has me turning up the volume to roughly 25/100 when listening to 5.1 for example, and even louder with 7.1
But if I then play a stereo file, I have to reduce volume to about 10/100 for roughly the same level through my headphones.

Would it be possible to have an option where LAV applies the same gain to stereo files that it does when downmixing, to keep volume the same when playing videos no matter how many channels they have?
It can be very jarring if you watch a DVD right to the very end and it goes back to the menus which are playing stereo audio at a significantly louder volume for example.

nevcairiel
23rd February 2013, 17:32
I do not have any plans for this. Use downmixing without normalization for a more consistent volume, on most material it won't even have to adjust the volume to avoid clipping because the used dynamic range is very limited in the first place.

LAV is still first and foremost a decoder, and i only added the mixing because it was a low-hanging fruit and solves a few basic playback problems, but i do intend to keep it simple.

6233638
23rd February 2013, 17:42
I do not have any plans for this. Use downmixing without normalization for a more consistent volume, on most material it won't even have to adjust the volume to avoid clipping because the used dynamic range is very limited in the first place.

LAV is still first and foremost a decoder, and i only added the mixing because it was a low-hanging fruit and solves a few basic playback problems, but i do intend to keep it simple.

I would rather use Normalization because it guarantees that you aren't going to either have clipping, or dynamic volume adjustments, as I have plenty of dynamic range to spare on my system.

It seemed like this would be a relatively simple adjustment (reduce the gain of 5.1 and stereo tracks to match downmixed 7.1) and could be tied into the existing "Don't mix stereo sources" option when the output speaker configuration is set to stereo, as the option doesn't do anything right now.

Normalizing volume across all videos provides a much better user experience for anyone listening to headphones or stereo speakers.

nevcairiel
23rd February 2013, 18:19
The problem with all these "simple" adjustments is that there is hundreds of different approaches, and everyone wants another one, so i rather keep it as simple as makes sense to me, focusing on decoding, and not processing.

Many people listening with headphones or stereo systems also have rather weak systems, where the low volume of the normalized matrix is a problem, so i see this as a rather limited use-case.
Would i use the worst-case, and adjust everything to a 7.1 mixing level? Thats quite the extensive volume reduction, especially if you enable LFE at any decent level.

Commercial content can in most cases just be downmixed from 5.1 to stereo without causing clipping, so its somewhat unlikely to even get clipping or a mid-stream volume change, so thats what i'm going to keep suggesting.
I can also look into extracing the embeded stereo downmix from AC3 and TrueHD, which for those codecs should at least remove any concerns about how its mixed. Sadly DTS doesn't seem to have anything comparable.

6233638
23rd February 2013, 19:48
The problem with all these "simple" adjustments is that there is hundreds of different approaches, and everyone wants another one, so i rather keep it as simple as makes sense to me, focusing on decoding, and not processing.That's understandable, it just seemed like it would be a small adjustment to the downmixing options.

Many people listening with headphones or stereo systems also have rather weak systems, where the low volume of the normalized matrix is a problem, so i see this as a rather limited use-case.
Would i use the worst-case, and adjust everything to a 7.1 mixing level? Thats quite the extensive volume reduction, especially if you enable LFE at any decent level.Well that's how I would do it, as that would give you a consistent volume level whether the content is 2.0/5.1/7.1 and I would either integrate it with the "Don't mix stereo sources" option, or add a "Normalize volume level" option below "Normalize matrix" because if you are also reducing the volume of 5.1 as well as 2.0, technically the "Don't mix stereo sources" option would not apply.

If I'm measuring this correctly, with my current downmix of 0.71/0.71/2.24, volume is being attenuated by 14.6dB when downmixing a 7.1 signal to stereo.

That's less than 3-bits you're losing, so if you are outputting 24-bit, you should be fine. (16-bit to 13-bit might be problematic)

Commercial content can in most cases just be downmixed from 5.1 to stereo without causing clipping, so its somewhat unlikely to even get clipping or a mid-stream volume change, so thats what i'm going to keep suggesting.It's probably wise to not reduce dynamic range so much with the standard option, but I really can't stand dynamic volume adjustments, so I would rather guarantee that won't happen, than assume it probably won't.

I can also look into extracing the embeded stereo downmix from AC3 and TrueHD, which for those codecs should at least remove any concerns about how its mixed. Sadly DTS doesn't seem to have anything comparable.This would actually be a nice option to have. That said, most stereo downmixing assumes that you are going to play on a low-end system (e.g. TV speakers or a cheap hifi wired up to the TV) and discards the LFE channel as a result.

As I have a higher-end headphone setup that I primarily use, I prefer to keep LFE in the mix.

I could be mistaken, but I believe the embedded downmix only specifies the level of the surround channels, as they may have designed the mix around 0.5 or 1.0 rather than 0.71, so perhaps it could be integrated to only adjust the surround level, rather than set the entire mix? (so you can have the correct surround level and incorporate LFE)

supercoolman
23rd February 2013, 20:40
Is it possible to always show subtitle selection in splitter menu even if there is only one subtitle in the container (MKV/MP4...etc) available? I believe audio and video stream selection are always shown even if there is only one for each.

nevcairiel
23rd February 2013, 20:44
The selection is always shown, even if there is only one sub. In fact, there can never be only one sub, either there is zero, or there is one real sub stream, and the virtual "no subtitles" stream.

Reino
23rd February 2013, 21:57
Although I have a 2.1 speaker setup myself, by accident I noticed something odd when LAV Audio Decoder processes multichannel lossy audio formats (ac3,dts,ogg,opus, etc). With default settings, all channels are sort of downmixed to stereo, with the surround left and right channels almost inaudible. Normally I still use FFDShow for movie soundtracks, which doesn't have this issue. I quickly noticed, with all integer output formats enabled, by default LAV Audio Decoder converts the input (32-bit float) to 24-bit int, whereas FFDShow converts it to 16-bit int. Why 24-bit int?
If I only enable 16-bit int in LAV Audio Decoder, all is fine.

Playing a multichannel lossy audio format with LAV Audio Decoder through Avisynth (DirectShowSource) results in FFDShow Audio Processor being added to the graph for a PCM 24-bit int to PCM 16-bit int conversion. If I disable the FFDShow Audio Processor, I can't even play the audio file (through Avisynth).
Is this a sign my soundcard (rather soundchip nowadays) doesn't support 24-bit output? But if so, why then do all stereo lossy audio formats (also 32-bit float to 24-bit int) play fine here?
Does anyone have an answer to this?

Btw, why does LAV Audio Decoder process all lossy audio formats in 32-bit float, while all lossless audio formats are processed in 16-bit int? Or is this ffmpeg/libavcodec by design?

nevcairiel
23rd February 2013, 22:07
I quickly noticed, with all integer output formats enabled, by default LAV Audio Decoder converts the input (32-bit float) to 24-bit int, whereas FFDShow converts it to 16-bit int. Why 24-bit int?
24-bit is preferred over 16-bit when converting from 32-bit float, because it can hold the 32-bit float precision better (32-bit float is about 24-bits mantissa + the exponent)


Playing a multichannel lossy audio format with LAV Audio Decoder through Avisynth (DirectShowSource) results in FFDShow Audio Processor being added to the graph for a PCM 24-bit int to PCM 16-bit int conversion. If I disable the FFDShow Audio Processor, I can't even play the audio file (through Avisynth).

Its certainly possibly that AviSynth doesn't accept 24-bit audio, i've personally no experience with AviSynth for audio processing.
However, LAV always offers a 16-bit fallback for all formats, but i don't know how smart the AviSynth graph building is, maybe it just doesn't notice that its available as a second media type from the audio decoder.


Is this a sign my soundcard (rather soundchip nowadays) doesn't support 24-bit output? But if so, why then do all stereo lossy audio formats (also 32-bit float to 24-bit int) play fine here?

If you are on XP, then your audio driver is responsible for downmixing, and as such its very likely that it just doesn't do 24-bit downmixing well, which explains your troubles. Since I've never heard of such oddities on Vista/7, i'm assuming that you in fact are on XP.


Btw, why does LAV Audio Decoder process all lossy audio formats in 32-bit float, while all lossless audio formats are processed in 16-bit int? Or is this ffmpeg/libavcodec by design?

Nearly all lossy decoders decode natively to 32-bit float. Lossy formats don't have a "bitdepth" as such, and outout floating point values.
Lossless decoders on the other hand do have a bitdepth, and LAV will output it as appropriate. If it outputs 16-bit, then thats what was encoded in the lossless file. There are 24-bit files as well, and some formats even support 32-bit integer, however thats very rare in the real world.

LAV is by default setup to output untouched audio if possible. On XP 32-bit float output is however disabled by default, because a lot of XP audio drivers have serious issues with float audio.

Reino
24th February 2013, 00:18
You're right, I'm still on WinXP. In fact I'm still using an AMD Athlon XP 3200+ with an ATI Radeon HD 3850 AGP http://www.hydrogenaudio.org/forums/style_emoticons/default/lalala.gif.
However, the strange thing is that, although 24-bit for LAV and FFDShow is problematic, 32-bit int is not. I guess, especially for that time, the Nvidia SoundStorm (APU) really was top of the notch.

Mangix
24th February 2013, 04:14
This clip is MPEG-4 ASP, DXVA2 in LAV does not support this format, CUVID is the only HW implementation which supports it at this time, so its very well possible that the hw decoder is not perfect. MPEG-4 ASP is also disabled by default for HW decoding because it is known to have some issues.
I suggest to turn it off again. :p

Can't believe I missed that. Thanks.

supercoolman
24th February 2013, 07:25
I can't find the subtitle selection in LAV Splitter menu when there is no subtitle in the container. screenshot attached

nevcairiel
24th February 2013, 07:37
If there is no subtitles, there is no selection. What would there be to select?

supercoolman
24th February 2013, 09:42
Is it possible to always show subtitle selection in splitter menu even if there is only one subtitle in the container (MKV/MP4...etc) available? I believe audio and video stream selection are always shown even if there is only one for each.

I just realized I was a bit confused between subtitle in container and outside of container because I was comparing subtitle handling to audio/video stream handling.

audio
if I have one container with only video and two audio files outside of container, there will be three instances of LAV splitter during playback. However, none of the LAV splitter instances allow me to disable its audio stream. I wish there is a way to disable stream without rename/move files or remux stream into container.


subtitle
I have been loading subtitles outside of container and LAV splitter had never had anything for subtitle, so I thought LAV doesn't deal with subtitle selection at all. recently, I had been debugging issue where I can't see any subtitle other than the default one when I mux multiple subtitles into one container, then I found out that the subtitle selections are handled by LAV splitter when subtitles are muxed into container with the option to disable subtitle.

nevcairiel
24th February 2013, 09:51
Turning off audio doesn't make much sense, so there is no option for this.
Handling external audio files is something your player does, and the player should have options to select which track is being played. MPC-HC for example has its own Audio Switcher which can switch between internal and external audio, so only one is played.

supercoolman
24th February 2013, 11:02
Turning off audio doesn't make much sense, so there is no option for this.
Handling external audio files is something your player does, and the player should have options to select which track is being played. MPC-HC for example has its own Audio Switcher which can switch between internal and external audio, so only one is played.

I saw one of the online tutorial for setting up MPC-HC with LAV said user should disable MPC-HC internal audio switcher and let LAV splitter handle it. I was mislead by this tutorial?

Shark007
24th February 2013, 16:17
I'd like to report an anomoly I recently discovered. From the moment you select the LAV splitter to split wtv files and then try to go back to native splitting, WMP can no longer open wtv files as it did before selecting and deselecting the LAV splitter. Nothing I have tried has been able to get WMP to open wtv files after unregistering the LAV splitter. The files will open using native splitters/decoders in a player such as MPC-HC Lite but WMP will no longer open them at all. I have tested this on several machines and on a clean install of Windows 7 with only Windows and driver updates installed.

nevcairiel
24th February 2013, 16:21
If you enable WTV support in the installer, it'll set itself as the source filter for that extension. If you then uninstall it again, it'll remove that mapping, but not restore whatever values was in there before (i'm not sure there even is a default mapping, however)
If you just unregister it, and not uninstall it, it'll break, because it doesn't find the source filter it wants.

Shark007
24th February 2013, 16:31
I didnt use the installer. All I did was register the LAV splitter, call up its interface, set the tray icon so I can see the splitter at work and set it to split wtv files. you should do some testing yourself. After getting LAV to split wtv files (test with WMP), try to get WMP to play a wtv file without using LAV splitter.

nevcairiel
24th February 2013, 16:33
Just registering it does nothing to any format specific thing in the registry, either you're manually doing something in the registry, or WMP is just stupid. Since simply registering it wouldn't get WMP to use it, so you must be doing something yourself.

Shark007
24th February 2013, 16:40
The fact remains, once LAV splits a wtv file, WMP can no longer open a wtv file without using LAV. I guess that means the player is just stupid and there is no fix. I tested this on a clean system and only did as stated in post #14273 and nothing else.

Shark007
24th February 2013, 19:35
OK, it is possible that the method I used to call up the splitters interface was part of my problem in discovering a solution.
I used clsid's codec tweak tool.
After avoiding that tool, I was able to trace a solution to the registry's \Media Type

glorp
24th February 2013, 19:42
The fact remains, once LAV splits a wtv file, WMP can no longer open a wtv file without using LAV. I guess that means the player is just stupid and there is no fix. I tested this on a clean system and only did as stated in post #14273 and nothing else.

I realize you two know infinitely more than I do about it but I'm pretty sure I've been able to swap wtv splitters in WMC for recorded tv by using "Codec Tweak Tool" on several x64 systems. The Preferred splitters selections of that allow you to toggle back and forth between LAV and system merit. I know I've used it to switch between LAV splitter and the MS StreamBufferSource thingy multiple times.