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

TheShadowRunner
11th December 2016, 18:26
nev, the missing characters (in subtitles) issue on XP isn't fixed, was it supposed to be?

CruNcher
11th December 2016, 18:30
- Fixed: Decoding certain H.264 streams could drop a few frames at the start of playback

Nice this was a big difference to DIAVC (not having this problem), CoreAVC has this issue as well :)

@nevcairiel

when and who fixed it ?

nevcairiel
11th December 2016, 18:35
nev, the missing characters (in subtitles) issue on XP isn't fixed, was it supposed to be?

Since it turned out to be an XP only issue, I've postponed any considerations. I'm yet undecided if I'll even try to fix it at all - juggling a temporary file to write the font out into sounds like a bit of a pain, wouldn't want those files to stay around too long etc.
Honestly, XP is mostly just dead to me. I'm somewhat happy to keep building LAV in a way that keeps running on XP as long as it doesn't block any new things, but writing new code just for XP... not feeling it, sorry.

TheShadowRunner
11th December 2016, 18:48
The first part of your reply sounds like there's hope, but the 2nd part is the contrary.. xD
Indeed XP is long outdated/dead for most people but if LAV is still compatible I think it should be 100%.
If anyone else is able to code this little change (temp file) for font loading on XP, by all means please do.

nevcairiel
11th December 2016, 20:36
Indeed XP is long outdated/dead for most people but if LAV is still compatible I think it should be 100%.

You should be careful with what you wish for, because there is two possible outcomes to that. ;)

TheShadowRunner
11th December 2016, 23:02
I'm highly skeptical my opinion on the matter has any weight in the decision process, sadly ^^

Aleksoid1978
12th December 2016, 08:42
nevcairiel
Why don't add VP9 10 bit DXVA support ?? Nvidia 1050/1050 Ti support it.

Seegs108
12th December 2016, 08:52
I've got an issue and I'm wondering if anyone can explain what's happening. I'm trying to playback an mk3d file in MPC-HC. This is essentially a remux of a full 3D blu-ray disc (frame packed sequential 3D). I have the latest LAV Filters installed (0.69.0) with the H.264 MVC 3D Decoder installed as well. I also have the latest MadVR version installed as well. For whatever reason I cannot get LAV Filters to use the proper video decoder on my desktop PC (that I normally use as an HTPC for my projector). It uses "avcodec" instead of "msdn mvc" like it should.

I have the same software installed on my laptop and it plays back PERFECTLY. The only difference that I can tell between each setup is that my laptop is running Windows 10 and my desktop is running Windows 8.1. As far as I'm aware this should work in Windows 8.1 too. Am I wrong? Is there anything else I should try?

Edit: I got it working. I needed to disable some of the internal filters even though I had LAV Filters set to "Prefer" in the External Filters menu. Something was throwing it off...

nevcairiel
12th December 2016, 10:02
nevcairiel
Why don't add VP9 10 bit DXVA support ?? Nvidia 1050/1050 Ti support it.

I don't have any hardware to develop it on.

Aleksoid1978
12th December 2016, 10:47
I don't have any hardware to develop it on.

It's easy - i can help :)

nevcairiel
12th December 2016, 10:51
I'm getting a kaby lake laptop this week, I think that should support it already, I'll just do it on there.

CruNcher
12th December 2016, 14:23
Nice this was a big difference to DIAVC (not having this problem), CoreAVC has this issue as well :)

@nevcairiel

when and who fixed it ?

Ah nope must be a general Decoder efficiency issue DIAVC still handles such bitrate spikes more efficiently, without exploding in enormous render times though Lav Video does better in that case then Mainconcept not to say much much much better then Cyberlink (which almost die on such a overflow).

Must be another issue you talked about.

But the characteristics of CoreAVC and Lav Video failing are crazy similar compared to DIAVC pretty nice balancing of schweinsz beating both still with ease on Windows stability and when it gets really to the limit :D

http://i1.sendpic.org/t/pq/pqxjOO6Q3bY6pq7KSJcXyEf0beM.jpg (http://sendpic.org/view/1/i/dm3WTcMca2Hwlw0lCf5rQxBv7Gp.png)

DIAVC survives that it's masterfull work

Lav Video fails

http://i1.sendpic.org/t/ot/otg621mPeT2VEHjTkUzTm2EzoYr.jpg (http://sendpic.org/view/1/i/g8WeBAXQ9OTgsE6CICnKOd37uAk.png)

CoreAVC fails pretty much the exact same way

http://i1.sendpic.org/t/ft/ftoIq44GbGWmcv3gvkmJaarYkwm.jpg (http://sendpic.org/view/1/i/mMVJWzgfoWiyhMqVoZEmdPgLM9x.png)

DIAVC spawns much more threads over itself on auto while lav video does over msvcrt and by default much less hmm i guess that would explain at least the huge memory difference


oha now we come close to the same behavior with that overflow interesting

woha with 2 threads i get in latency regions of Mainconcept on that overflow with Lav Video

with 1 thread around 67 ms

DIAVC with 1 thread around 103 ms crazy now it starts to fall apart single threaded on that encoder overflow


X264 Encoder Overflow test


DIAVC 64bit

1 thread = 103 ms (jitter clearly perceptible,sync graph explodes out of render surface)
2 threads = 42 ms (jitter clearly perceptible,sync graph explodes inside render surface)
3 threads = 20 ms (jitter clearly perceptible,sync graph explodes above box threshold)
4 threads = not clearly measurable (jitter slightly perceptible,sync graph slightly visible still in box threshold boundaries)

LAV Video 64 bit (avcodec)

1 thread = 67 ms (jitter clearly perceptible,sync graph explodes out of render surface)
2 threads = 41 ms (jitter clearly perceptible,sync graph explodes out of render surface)
3 threads = 30 ms (jitter clearly perceptible,sync graph explodes inside render surface)
4 threads = 24 ms (jitter clearly perceptible,sync graph explodes above box threshold boundaries)

madshi
15th December 2016, 10:02
@nevcairiel,

there's a bug in both madVR and LAV, when playing the video file attached here:

http://bugs.madshi.net/view.php?id=456

The bug in LAV is that it sends NV12 to madVR although the stream is GBR (matrix_coefficients = 0). The bug in madVR is that it uses the decoding matrix for GBR although LAV sends NV12. My bug is "bigger" :) but I think we should both fix this.

nevcairiel
15th December 2016, 10:07
@nevcairiel,

there's a bug in both madVR and LAV, when playing the video file attached here:

http://bugs.madshi.net/view.php?id=456

The bug in LAV is that it sends NV12 to madVR although the stream is GBR (matrix_coefficients = 0). The bug in madVR is that it uses the decoding matrix for GBR although LAV sends NV12. My bug is "bigger" :) but I think we should both fix this.

The reason for that is that it is encoded as 4:2:0, ie. subsampled RGB.
I could upscale it to 4:4:4 I guess, but that seems hardly ideal - and there is no subsampled RGB media type otherwise.

madshi
15th December 2016, 10:12
Wow, that's weird! I didn't even know that such a weird encoding format was possible. I suppose NV12 is the best output format then, so nothing for you to do.

nevcairiel
15th December 2016, 10:16
It is rather uncommon, but nothing in the format prevents it from being used as the colorspace is just a flag independent of the subsampling ratio.
I could just convert it to proper RGB32, however my problem with that is that such a stream can also be decoded by every hardware decoder, and I don't have automatic conversion setup for those because they typically only output nv12 and as such don't need any conversions, so the result would be inconsistent at best, or a lot of work for a odd niche format.

madshi
15th December 2016, 10:26
After thinking about it, I'm slightly confused now. Is the Green channel full resolution and Red and Blue are half resolution? Or how does RGB subsampling work? How are you doing the RGB -> NV12 conversion if red/blue have lower resolution than green? Do you upsample chroma first? With which algorithm? And then you convert to YCbCr and downsample to 4:2:0 again?

nevcairiel
15th December 2016, 10:29
I would assume Green is full size and Blue/Red are smaller, as simple as that. I don't do anything to the video, just output it how it comes out of the video decoder. What happened during encoding - it was probably never converted to YCbCr, just planar RGB and two planes got downsampled like chroma would.

madshi
15th December 2016, 10:39
Strange. If I treat the data as GBR, it turns magenta. I have to treat it as true NV12 to make it display correctly. So it seems the ffmpeg decoder does all the conversions internally? It would then have to upsample red/blue, convert to YCbCr and downsample to 4:2:0 again. Having all that done by ffmpeg doesn't sound like it's going to be high quality, to be honest. If we're lucky it's bilinear, maybe nearest neighbor. But then, I almost consider a video like this "broken", so maybe we simply shouldn't care too much about it.

nevcairiel
15th December 2016, 11:07
Nah the decoder does nothing of that sort. Maybe the flag is just wrong and it isn't actually RGB. Considering it plays fine with EVR, that seems like the most likely explanation.

madshi
15th December 2016, 11:19
Agreed, in that case it would seem the flag is just wrong.

LAV reports "unknown" decoding matrix to madVR, so madVR checks the h264 bitstream headers, sees "GBR" there and thus uses that as the decoding matrix, which results in the magenta color shift. I'll add an extra check to not use "GBR" matrix if the data format is NV12.

nevcairiel
15th December 2016, 11:25
Well, like I said before, there is nothing actually stopping anyone from making such a file properly, even if its kinda insane.

madshi
15th December 2016, 11:34
So basically that means if we leave LAV unchanged, the way madVR currently behaves is actually correct (using GBR matrix). However, sending NV12 with an "unknown" matrix is not really a good way for LAV to output such video streams, because all other video renderers will simply auto guess the matrix to be either BT.601 or BT.709 in that situation and thus produce incorrect colors.

The big question is if such crazy files are worth investing any time into. First of all we'd need a correctly encoded file with such a format to even bother with it, and I'm not aware of any such files. So maybe we should simply ignore this, until properly encoded real world files with subsampled RGB appear (if ever)?

nevcairiel
15th December 2016, 11:36
I could make one if you want to. :P Considering it'll likely not work on 99% of all video players, its probably not something to worry about, people would need to very weird to create a file that doesn't work properly anywhere.

madshi
15th December 2016, 11:39
My vote would be to ignore this issue for now. At least until we run across properly encoded real world content with this format. Or what do you think?

nevcairiel
15th December 2016, 11:44
Ignoring is fine with me.

MasterNobody
15th December 2016, 19:44
From H.264 specs:
matrix_coefficients shall not be equal to 0 unless both of the following conditions are true:
– BitDepthC is equal to BitDepthY,
– chroma_format_idc is equal to 3 (4:4:4).
The specification of the use of matrix_coefficients equal to 0 under all other conditions is reserved for future use by ITU-T | ISO/IEC.
So this stream is simply out of the specs so can be ignored.

madshi
15th December 2016, 22:25
Good catch!

Damien147
17th December 2016, 17:12
I get black screen using dxva2(native) in some videos,am I the only one?

CruNcher
17th December 2016, 17:29
A Black Screen can have many issues (mostly it's simple not supported decoding wise or a bug in the directshow layer, directshow hell (interfering filters,decoder), renderer or even driver itself), , or like we lastly had non spec compliant encoder output.
First of system information and sample with that you have problems decoding wise not getting any output from but a black standing screen with lav video/audio and or filters is a good start.

Hardware Decoder (Discrete non Discrete):
Renderer used (Playback Software/Directshow Chain):
Decoding Mode: (None, DXVA Native, Copy Back, CUVID or Quicksync)
CPU:
Driver:
OS:
Sample:

And then Problem Description: "Black Screen no Playback" ;)

Damien147
18th December 2016, 18:18
Just checked again,I think I made a fault.The movies that give me black screen in dxva2(native) are P010 WHEN using madvr,trying evr cp and the file plays well,my bad.

huhn
21st December 2016, 23:37
HEVC 10 bit hardware decoded to p010 should work on modern GPUs if the codec is not HEVC lavfilter should fall back to software.

khanmein
23rd December 2016, 10:51
I get black screen using dxva2(native) in some videos,am I the only one?

y don't u use DXVA2 copy-back (CB) ??

Zach_N85
26th December 2016, 18:47
Hi guys,

I'm having an issue with PotPlayer and LAV Audio Decoder.

Using PotPlayer with LAV Audio Decoder, when I play a DTS-HD movie, I get the following:

http://i.imgur.com/QxG59gZ.png

6 -> 8 Channels which is good
However, the bit depth becomes 16 from 24.

With DTS:

http://i.imgur.com/iSkD2K2.png

6 -> 2 channels, I don't understand why? My RX-V681 reads DTS and I get sound on all 6 speakers.
Bit Depth becomes 16 from 32, again I don't understand why.

Here are my LAV Audio Decoder settings:

http://i.imgur.com/2JvARpv.png?1

My Audio Renderer in PotPlayer is set to Auto, but it happens if I change it as well.

My video card is a GTX680 which is capable of outputting 24bit sound. I think this is actually more a PotPlayer issue then an LAV issue because it happens if I use the built in decoder as well.

I've tried many websites and boards but couldn't find a solution.
Can someone help me with this please? Thanks

nevcairiel
26th December 2016, 19:17
If you are bitstreaming, those values have no meaning and are just a technical detail how the bitstreaming works. DTS-HD is always "packed" into a 8 channel signal, and normal DTS always in a 2 channel signal - the receiver receives the full DTS bitstream and decodes the original channels.

Zach_N85
26th December 2016, 19:31
Finally someone who is able to answer the question! Yes I am bitstreaming, currently using LAV + ReClock with the following settings, and everything works well:

http://i.imgur.com/Rdl3e1K.png

http://i.imgur.com/ESH4swz.png

So whatever it says on the playback file is meaningless in bitstream? I had no idea. When I check the file info I do see 6/7/8 channels in DTs/DTS-HD it just always bothered me when I saw the signal "downsampled" to 16 bits or 2 channels.

So I'm getting the original 24 bit depth on my streams? If you can please explain more about why DTS is packed into 2 channels and not 6 I would love to know.

Thanks.

P.S.
Are there any benefits in using ReClock without SVP? I just set it up as my Audio Renderer but I would like to know if it helps with something. Using madVR as video renderer. I didn't reinstall SVP because I actually like how my TV handles the motion so I dunno if I need the extra effort on my CPU with interpolation.

nevcairiel
27th December 2016, 01:34
If you can please explain more about why DTS is packed into 2 channels and not 6 I would love to know.

Basically because thats how its defined by Microsoft and the SPDIF/HDMI specification. It has to do with the required bandwidth to fit the audio streams into, not the encoded audio properties.

oddball
30th December 2016, 10:57
LAV Audio filter refuses to load with a TrueHD track. Only MPC-BE's audio filter loads (and won't pass anything but stereo PCM even if enabled or AC3 encoding). I am using the TV's HDMI input with ARC so may be why.

kiwijunglist
30th December 2016, 22:03
Can someone recommend me a directshow filter that does individual crossover frequencys for each channel.

I use MPC-HC, my current path is

LAV Splitter -> LAV Audio Filter (Mix to 5.1, except leave 2.0 alone) -> Reclock

I'd like to go

LAV Splitter -> LAV Audio Filter (Mix to 5.1, except leave 2.0 alone) -> [Adjust crossover freq] -> Reclock

I want to crossover my fronts and centre at 60hz and my rears at 100hz. My AVR doesn't support individual crossovers for speakers.

Can anyone recommend which directshow filter I should look into?

Thanks
Kiwi

e-t172
30th December 2016, 22:43
You might want to look into EqualizerAPO (https://sourceforge.net/projects/equalizerapo/) which is flexible enough to let you do advanced stuff like that, provided you are willing to spend the time to understand how it works (you'll have to implement bass management yourself - example (http://pastebin.com/zrZpbLaK) and result (http://i.imgur.com/ha1SUrq.png)). Also that's a cleaner solution because that kind of processing should ideally be done at the audio output, not the video player, such that it benefits all Windows applications.

Snecx
3rd January 2017, 15:44
Hello

I have an issue with the LAVVideo.ax.
I use Kodi 17 dsplayer with internal LAV 0.69 and madVR 0.94.
I have tried some 4k test files and most are fine. But some 4k files causes Kodi to crash. I have tried to debug and saw the LAVVideo.ax causes the crash. I have downloaded the symbols of LAVFilter and the source of 0.69. I put all into VS but i'm not good in this stuff so maybe someone can help. After starting the test file
here is the link http://jell.yfish.us/media/jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv kodi crashes.
Some other test files play fine. Even 4k UHD 10bit. So i'm not sure it's an issue with Kodi or the lav filter.
i made a screenshot of the debug window. Maybe someone can help me to understand where the issue is. If you need more information i will try to help. Kodi crashes with the error:Exception thrown at 0x51D01DE9 (LAVVideo.ax) in kodi.exe: 0xC0000005: Access violation writing location 0x00000000.
http://i990.photobucket.com/albums/af29/snecxxx/lav_zps0vlivijr.jpg (http://s990.photobucket.com/user/snecxxx/media/lav_zps0vlivijr.jpg.html)

loa-ash
10th January 2017, 11:06
Guys there is a way to force software like Adobe Audition to use lav filters to make a sort of frameserving to open mkv and editing audio?

LigH
10th January 2017, 11:21
Probably not in general. Sample editors may open WAV files and use ACM codecs to decode audio streams in a format not supported by their own decoders. Having LAV Filters decode an audio stream would require both creating a pseudo frameserving WAV file and a pseudo ACM codec using LAV Filters' audio decoder via either DirectShow or a native API. But what works rather well for AVI files with discrete frames (see makeAVIS in the ffdshow package) would probably not be just as easy for WAV files with a more or less continuous audio stream. Frameserving video works because for each frame, you can store metadata to request a decoder to deliver this frame by some other API call. Producing such metadata for every audio sample would be larger than PCM, though; and I am not sure if you could instead fake some compressed audio stream with fixed-width "audio frames".

loa-ash
10th January 2017, 11:47
I remember that with Audition 1.5 I've opened mkv but i don't know if I have also ffdshow installed too also with lav filters

LigH
10th January 2017, 11:57
In this case, it may even support opening media files via DirectShow? Possibly via additional plugins? But that's not really a core question for the LAV Filters thread; any DirectShow filter may or may not be supported if the DirectShow API is supported at all.

nautilus7
10th January 2017, 18:59
Hi, does LAV filters support DSD format (the audio format found in SACD)?

I have some .dff files and while ffplay plays them correctly, LAV in mpc-hc can't open them. Here (https://drive.google.com/open?id=0B5mWdAHFT9Xwd3QtRnRsWEpQLU0) is a sample of such a file.

SeeMoreDigital
10th January 2017, 19:18
Hi, does LAV filters support DSD format (the audio format found in SACD)?

I have some .dff files and while ffplay plays them correctly, LAV in mpc-hc can't open them. Here (https://drive.google.com/open?id=0B5mWdAHFT9Xwd3QtRnRsWEpQLU0) is a sample of such a file.
Just in-case you did not know... MPC-BE (without LAV) is able to play your (6Ch) .dff sample ;)

nautilus7
10th January 2017, 19:35
Hi, I didn't know. Thanks.

So, it needs to be added in LAV filters I guess.

clsid
10th January 2017, 23:43
It plays ok with MPC-HC and LAV Filters when using the internal audio renderer of MPC-HC.

The standard audio renderer fails because the media type indicates the audio is 352800Hz. That is probably a bug in LAV Audio decoder (or rather FFmpeg).

nevcairiel
11th January 2017, 00:26
The standard audio renderer fails because the media type indicates the audio is 352800Hz. That is probably a bug in LAV Audio decoder (or rather FFmpeg).

No, DSD audio is this high sample rates when converted to PCM. Its not a bug. DSD itself is 1-bit audio at 2.8MHz sample rate, converted to PCM you usually use 1/8th sample rate, which is 352kHz, or 1/16th, which would be 172kHz (although ffmpeg chose the higher quality 1/8th mode)

There is even higher DSD variants, Double-rate, Quad-rate and Octuple-rate, which you can guess the sample rates of. ;)

So yes, LAV supports DSD playback converted to PCM, at the original high samplerate, and not every audio renderer supports those.
The default (internal) audio renderer of MPC-BE supports them I believe and resamples them to a hardware compatible format, so its more of a player thing and not related to LAV.