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
10th August 2015, 22:04
So I tried to build a work-around for the EVR P010 issues ... and EVR is being dumb and not letting me.

The general idea was to simply switch to NV12 if LAV detects that P010 is having issues instead of failing entirely.
However, I encountered an old bug in EVR which I fought with a long time ago already. EVR simply cannot change its input type once connected to a video decoder - which means an on-the-fly change to NV12 is not possible, unfortunately.

One potential solution would be to create a worker thread, stop the DirectShow graph, disconnect and reconnect LAV and EVR, and hope for the best. Its a very disruptive and noisy process, but considering that the only alternative would be to get no image at all, its probably the best.
I'll experiment some more..

Edit:
The alternate solution (which I wanted to avoid) was to outright block P010 with EVR. I would've liked it better if I could detect that its broken and only act then.
But guess thats not going to work. If MS ever fixes this (which I don't expect), a more elaborate check my be warranted.

ocyl
11th August 2015, 08:43
So I tried to build a work-around for the EVR P010 issues ... and EVR is being dumb and not letting me.

The general idea was to simply switch to NV12 if LAV detects that P010 is having issues instead of failing entirely.
However, I encountered an old bug in EVR which I fought with a long time ago already. EVR simply cannot change its input type once connected to a video decoder - which means an on-the-fly change to NV12 is not possible, unfortunately.

One potential solution would be to create a worker thread, stop the DirectShow graph, disconnect and reconnect LAV and EVR, and hope for the best. Its a very disruptive and noisy process, but considering that the only alternative would be to get no image at all, its probably the best.
I'll experiment some more..

Edit:
The alternate solution (which I wanted to avoid) was to outright block P010 with EVR. I would've liked it better if I could detect that its broken and only act then.
But guess thats not going to work. If MS ever fixes this (which I don't expect), a more elaborate check my be warranted.
nevcairiel,

Putting speed and quality considerations aside, would deselecting the P010 option in LAV Video settings serve as a valid manual workaround for those who are affected by the issue (not me)?

nevcairiel
11th August 2015, 08:45
If you just use EVR anyway, disabling that option is a usable workaround for now. However, ideally it shouldn't be required in the future, on most setups anyway.

nevcairiel
11th August 2015, 11:17
So there is some good news! 10-bit HEVC with DXVA2-Native seems to work just fine with EVR on Windows 10, at least on my GTX 960, so yay! Software P010 still fails, but LAV managed to fallback to NV12 now.
I'll have to make sure it doesn't explode badly on other systems though, so some testing will be needed.

P.J
11th August 2015, 21:53
So there is some good news! 10-bit HEVC with DXVA2-Native seems to work just fine with EVR on Windows 10, at least on my GTX 960, so yay! Software P010 still fails, but LAV managed to fallback to NV12 now.
I'll have to make sure it doesn't explode badly on other systems though, so some testing will be needed.

It doesn't work for me :confused:

nevcairiel
11th August 2015, 21:54
Thats because you assumed that your version of LAV already supports it. :p

P.J
11th August 2015, 21:59
Thats because you assumed that your version of LAV already supports it. :p

Ah, I thought it's v0.65.0-43 :D

Can't wait.

NikosD
12th August 2015, 08:13
Latest LAV 0.65.43 has fixed the P010 bug with Intel drivers.

I did the tests on Win 10 x64 - Drivers v4256 using 10bit H.265/H.264 clips.

It falls back instantly to NV12.

nevcairiel
12th August 2015, 12:39
I pushed a new "nightly" build with DXVA2-Native 10-bit HEVC decoding enabled.
I was only able to test with GTX960 on Windows 10, but with a bit of luck it may even work on Windows 8/8.1 with Intel Broadwell/Skylake hybrid decoders (although NVIDIA seems to not allow it on Windows 8.1)

http://files.1f0.de/lavf/nightly/LAVFilters-0.65.0-45.exe

Note that it won't work with MPC-HC, as MPC-HC blocks P010 with EVR to work-around the bug in EVR. I've already contacted the MPC-HC developers to see if we can't fix that situation.
It also won't work with madVR yet, but hopefully madshi can accomodate us eventually.

Thunderbolt8
12th August 2015, 13:22
but if it worked with madvr, would it be recommendable then since its dxva native and not copy back?

NikosD
12th August 2015, 13:29
Note that it won't work with MPC-HC, as MPC-HC blocks P010 with EVR to work-around the bug in EVR. I've already contacted the MPC-HC developers to see if we can't fix that situation.


Now that you can handle P010 bug internally in LAV Video, would it be safe for MPC-HC to just remove their workaround for P010 completely ?

FreeFall
12th August 2015, 14:15
nevcairiel,

I have a couple more problem Blu-ray Disc samples from Sentai Filmworks. It's the same problem I reported a while ago, playback stalls during the credits and then resumes after a while, DTS-HD audio for the video and credits with no audio. It doesn't seem to be a regression, it's just these two recent releases that have triggered the problem again. The difference is the credits are a part of the main video file instead of being a stand alone video stream like their previous releases.

Using MPC-HC 1.7.9 (x86), both playback ok with VLC and MPC-BE.

tvideo1 playback stalls at ~ 0:58 recovers shortly after
https://www.dropbox.com/s/u6p6fhbll8cdobj/tvideo1.m2ts?dl=0

tvideo2 playback stalls at ~ 1:49 takes longer, over a minute to recover
https://www.dropbox.com/s/zxcfoutcx9mhf63/tvideo2.m2ts?dl=0

Thanks,

FreeFall

nevcairiel
12th August 2015, 14:20
Get another audio renderer which keeps advancing the reference clock even if no audio is present. Nothing LAV can really do about it, it only decodes.

There is a lot of factors to consider. The Audio Renderer providing the reference clock, the Video Renderer and its reliance on the refclock, but LAV just outputs the video and audio as it is in the file.
LAV seems to be behaving properly however. If the buffers would be bigger, it might be able to "cheat" the system by buffering until the end of the file and avoid the problem like this, but buffering is limited in LAV right now, so thats not happening. I could imagine MPC-BE managing to "handle" it like that, just bigger buffers.

Maybe I should finally make them configurable to confirm that strategy.

FreeFall
12th August 2015, 15:01
Yeah, your probably right, I just tried the MpegSplitter.ax from MPC-BE's x86 standalone filters package and it works without any trouble (LAV Video / LAV Audio / MPC MPEG Splitter). I'm just using MPC-HC's default settings except using the DirectSound S/PDIF output to an older amplifier.

nevcairiel
12th August 2015, 15:03
I'll add an option to increase the buffering in LAV Splitter in the next nightly build. Setting it somewhat high will probably allow it to skip over short segments without audio without too much trouble.

FreeFall
12th August 2015, 15:13
Thanks, I'll test the new build.

clsid
12th August 2015, 15:24
VMR7 also fails with P010, so its probably a good idea to use the new workaround for that too.

nevcairiel
12th August 2015, 15:25
VMR7 is DirectX7, its like 20 years old, it should be removed as an option.

P.J
12th August 2015, 17:12
Note that it won't work with MPC-HC, as MPC-HC blocks P010 with EVR to work-around the bug in EVR. I've already contacted the MPC-HC developers to see if we can't fix that situation.

Then what player should we use for that? :confused:

nevcairiel
12th August 2015, 17:16
Any other? :p

NikosD
12th August 2015, 20:46
Then what player should we use for that? :confused:
Try DXVA Checker.

It's not a real player of course but you could try it to see if it actually works.

P.J
12th August 2015, 23:18
Try DXVA Checker.

It's not a real player of course but you could try it to see if it actually works.

Yup, it works :)

NikosD
12th August 2015, 23:39
Is there any difference in performance compared to DXVA copy-back with Nvidia 960 or in CPU usage ?

P.J
13th August 2015, 09:31
Is there any difference in performance compared to DXVA copy-back with Nvidia 960 or in CPU usage ?

Sure, less CPU/RAM :)

ryrynz
13th August 2015, 11:19
It is not a problem that I have personally, but an option would be useful considering that apparently there are people who do have issues. The tooltip could of course warn about the increased delay.

I agree with that. I've heard about issues with insufficient buffering a lot. Especially with live streams where data flow can be unstable.

Regarding the new maximum queue option that's been recently added, would it be worth specifying different queue sizes for local and web hosted content?

nevcairiel
13th August 2015, 11:22
For local content it doesn't really care that much how big the queues are, it works fine with pretty low queues most of the time, which has the lowest memory footprint and peak IO use, and having higher queues will only result in some peak IO activity during opening .. which would only be a problem on old systems where IO can really block the operation of other things.

So if you want higher queues for some content, like from the web, then just increase it overall.

Even a infinitely sized queue (with the memory limit increased appropriately) doesn't seem to cause any issues on a fast system with low-latency IO, so my 1gb media file is buffered into RAM after a couple seconds and thats that.
Of course anything can happen on slower systems with slow IO, or high-latency network connections, so just toy with the value if you experience buffering problems.

ryrynz
13th August 2015, 11:31
Thanks, I've been wondering if it would be beneficial to allow the media player to change this dynamically, any thoughts on that?

nevcairiel
13th August 2015, 12:11
Its a normal option, the media player could change it if it wanted to. Not sure I see the benefit in dynamic changes though.

FreeFall
15th August 2015, 10:25
Just finished testing the new build, using the values below fixed the problem with those two disc's allowing them to playback smoothly from start to finish.

Maximum Queue Memory: 1792
Maximum Queue Packets: 2450

Seven times the default values, lucky seven.

Cheers.

nevcairiel
15th August 2015, 10:59
On a quick glance, MPC-BE uses a default queue size of over 3000, so that would explain why theirs works out of the box.

FreeFall
15th August 2015, 12:43
In that case I might just bump the Queue's up another notch and make it an even 8 times the defaults to allow for a little extra headroom (Memory: 2048 / Packets: 2800). I'm not sure if the Memory Queue needs to be that high, that value just caps memory usage doesn't it?

Aleksoid1978
15th August 2015, 12:46
On a quick glance, MPC-BE uses a default queue size of over 3000, so that would explain why theirs works out of the box.

Now in MPC-BE we change working with queue - remove memory/packet's count limit. Now we use duration for queue limit. And - it's better, greatly reduce memory use ...

clsid
15th August 2015, 14:16
In that case I might just bump the Queue's up another notch and make it an even 8 times the defaults to allow for a little extra headroom (Memory: 2048 / Packets: 2800). I'm not sure if the Memory Queue needs to be that high, that value just caps memory usage doesn't it?
The default 256 MB is more than enough already for a packet queue of 2800.

50 packets is 1 second of audio and ~2 seconds of video.

FreeFall
15th August 2015, 14:40
Ok, thanks clsid.

NikosD
15th August 2015, 17:20
Hi Nev,

With videos from TV capture (and only from TV capture: live TV or recordings) I have macroblocs during fast motions in DXVA-native with EVR, EVR-Custom and madVR.
Everything is fine with Microsoft DTV-DVD Video Decoder.

I didn't had this problem with Windows 7 but I was with 15.28.23 drivers, now with Windows 10 it's 15.28.24.
This is a sample (1 min, 47 MB): http://www.mediafire.com/watch/v4o6ig9qhccvjko/M6HD-Capital.2015-08-09.20-58-012.mkv

My system:
Intel HD3000 (Sandy Bridge), drivers 15.28.24 (video driver 9.17.10.4229)
Windows 10 x64

Thanks

Latest Intel drivers on Windows 10 are known to have many problems with DXVA.

Plays perfectly here with Haswell iGPU 4600 - Win 10 x64 - Latest Windows Update drivers 10.18.15.4256.

I tried DXVA native with EVR and EVR-CP.

There are only some glitches at the very first few frames, but these are known occasional small issues with LAV Video decoder from the past.

MS DS/MFT is perfect once again, even at the very beginning of the clip.

I'll try with my Sandy HD 2000 on Windows 10 on Saturday.

If you haven't already done it, I would recommend a clean install of Win 10 - as always with any new OS.

MS DS decoder is using the exact same decoder device like LAV.

If MS plays fine, why LAV shouldn't ?

From the problems being mentioned in Intel forums regarding DXVA, I have none.

With Sandy's iGPU HD 2000 under Win 10 and latest drivers there are macroblocks not only using DXVA native but LAV DXVA copy-back too.

Both MS DS/MFT decoders are fine.

And because QuickSync decoder plays that file perfectly like MS, I think LAV's DXVA decoders probably need a little fine-tuning for Sandy.

@XinHong
Select QuickSync decoder from within LAV Video properties and you will be fine.

nevcairiel
15th August 2015, 17:52
If it worked on 7 or 8.1 and only broke after upgrading to 10, then I'm still going to wait for Intel to fix their other driver problems before caring, though. Broken on one OS only is usually a clear sign to some driver influence.

baii
15th August 2015, 21:32
Recently update mpc-hc nighties and notice there is a hardware quick sync/cuvid de-interlace option (maybe I was blind and didn't notice it), does this option have any difference compare to hardware de-interlace called from madvr? And is there any reason Amd is not available yet?

Sent from my 306SH

XinHong
16th August 2015, 15:18
@XinHong
Select QuickSync decoder from within LAV Video properties and you will be fine.

Thanks but I have switched DVBViewer to MS decoder, I want to keep DXVA because deinterlace and scaling seems to be better.

NikosD
16th August 2015, 15:21
Deinterlace and scaling should be exactly the same, because QuickSync decoder uses exactly the same algorithms and HW as it is essentially DXVA covered by Intel's MediaSDK.

James Freeman
18th August 2015, 19:14
When playing an HEVC file using DXVA2 copy-back (Active Decoder: dxva2cb direct) and ticking HEVC (enabled) with a non capable gpu like GTX660, I have a lot of presentation glitches (D3D9) or the backbuffer (overlay mode) empties every 2 seconds.
But when I disable HEVC (unticked) everything is back to normal.

nevcairiel
18th August 2015, 19:16
The hybrid decoding on those GPUs may cause issues, possibly due to memory bandwidth, nothing I can do.

Reliability of HW decoding is always at the mercy of a lot of external factors.

James Freeman
19th August 2015, 06:23
Hybrid?
It's not using the GPU at all, VPU is at 0% and still it says "Active Decoder: dxva2cb direct", resulting in a lot of glitches.

nevcairiel
19th August 2015, 06:45
Hybrid?
It's not using the GPU at all, VPU is at 0% and still it says "Active Decoder: dxva2cb direct", resulting in a lot of glitches.

VPU doesn't really show any activity for hybrid decoding.

In any case, if dxva2 is active, then some GPU must be offering to decode it. I can't help that this offer doesn't work properly. There is a checkbox to turn off HEVC DXVA2 for such cases.

James Freeman
19th August 2015, 06:52
Okay, thank you.
Maybe next gen GPUs will have full support?

LigH
19th August 2015, 08:01
GPU activity is only reported for the shader units, but not for the separate decoder chip. Please start to understand that there are many different chips (or at least chip areas) on a graphic card...

nevcairiel
19th August 2015, 08:13
Maybe next gen GPUs will have full support?

The GTX960 already does, as will the GTX950 which will release shortly, but those two are the only GPUs with full HEVC support (both 8 and 10-bit). Intel and AMD only have 8-bit decoders so far (and Hybrid for 10-bit).

NikosD
19th August 2015, 09:30
When playing an HEVC file using DXVA2 copy-back (Active Decoder: dxva2cb direct) and ticking HEVC (enabled) with a non capable gpu like GTX660, I have a lot of presentation glitches (D3D9) or the backbuffer (overlay mode) empties every 2 seconds.
But when I disable HEVC (unticked) everything is back to normal.

What HEVC clip, 8bit or 10bit ?

Does your driver install both HEVC_VLD_Main and HEVC_VLD_Main10 ?
You can use DXVA Checker to find out.

Why don't you use DXVA native and report back your results by monitoring GPU usage ?

Also check your CPU usage during SW decoding and DXVA (native or copy-back decoding).
Is it any different between all these modes ?

GPU activity is only reported for the shader units, but not for the separate decoder chip. Please start to understand that there are many different chips (or at least chip areas) on a graphic card...

He is reporting the right monitoring parameter - which is GPU usage in his case - since he doesn't have a pure HW HEVC decoder in his GPU in order to use it and he can only decode HEVC in hybrid mode using shaders.

You weren't so careful reading his post.

foxyshadis
19th August 2015, 10:22
Hybrid?
It's not using the GPU at all, VPU is at 0% and still it says "Active Decoder: dxva2cb direct", resulting in a lot of glitches.

Which GPU? Since you have two, the other one is probably doing the decoding. Make sure to check both.

NikosD
19th August 2015, 10:25
Which GPU? Since you have two, the other one is probably doing the decoding. Make sure to check both.
Ivybridge iGPU doesn't support HEVC, not even in hybrid mode.

James Freeman
19th August 2015, 10:36
What HEVC clip, 8bit or 10bit ?
8bit.
Does your driver install both HEVC_VLD_Main and HEVC_VLD_Main10 ?
HEVC_VLD_Main only.

Why don't you use DXVA native and report back your results by monitoring GPU usage ?
Native glitches less frequently, but still does.

Also check your CPU usage during SW decoding and DXVA (native or copy-back decoding).
Is it any different between all these modes ?
All three modes use the same amount of CPU for decoding.

P.S
The intel on chip gpu is permanently disable in the bios.
I talk strictly about the GTX600, In P8 State! which is downclocked to around 320 Mhz for both GPU and MCU.

In full power P2/P0 (full power) copy-back it is glitch free.
In P8 state, a glitch free presentation is only in SW (none) mode, or when HEVC is disabled.
So it does seem like the GPU is trying to do something and fails because of the low clock speeds thus resulting in presentation glitches.
All this with rendering times in the 20ms range (P8).