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 509 510 511

nevcairiel
2nd June 2018, 16:31
I've been working on improving TrueHD bitstreaming, and posted a test version on GitHub:

https://github.com/Nevcairiel/LAVFilters/issues/208

If you've been encountering issues with TrueHD bitstreaming, primarily drop-outs on high bitrate TrueHD+Atmos streams from UHD Blu-rays, give this version a try and leave feedback on GitHub.

jmone
3rd June 2018, 02:45
Changes look good and seemed to have solved the high bit rate dropouts - FYI, the changes are also in the latest LAV Nightlies - https://files.1f0.de/lavf/nightly/

fireattack
3rd June 2018, 12:42
Hi everyone, I have a small question about decoding video that is hybrid (film and NTSC interlaced).
The video is remuxed using MakeMKV from a DVD. The first part of the video is film, and the second part is NTSC interlaced.

I play the video in MPC-HC (tried other players, some result) and open MadVR OSD to show stats.

It initially shows "deinterlacing off (says upstream)" when playing first film part, and automatically changes to "deinterlacing on (says upstream)" when it enters part 2.
You can even drag the progress bar to part 2 and it will immediately change to "deinterlacing on (says upstream)" as well.

However, the problem is: once it start to show "deinterlacing on (says upstream)", drag the progress bar back to part 1 will NOT change it back to "deinterlacing off (says upstream)".

So, my question is:

1. is it just an OSD problem (even could be MadVR's problem)?
2. If not, will it affect actual playback? Like, it may cause unnecessary deinterlacing downstream on the film (progressive) part.

Thanks.

Orf
3rd June 2018, 14:19
Hi nevcairiel,
I'm experimenting a bit with BDA live source graphs and encounter an issue where LAV Video decoder deadlocks with MS MPEG-2 Demultiplexer. Deadlock only happens when graph is running and when Demux performs a dynamic media type change on LAV Video decoder.

Here's stack trace:
77e0ef34 +044 ntdll.dll RtlEnterCriticalSection
62d54173 +093 LAVVideo.ax dshowutil.cpp 393 +16 FindPinIntefaceInGraph
62cd9378 +118 LAVVideo.ax lavvideo.cpp 629 +31 CLAVVideo.CreateDecoder
62cd9a0f +00f LAVVideo.ax lavvideo.cpp 781 +4 CLAVVideo.SetMediaType
62d571dc +02c LAVVideo.ax decssinputpin.cpp 381 +2 CDeCSSTransformInputPin.SetMediaType
62cdbd07 +117 LAVVideo.ax lavvideo.cpp 1461 +16 CLAVVideo.Receive
62d57180 +060 LAVVideo.ax decssinputpin.cpp 375 +2 CDeCSSTransformInputPin.Receive
62d51098 +038 LAVVideo.ax amfilter.cpp 3041 +7 CBaseInputPin.ReceiveMultiple
75258482 +022 KERNEL32.DLL BaseThreadInitThunk

Is there anything I can do to avoid this behavior instead of stopping the entire graph?

nevcairiel
3rd June 2018, 15:35
The interesting question would be what is holding the other side of that lock, that its apparently hanging on?

Manni
3rd June 2018, 15:44
I've been working on improving TrueHD bitstreaming, and posted a test version on GitHub:

https://github.com/Nevcairiel/LAVFilters/issues/208

If you've been encountering issues with TrueHD bitstreaming, primarily drop-outs on high bitrate TrueHD+Atmos streams from UHD Blu-rays, give this version a try and leave feedback on GitHub.

Hi Nev, I posted on Github as well, but it's solved here (testing with GotG Vol2 in Atmos), thanks! 1080Ti to Denon X8500H. Same results with the lastest nightly (42).

Orf
3rd June 2018, 16:11
The interesting question would be what is holding the other side of that lock, that its apparently hanging on?
Ah, sorry not to mention that. "MS MPEG-2 Demultiplexer" does. It's stuck inside the IMPEG2PIDMap::MapPID call. And I suppose that's the place from where it calls Receive on LAV Video decoder input pin

KoD
3rd June 2018, 17:22
@nevcariel

I've been using LAVFilters-0.70.2-83 for a long time now. I just updated to LAVFilters-0.71.0-30, but started noticing right away random audio pops and cracks. They're not loud, but they're there. Very easy to notice on dtshd-ma 24 bit integer 48KHz BluRay soundtracks which decode to 24bit integer 48Khz, but it's there on AC3 that decodes to 32 bit float too. Tried LAVFilters-0.71.0-35, and it's the same. Tried playing on both an external audio receiver (digital optical out), as well as over HDMI, and it's the same. Went back to LAVFilters-0.70.2-83 again and the sound is free of these cracks and pops. I have not tried any intermediate versions.

Later edit: well, I just noticed the cracks are there with LAVFilters-0.70.2-83 too.

Even later edit: yes, they're in LAVFilters-0.70.2-83 too, but not as often than in LAVFilters-0.71.0-35; with the latest version of the filters it's so often it's impossible not to notice it and is very distracting.

Later later edit: forgot to say that the cracks and pops are not there when playing the same m2ts or mkv file with PowerDVD and letting it decode the audio.

nevcairiel
3rd June 2018, 19:03
This sounds more like an issue on how the audio gets output then how it gets decoded, because decoding has been bitexact for several versions, and if there was a fundamental problem across all audio formats, I'm sure someone would've reported it before as well.
Thats something always to keep in mind, decoding is independent of the setup of your system. It gets audio data in and gives you decoded data back. So any fundamental decoding problem would easily manifest for a lot of people.

The output to the hardware however is entirely dependent on the hardware. And your particular issue sounds like using bigger output buffers might help, but thats not something LAV controls - thats the Audio Renderer (a part that would also be different in something like PDVD).

pikaczu
3rd June 2018, 19:05
when new wersion?

LigH
3rd June 2018, 20:17
"When It's Done" ™

pikaczu
3rd June 2018, 20:25
good.

foxyshadis
5th June 2018, 05:09
@nevcariel

I've been using LAVFilters-0.70.2-83 for a long time now. I just updated to LAVFilters-0.71.0-30, but started noticing right away random audio pops and cracks. They're not loud, but they're there. Very easy to notice on dtshd-ma 24 bit integer 48KHz BluRay soundtracks which decode to 24bit integer 48Khz, but it's there on AC3 that decodes to 32 bit float too. Tried LAVFilters-0.71.0-35, and it's the same. Tried playing on both an external audio receiver (digital optical out), as well as over HDMI, and it's the same. Went back to LAVFilters-0.70.2-83 again and the sound is free of these cracks and pops. I have not tried any intermediate versions.

Later edit: well, I just noticed the cracks are there with LAVFilters-0.70.2-83 too.

Even later edit: yes, they're in LAVFilters-0.70.2-83 too, but not as often than in LAVFilters-0.71.0-35; with the latest version of the filters it's so often it's impossible not to notice it and is very distracting.

Later later edit: forgot to say that the cracks and pops are not there when playing the same m2ts or mkv file with PowerDVD and letting it decode the audio.

USB audio? That's the biggest culprit for pops and crackles; Win10 is a huge improvement for USB audio dropouts (as in, I've never had them) compared to Win7. Aside from that, the only thing you can do is keep your audio and video drivers updated, increase audio buffers in applications, and experiment. Unfortunately, MPC-BE is pretty limited in audio options; even BE doesn't give you control over audio buffers. You could try an ASIO driver, which will give you more knobs to twiddle, or ffdshow, with did expose buffer size, iirc. Aside from that, changing applications, as you have, is the only way to go.

gfxnow
7th June 2018, 09:42
Which players use LAV filters as default internal filters? I know kodi dsplayer uses it. I am currently using mpc-hc but would prefer switching to a player that is being actively developed/updated. I don't think mpc-be is using LAV.

ryrynz
7th June 2018, 10:06
It doesn't need to be "using LAV" because you simply disable the internal filters and install LAV filters. You don't need any player to come with LAV for it to be up to date or run perfectly the same as if it came built with LAV.

clsid
7th June 2018, 14:07
As long as MPC-HC does what you need, then there is no reason to switch. And there still are minor updates for it occasionally.

jkauff
7th June 2018, 18:20
Kudos to clsid for building those minor updates. He tries to keep current with stable LAV filters releases, so no reason to shy away from MPC-HC.

gfxnow
7th June 2018, 20:30
Thanks guys, happily installed MPC-HC v1.7.16. Kudos to clsid indeed!

Orf
9th June 2018, 13:06
@nevcariel
I want also to report that despite of what read-me says that it was fixed, LAV video decoder (D3D11 mode only, other modes are not affected) often stops working after media type changes. This is not happens always, occasionally it might work once or several times, but in most cases it didn't. After that point decoder starts sending frames with garbage content to renderer, and any further media type changes didn't work too

Thunderbolt8
10th June 2018, 13:58
I want to get the best possible sound from my internal sound card, using LAV audio and the mpc-hc internal audio render (without the ability to use bitstreaming). Im trying to play a 5.1 96kHz 24-bit TrueHD file using a 2 speaker setup. so I know the playback cant be 100% bit-perfect anyway due to channel mixing, but I want it to be as perfect as it can get aside from that.

in windows settings I ticked the box for allowing apps to take exclusive mode (and also the priority box) and set the default format to 24/96.

in the internal audio renderer of mpc-hc settings device is set to system default, the box for exclusive mode is ticked as well as the "ignore system channel mixer" box.

in LAV audio decoder settings, I enabled mixing with output configuration set to stereo, changed LFE mix level to 0 (dont want heavy bass in the night) and also ticked the box for clipping protection. status box says TrueHD --> PCM; 6 channels --> 2 channels; 24-bit integer --> 32-bit float.

now, when I play back the file, the internal audio renderer status tab says format: float --> PCM-24 (padded) and Processors: limiter.

when I untick the boxes 32-bit integer and 32-bit float in LAV, then LAV status says 24-bit int --> 24-bit int and internal audio renderer status PCM-24 --> PCM-24 (padded) and processors: -

so Im wondering whether keeping the 32-bit boxes in LAV ticked gives me the better/more original sound presentation or unticking the boxes. the input format is only 24-bit and not 32-bit. does channel changing from 6 --> 2 need some float headroom/dithering for sound quality? in LAV audio it says "enabling all formats will allow untouched/bitexact output" and "the best format is used automatically". what does "best" here mean? best quality? most fitting/suitable format?

lvqcl
10th June 2018, 14:20
It doesn't matter IMHO.

Asmodian
10th June 2018, 17:07
does channel changing from 6 --> 2 need some float headroom/dithering for sound quality? in LAV audio it says "enabling all formats will allow untouched/bitexact output" and "the best format is used automatically". what does "best" here mean? best quality? most fitting/suitable format?

Yes, channel muxing from 6 -> 2 generates 32-bit float. Do not disable any formats in LAV, it will pick the optimal format for quality.

KoD
10th June 2018, 18:36
@nevcariel, @foxyshadis

I am using Win10, indeed. It's build 1703 (so, April last year I guess) with all updates until now, as I have the Pro version and can delay feature updates, and there were quite a few people complaining about issues with the nvidia drivers in 1709. 1803 also seems to be having teething problems, so I'm not eager to update to it either.

I am playing audio using either:
- motherboard optical out (external DAC + amplifier)
- or via HDMI (on the TV audio speakers)

I either case:
- having LAVaudio decode audio: random (but quite seldom) pops and clicks;
- using PowerDVD to play: no audio issue;
- using the Microsoft audio decoder (even for AC3 audio): no audio issue.

Once upon a time, the Cyberlink PowerDVD decoders were also available as DirectShow filters and could be used by players like MPC-HC, but this does not seem to be the case anymore, neither as 32bit nor as 64bit filters, so I can't use them in 3rd party media players to test this scenario as well.

I've switched between several video drivers (nvidia), and audio (realtek), and there was no difference.
I'm playing using either MPC-HC (with internal filters disabled), or ZoomPlayer. Tried all audio options: DirectSound wrapper around the audio device, or directly the audio device (I guess WaveOut ?). It makes no difference.

Regardind the pops and clicks I'm having when using LAVaudio decode audio, if I rewind back and play the same fragment again, the pop does not happen again. I guess it's either an issue of some errors that accumulate in time and then you get the click, or maybe some sync issue where lav filters try to keep the video and audio in sync and this happens? I don't experience audio and video getting out of sync in time, though. I toggled the "Auto A/V Sync correction" on and off in the Lav audio filter configuration, but it did not have any effect. The pop/click resembles what one would get when "normalize matrix" is enabled in the Mixer, but I don't have the Mixer enabled in LAV audio, so it's not that. And with it enabled to mix audio to stereo, I still got the pops and clicks.

These issues did not happen in the past, but I could not say when they started. There was quite a long stretch of time where my HTPC was left unused due to lack of time.
At this point, I don't know what else it could be. Since out of three audio decoders, it only happens with LAV audio, my guess was that LAV audio must have something to do with it.

Unfortunately, for some audio formats there is no option other than LAV audio, so using something else is not possible.

e-t172
10th June 2018, 20:44
I want to get the best possible sound from my internal sound card, using LAV audio and the mpc-hc internal audio render (without the ability to use bitstreaming). Im trying to play a 5.1 96kHz 24-bit TrueHD file using a 2 speaker setup. so I know the playback cant be 100% bit-perfect anyway due to channel mixing, but I want it to be as perfect as it can get aside from that.

You would be better off spending your time on other things. There is no evidence whatsoever that a "perfect" "bit-perfect" audio pipeline will make any kind of audible difference compared to a normal audio pipeline using default options. It will be more trouble than it's worth. If it does make a difference, it just means that your audio system is broken.

(Also, trying to build a "perfect" pipeline while downmixing to stereo and setting LFE to zero is a bit nonsensical.)

Thunderbolt8
10th June 2018, 20:55
(Also, trying to build a "perfect" pipeline while downmixing to stereo and setting LFE to zero is a bit nonsensical.)as perfect as possible considering the given conditions

Yes, channel muxing from 6 -> 2 generates 32-bit float. Do not disable any formats in LAV, it will pick the optimal format for quality.so basically audio would be truncated if I choose to output at 32-bit float? apparently the 32-bit float then get changed to 24-bit padded by the MPC audio renderer afterwards. is this done via dithering?

lvqcl
10th June 2018, 21:17
as perfect as possible considering the given conditions

Two things that can really affect audio are:
1) surround -> stereo downmixing
2) no LFE channel

el Filou
10th June 2018, 23:58
so basically audio would be truncated if I choose to output at 32-bit float? apparently the 32-bit float then get changed to 24-bit padded by the MPC audio renderer afterwards. is this done via dithering?No, 32-bit float can represent 24-bit int without losing precision.
Anyway if you uncheck 32-bit float in LAV's output formats, the conversion from it back to 24 int is going to be done by LAV itself instead of MPC's renderer.

gfxnow
12th June 2018, 10:45
Posted this in MadVR but realized it might be more relevant here, should I force enable my onboard Intel GPU (HD Graphics 630) in BIOS to use it as a D3D11 CB device in LAV? The logic being that it might free up resources on my GTX 1070 allowing me to further crank up MadVR settings.

mclingo
12th June 2018, 11:33
i'd be interested to know what difference this would make as I could set LAV to software and use my CPU for LAV and GPU for MADVR.

Although, I doubt my CPU could handle HEVC.

sneaker_ger
12th June 2018, 11:43
Systems and files are so different it's best if you simply give it a try and compare. Note that video decoding is usually on an extra part of the chip not used by madvr and that copying uncompressed frames via PCIe has overhead so often D3D11 native should have the performance advantage (without quality loss DXVA2 native may introduce).

huhn
12th June 2018, 11:59
it's not that simple.

the only part that is simple is that the performance differences for madVR are mimimal if not zero on a proper working system.

if you think d3d11 native is the fastest mode for madVR it has to copy the data to dx9 after getting them this is not the case with dxva2 or software decoding.

if transferring big data or doing this copy process is using more processing power is hard to check because it is so little and inconsistent.

in term of rendertiems d3d11 clearly looses on the madVR OSD what ever that is worth i never encountered any real world differences.

i get 1.5 to 3 ms in the madVR OSD just for the d3d11 interop while for software decoding i can't find a reliable number or performance impact.

aufkrawall
18th June 2018, 14:19
Artificial statistics data don't prove anything. With my GTX 1070, the decoder performance with DXVA2 was too slow for 8k VP9, while D3D11VA worked.

madVR uses an interop for D3D11 presentation as well, and it doesn't really cost performance. Less guessing, please.

huhn
18th June 2018, 15:03
good job missing the point...

aufkrawall
18th June 2018, 15:46
Well, just partially. ;)

nevcairiel
19th June 2018, 13:55
LAV Filters 0.72

LAV Video
- Changed: Enabled CineformHD decoding by default, since the decoder has much improved
- Fixed: Decoding Matroska files with Linked Segments which used old x264 4:4:4 encodes could result in corruption

LAV Audio
- NEW: Blu-ray Dolby Digital Plus 7.1 decoding and bitstreaming support
- NEW: LAV Audio will fallback to audio decoding if bitstreaming is not supported by the audio renderer/hardware
- Fixed: DTS-HD HRA bitstreaming did not work properly with many A/V receivers
- Fixed: TrueHD bitstreaming could result in drop-outs on high bitrate TrueHD+Atmos streams

Download: Installer (both x86/x64) (https://files.1f0.de/lavf/LAVFilters-0.72.exe) -- Zips: 32-bit (https://files.1f0.de/lavf/LAVFilters-0.72.zip) & 64-bit (https://files.1f0.de/lavf/LAVFilters-0.72-x64.zip)

Audio and Bitstreaming Improvements

A lot of work went into this release for bitstreaming improvements, including doing a lot of research and reverse engineering to figure out how the TrueHD bitstreaming is really supposed to work, so that high bitrate streams (as found on UltraHD Blu-rays with Atmos) no longer cause drop-outs during playback.

Some newer receivers also had trouble receiving DTS-HD HRA streams, which should hopefully be resolved as well - even though my own receiver accepted the previous format just fine, but testing by other users has yielded quite positive results.

And last but not least, LAV Audio finally supports handling Dolby Digital Plus 7.1 as found on Blu-ray discs properly, both in decoding and bitstreaming. This format has not seen very wide use on Blu-ray discs, but the usage seems to be increasing lately.

Outside of those improvements, LAV 0.72 of course comes with a newer version of FFmpeg.

mclingo
19th June 2018, 14:10
yikes, some great stuff there Nev, specifically the fallback we asked for, fantastic work again, wonderful.

Thanks.

zaemon
19th June 2018, 14:30
Great, thanks. I had the dropout issue.

Manni
19th June 2018, 14:38
Thanks for the great work, as usual!

hubblec4
19th June 2018, 14:50
Hi nevcairiel

Many thanks for fix the issue with Matroska Linked Segments.
I have tested my Blu-ray Thor 3 which has audio Dolby Digital Plus 7.1, all works fine now.

chros
19th June 2018, 16:25
Thanks for the new release and your work!

nussman
19th June 2018, 18:53
Thanks nevcairiel for the new Version and especially for the fallback feature.

iSeries
20th June 2018, 19:34
Hi, my AVR is 7.1 capable, however, I have a 5.1 setup. If I were to send PCM to my receiver instead of bitstream, for 7.1 tracks should I send the full 7.1 channels and let the AVR do the downmixing, or set LAV to output 5.1?

Also, not starting a PCM vs bitstreaming debate, but is there any advantage to bitstreaming? Don't the lossless codecs have downmixing metadata in them whereas PCM would not have this?

huhn
20th June 2018, 22:06
bitstreaming is less accurate in term of A/V sync.
lav or an audio render could use the meta data to down mix not sure if there is a render with support for that or if lavfilter is reading it.

i can't tell you if PCM can be send with meta data.

jmone
20th June 2018, 23:31
Thanks Nevcairel for the work on TrueHD/ATMOS bitstream changes. Working well.

ryrynz
21st June 2018, 00:46
Hi, my AVR is 7.1 capable, however, I have a 5.1 setup. If I were to send PCM to my receiver instead of bitstream, for 7.1 tracks should I send the full 7.1 channels and let the AVR do the downmixing, or set LAV to output 5.1?

I would let the amp take care of it. Grab a 7 channel test file and see which you prefer, but I'd rather let hardware deal with a process like this.

SamuriHL
21st June 2018, 01:36
It depends on the AVR but yea, I let mine do the same thing. Then again, I've got a massive speaker upgrade en route so I'll be fully 7.1 shortly. WOO HOO!

Aleksoid1978
21st June 2018, 08:58
nevcairiel
Hi. Fallback to audio decoding is not working if some audio processor present in graph, "ffdshow Audio Processor" as example.

nevcairiel
21st June 2018, 09:06
Thats probably ffdshows fault, its extremely inflexible in changing its types. Also, why would an audio processor ever accept a bitstreaming type in the first place?

clsid
21st June 2018, 16:29
Works here with ffdshow, except if I enable bitstreaming during playback.

phoenixxl
23rd June 2018, 04:33
Hey Nevcairiel,

Just mentioning the top post desc still says 0.71, the link to the fille is ok though, it links to v 0.72

Binaries for the most recent version are available here:
Version 0.71: Installer (both x86/x64) -- Zips: 32-bit & 64-bit
Download 3D Plugin: 32-bit & 64-bit


Thank you for the new filters !