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

nevcairiel
22nd February 2022, 19:19
Use the Header Editor in mkvmerge on your existing file, and check the missing track for "Track enabled". If its present and set to "No", then the audio will be skipped.
Nothing in your screenshot shows anything regarding that, you even selected the wrong track if DTS-HD is supposed to be missing.

Its the only reasonable explanation for a MKV audio track to not show - because thats what the MKV spec says should happen. Otherwise the only thing I can tell you is that I need a sample.

bananenmann
22nd February 2022, 23:07
No, the last Picture was another Video File. In that File I tried to set the DTS-HD Audio Track as the first and default track - as you can see it in my MKVToolnix Picture. MPC-HC offers me the DTS-HD Track as the default one (as it should be), then the second one: Dolby Digital Plus 7.1 Track is missing and the True-HD and the normal Dolby Digital Track are visible again.... My first Post was a different file: There I put the 7.1 Dolby Digital Plus Track as the default first track and the DTS-HD track as the second track. It seems that always the second Track is missing. There the DTS-HD Track was missing.

But you are Right, I did a mistake: I always thought that in the bottom window there has to be a green checkmark for the Element to be copied with. I didn't see that each track has to be separately aktivated in the right window (I don't mean "Standard Track" and even not "Forced Track" - but as you said the Track on it's own has to be enabled there as well. In my last Picture all elements have a green checkmark, but you can see that in the right window the 7.1 Dolby Ditgital Plus Track is NOT enabled. And that is exatly the one Audio Track which is missing in that file while playing it with MPC-HC.

A little bit confusing, because I always have ALL tracks in the right window disabled - only the default and forced tracks are enabled ... and everything worked. I could always choose between all tracks (Audio and Subtitle). But since I have such a lot Audio Tracks (more than two) in one file this behaviour happened. So sorry for disturbing you - it was my fault. Maybe it would be better in MKVToolnix when a copied, but disabled track is tried to be muxed in a MKV - that there is a warning Message or a red checkmark or something like this.

Have a nice evening ;)

nevcairiel
28th February 2022, 15:27
LAV Filters 0.76.1

LAV Splitter
- Changed: When requesting a HTTP URL, the URL itself is send as a referrer to increase compatibility
- Fixed: The priority of "Default" subtitle tracks in MKV files was wrong when a forced track was present

LAV Video
- Changed: Improved color reporting for DVD menus/subtitles
- Fixed: D3D11 surface clearing did not work properly on Intel GPUs

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

If you missed 0.76, the release notes are here (https://forum.doom9.org/showthread.php?p=1961924#post1961924)

Only a collection of small fixed on top of 0.76, before I dive into some bigger changes and these won't get out for quite a while.

clsid
28th February 2022, 17:37
Thanks!

Can you reveal anything about those changes that you are planning?

ryrynz
28th February 2022, 19:04
Yeah.. I miss those MadVR and LAV big dev periods. Plz share [emoji4]

wojak
2nd March 2022, 11:20
LAV Filters 0.76.1

LAV Splitter
- Changed: When requesting a HTTP URL, the URL itself is send as a referrer to increase compatibility
- Fixed: The priority of "Default" subtitle tracks in MKV files was wrong when a forced track was present

LAV Video
- Changed: Improved color reporting for DVD menus/subtitles
- Fixed: D3D11 surface clearing did not work properly on Intel GPUs

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

If you missed 0.76, the release notes are here (https://forum.doom9.org/showthread.php?p=1961924#post1961924)

Only a collection of small fixed on top of 0.76, before I dive into some bigger changes and these won't get out for quite a while.

Hi, @nevcairiel

I have a problem with bitstreaming DTSWAV files (in MPCHC).
The passthrough option for DTS in WAV files just does not work. It works in avi, m2ts and other video files but not in wav. There is no sound at all. The music palys only if I check "fallback to PCM" option.

Here is my discussion with clsid2 on github on that topic:
https://github.com/clsid2/mpc-hc/issues/1555

tiben20
12th March 2022, 05:49
Just a heads up for those who are interested. I managed to add direct3d 12 hardware decoding in lavfilters.
https://github.com/tiben20/LAVFilters
I based my work on the fork Steve Lhomme did on vlc.
So far most of h264,hevc, vp9, vc1 codecs works.
Of course since there is no d3d12 directshow renderer at the moment its kinda useless. I started today a fork to add d3d12 rendering in the mpc videorenderer from the mpc-be team.

I only did this because i love contributing to the open source community. I don't think the d3d11 hardware acceleration will be beat in a near future but at least its a first step into direct3d 12

huhn
12th March 2022, 12:44
i can't wait. maybe something in d3d12 works with amd cards!

clsid
12th March 2022, 14:00
Afaik the D3D12 stuff is basically just same as D3D11 but with a somewhat simplified API. So don't get your expectations up to high.

I suggest testing if your AMD issues also occur with the Movies&TV player from Windows.

kasper93
12th March 2022, 14:42
i can't wait. maybe something in d3d12 works with amd cards!

Wait a sec... What is not working on AMD cards?

Of course since there is no d3d12 directshow renderer at the moment its kinda useless.

If you implement cpu copyback (which is trivial to plug into old code) or D3D11/D3D12 interop so you can send surface to say madVR it will work fine at least as experimental decoder.

Anyway I don't think there is any gain of using D3D12 at this moment. It is just an API on top of the same hardware decoder. Maybe adding video processing (like deinterlacing) to LAV would be more fun? :)

huhn
12th March 2022, 15:00
Wait a sec... What is not working on AMD cards?

pretty much everything.
https://abload.de/img/goodonehcjnw.png
we are neem through this a couple of times on the decoder thread.
decoding is pretty much the only thing that kind of works as it should be.

clsid
12th March 2022, 15:21
A good place to get attention from AMD support staff is in the driver feedback topics on Reddit (https://old.reddit.com/r/Amd/comments/t0lldp/radeon_software_adrenalin_2223_release_notes/). They are active there, so better place than their own forums. Best moment to post is shortly after a new driver release.

tiben20
12th March 2022, 16:27
Afaik the D3D12 stuff is basically just same as D3D11 but with a somewhat simplified API. So don't get your expectations up to high.

I suggest testing if your AMD issues also occur with the Movies&TV player from Windows.
I would not say its simplified but i agree with there is no benefit in using it.
I only like the fact that lavfilters can do it all. I stopped coding in c++ in 2011, i was the one who started the prototype in xbmc and nevcairiel took over. He kinda added everything that is humanly possible in the filters since then. I wanted to start c++ again after this long long break so finding something that wasn't already there was a challenge so i did this :P

kasper93
12th March 2022, 16:31
pretty much everything.
https://abload.de/img/goodonehcjnw.png
we are neem through this a couple of times on the decoder thread.
decoding is pretty much the only thing that kind of works as it should be.
Oh, I thought we are talking decoding only. There are severe issues otherwise indeed.

A good place to get attention from AMD support staff is in the driver feedback topics on Reddit (https://old.reddit.com/r/Amd/comments/t0lldp/radeon_software_adrenalin_2223_release_notes/). They are active there, so better place than their own forums. Best moment to post is shortly after a new driver release.
Good luck. Unless you have a insider who can push tasks forward you will have hard time getting enough attention with such "minor" issue. And I say "minor", because it really looks like AMD doesn't care much about their video processing.

I tried few years back to get them to fix crashes (in Overwatch) which was caused by hardware decoding of exported 4k clips there. I tried support, so I was replying to same responses "have you tried latest drivers", I probably exchanged like 12 emails and never got past the first line "gtfo" support. I tried reddit and while I got even response, it is not like it would move forward. Eventually they fixed the issue few months after introducing it, but well I lost all interest in trying to report thing to them through "proper" channels.

It is clear that they have not enough resources in their "video team", I don't believe those issues with deinterlacing (or video levels) are not known to them. And probably there are hardware issues. Anyway sorry for rant.

I would not say its simplified but i agree with there is no benefit in using it.
I only like the fact that lavfilters can do it all. I stopped coding in c++ in 2011, i was the one who started the prototype in xbmc and nevcairiel took over. He kinda added everything that is humanly possible in the filters since then. I wanted to start c++ again after this long long break so finding something that wasn't already there was a challenge so i did this :P

Once it is implemented in ffmpeg, there is probably no reason not to implement it in LAV too. What is the status of those ffmpeg changes? Is someone working on upstreaming it (as I understand you copied the changes from some vlc fork), or it is dead?

nevcairiel
12th March 2022, 16:57
Once it is implemented in ffmpeg, there is probably no reason not to implement it in LAV too.

Maintenance burden, unless a clear benefit or use is demonstrated, "just because" is not much of a reason anymore. Entirely new hardware APIs are not just a single line in a table somewhere like codecs are.

If one were to look for a task in hardware acceleration, there is implementing AV1 filmgrain with hardware decoding for d3d11 (dxva2 was not extended by MS for this). Just needs a modern Intel GPU to do it, and I don't have one. :) (NVIDIA does it magically without needing to run the API for it, no clue about AMD)

kasper93
12th March 2022, 16:59
Maintenance burden, unless a clear benefit or use is demonstrated, "just because" is not much of a reason anymore. Entirely new hardware APIs are not just a single line in a table somewhere like codecs are.

That I agree...

clsid
12th March 2022, 17:52
@tiben20
If you want to implement something that involves both LAV and FFmpeg, then I would suggest: AC3 encode option for bitstreaming (over S/PDIF)

Which would do the following for audio formats for which bitstreaming isn't enabled or possible:
mix to 5.1, resample to 48kHz, convert to AC3

Of course, assuming nevcairiel would accept a patch for adding that.

tiben20
12th March 2022, 17:53
Maintenance burden, unless a clear benefit or use is demonstrated, "just because" is not much of a reason anymore. Entirely new hardware APIs are not just a single line in a table somewhere like codecs are.

If one were to look for a task in hardware acceleration, there is implementing AV1 filmgrain with hardware decoding for d3d11 (dxva2 was not extended by MS for this). Just needs a modern Intel GPU to do it, and I don't have one. :) (NVIDIA does it magically without needing to run the API for it, no clue about AMD)
I totally agree with you on that one. Specific hardware bugs would be a nightmare for no benefit. In this apis they dumped so much stuff on the developer side that was previously handle by the driver.
I will still keep working on it even if i know their no benefit.
@tiben20
If you want to implement something that involves both LAV and FFmpeg, then I would suggest: AC3 encode option for bitstreaming (over S/PDIF)

Which would do the following for audio formats for which bitstreaming isn't enabled or possible:
mix to 5.1, resample to 48kHz, convert to AC3

Of course, assuming nevcairiel would accept a patch for adding that.
My knowledge on the audio side is pretty close to none. I started c++ because i liked xbmc(kodi) and i wanted to be the first to integrate dxva to it which did. Ill stick on the video side :)

ryrynz
14th March 2022, 09:54
Ill stick on the video side :)

Opening Post legend in the forum, very cool.

mark0077
16th March 2022, 00:49
Guys I'm only noticing the bwdif de-interlacer now in LAV Video, that's really cool. I have always used LAV Video in software mode, and still do with my latest machine (5950x, RTX 3080). It sparked my interest in again looking to see what the best de-interlacer I could use is for the rare occasion I throw on some interlaced DVDs. What would you guys recommend that still do de-interlacing. Yadif/bwdif in lav filters, vs madVR de-interlacing (with some specific settings to make sure it uses motion adaptive deinterlacing by the gpu, like use of some form of hardware decoding instead of software?)

ryrynz
16th March 2022, 10:05
what the best de-interlacer I could use is for the rare occasion I throw on some interlaced DVDs.

I switch to CUVID and get the hardware to work, nothing beats it.
Would be nice to have a rule or option that did it automatically.

mark0077
16th March 2022, 19:41
I switch to CUVID and get the hardware to work, nothing beats it.
Would be nice to have a rule or option that did it automatically.

Oh yeah, I see it marked as old. Is it still as sort of bit perfect as software decoding would be, for progressive material that is? I would leave it on it for handiness sake if it was. Otherwise yeah itd be amazing if a different renderer could be chosen based on say if it was mpeg2, or better still, deinterlaced :) I guess that's the lowest priority feature request in history :)

mzso
18th March 2022, 18:37
Hi!

I had a longstanding issue of the screen going green with SmartDVB with SD channels. I just figured out it's because I had DX11 HW acceleration enabled for mpeg-2. It works normally with software decoding, and DXVA (with which deinterlacing doesn't work instead.)

Sunspark
18th March 2022, 19:19
I saw a news item about dAV1d 1.0.0 today, so I decided to check out AV1.

Sample test clips here: http://download.opencontent.netflix.com/?prefix=AV1/Chimera/

I don't think I like the look of AV1 in this test, something seems harsh and cold about it to me. On my dual-core Broadwell CPU, it does play at about 70% CPU usage in copy-back mode run through DXVA scaling so that's nice to see. Setting it to dxva2-native drops the cpu usage to about 35% which eliminates the CPU fan whine.

That said, I wonder if there is a bug? The filename in the clip says 23.97 as does the titles in it, but the PIN info for LAV video decoder says 25. Is it playing at the wrong FPS?

Sunspark
18th March 2022, 21:29
As a postscript to my previous post on AV1 observations, I believe there may also be an issue with DXVA2 copy-back video decoding. The observations for #24776 and this are made with LAV 76.1.

With a normal SDR H.264 video, I observed that colours looked more saturated and black levels slightly deeper compared to DXVA2 copy-back in the following modes: None, DXVA2 Native, Intel Quicksync. These 3 modes presented the same. With DXVA2 copy-back it did not look bad, but I observed that blacks seemed raised slightly and colours were not quite as saturated. This is a difference in presentation.

To add to this, with the AV1 test video in #24776, I observed that with the Intel Quicksync decoding mode, it did not require 70% CPU. It was functioning under the same conditions at 35-40%. The complaint I had about "harsh and cold" changed, "cold" was removed as colours looked more natural and not as much blue.

I believe there is a bug with DXVA2 copy-back decoding in 76.1 affecting both colour&black levels as well as CPU usage which does not occur with the other decoders.

Update: In the video decoder settings where it says "Hardware device to use", if I change it from having my Intel GPU listed, to "Automatic" this resolves the colour issue with DXVA2 copy-back. Curious.

lvqcl
18th March 2022, 23:31
What GPU do you use for h/w decoding of AV1?

clsid
18th March 2022, 23:43
The Intel QuickSync decoder in LAV is deprecated and does not support AV1 or HEVC. So selecting that essentially just gives software decoding.

Broadwell does not support AV1 at all either. It does not even have proper HEVC10 decoding.

huhn
21st March 2022, 03:19
I saw a news item about dAV1d 1.0.0 today, so I decided to check out AV1.

Sample test clips here: http://download.opencontent.netflix.com/?prefix=AV1/Chimera/

I don't think I like the look of AV1 in this test, something seems harsh and cold about it to me. On my dual-core Broadwell CPU, it does play at about 70% CPU usage in copy-back mode run through DXVA scaling so that's nice to see. Setting it to dxva2-native drops the cpu usage to about 35% which eliminates the CPU fan whine.

That said, I wonder if there is a bug? The filename in the clip says 23.97 as does the titles in it, but the PIN info for LAV video decoder says 25. Is it playing at the wrong FPS?

these are obu files they don't seem to have any frame rate what so ever.

and lavfilter likes to use 25 for files that don't have a frame rate like images.
changing that is most likely not worth the risk breaking anything.

tiben20
21st March 2022, 08:37
Here is the progress of the addition of d3d12 to lavfilters and mpcvideorenderer

What i done so far
Lavfilters
d3d12 rendering via hardware decoder is working and is stable
Reference frame are handled via the codec which was something added in d3d12
Added settings so you can desactivate d3d12 if you don't want to use them
Copyback is working but there absolutely no reason to use it.

Mpcvideorenderer
Autodetection of the input file to select the correct renderer
Settings are now independant per renderer
Bilinear bicubic lankzos upsampling are working still need to work on the downsampling
Rendering is stable i had some problems when switching video but its working great now
I wrote a complete pipeline to render custom geometry and font like d3d11 was doing before.
Color conversion are working as expected will need to test more sample but so far so good.

4 april 2022
Hardware and software rendering works
Scaling work really well
Subtitles are working
IMFVideoMixerBitmap works
Graphs is rendering without being cut by the scaling
19 april update
Upscale, downscale ,chromaupsampler, image doubler and post shaders are now dynamic script with options


Ill be happy to answer every question.
https://github.com/tiben20/VideoRenderer/commits/d3d12
https://github.com/tiben20/LAVFilters/commits/d3d12_decoder

huhn
21st March 2022, 11:11
Afaik the D3D12 stuff is basically just same as D3D11 but with a somewhat simplified API. So don't get your expectations up to high.

I suggest testing if your AMD issues also occur with the Movies&TV player from Windows.

good idea but it is microsoft...
https://abload.de/img/microsoftmsj2w.png
what a world we live in.
this is just wrong.

scaler and level are fine deint is broken.

tebasuna51
14th April 2022, 12:34
Bug in LAV filters (https://github.com/Nevcairiel/LAVFilters/issues/483) playing WAV's multichannel. More Info (https://forum.doom9.org/showthread.php?p=1966828#post1966828).

In LAVFilters-0.76.1\demuxer\Demuxers\LAVFStreamInfo.cpp there are:
else if ((mtype.subtype == MEDIASUBTYPE_PCM || mtype.subtype == MEDIASUBTYPE_IEEE_FLOAT) &&
avstream->codecpar->codec_tag != WAVE_FORMAT_EXTENSIBLE)
{
// Create raw PCM media type
mtype.pbFormat = (BYTE *)g_AudioHelper.CreateWFMTEX_RAW_PCM(avstream, &mtype.cbFormat, mtype.subtype,
&mtype.lSampleSize);
}
I suggest:
else if ((mtype.subtype == MEDIASUBTYPE_PCM || mtype.subtype == MEDIASUBTYPE_IEEE_FLOAT))
{
// Create raw PCM media type
mtype.pbFormat = (BYTE *)g_AudioHelper.CreateWFMTEX_RAW_PCM(avstream, &mtype.cbFormat, mtype.subtype,
&mtype.lSampleSize);
}
For what exclude PCM INT/FLOAT WAVE_FORMAT_EXTENSIBLE header by managed by CreateWFMTEX_RAW_PCM?
Only in this subrutine (LAVFilters-0.76.1\demuxer\Demuxers\LAVAudioHelper.cpp) is read the dwChannelMask:

dwChannelMask = (DWORD)avstream->codecpar->channel_layout;

Without dwChannelMask defined the default is assigned in LAVFilters-0.76.1\decoder\LAVAudio\Media.cpp:

static const scmap_t m_scmap_default[] = {
// FL FR FC LFe BL BR FLC FRC
{1, 0}, // Mono M1, 0
{2, 0}, // Stereo FL, FR
{3, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER}, // 3/0 FL, FR, FC
{4, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY}, // 3/1 FL, FR, FC, Surround
{5, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT}, // 3/2 FL, FR, FC, BL, BR
{6, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_SIDE_LEFT|SPEAKER_SIDE_RIGHT}, // 3/2+LFe FL, FR, FC, BL, BR, LFe
{7, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT|SPEAKER_BACK_CENTER}, // 3/4 FL, FR, FC, BL, Bls, Brs, BR
{8, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_SIDE_LEFT|SPEAKER_SIDE_RIGHT|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT},// 3/4+LFe FL, FR, FC, BL, Bls, Brs, BR, LFe
};
Where I suggest replace the defaults:
{4, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_SIDE_LEFT|SPEAKER_SIDE_RIGHT}, // 2/2 FL, FR, SL, SR
{5, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_SIDE_LEFT|SPEAKER_SIDE_RIGHT}, // 3/2 FL, FR, FC, SL, SR
{6, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_SIDE_LEFT|SPEAKER_SIDE_RIGHT}, // 3/2+LFe FL, FR, FC, LFE, SL, SR
{7, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_SIDE_LEFT|SPEAKER_SIDE_RIGHT|SPEAKER_BACK_CENTER}, // 3/3+LFe FL, FR, FC, LFE, BC, SL, SR
{8, SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_SIDE_LEFT|SPEAKER_SIDE_RIGHT|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT},// 3/4+LFe FL, FR, FC, LFE, BL, BR, SL, SR

nevcairiel
14th April 2022, 14:39
For what exclude PCM INT/FLOAT WAVE_FORMAT_EXTENSIBLE header by managed by CreateWFMTEX_RAW_PCM?


WAVE_FORMAT_EXTENSIBLE is handled just below, extracting information from the WAVEFORMATEXTENSIBLE header and re-using it as-is, instead of trying to re-create it.

tebasuna51
14th April 2022, 16:08
WAVE_FORMAT_EXTENSIBLE is handled just below, extracting information from the WAVEFORMATEXTENSIBLE header and re-using it as-is, instead of trying to re-create it.

else
{
WAVEFORMATEX *wvfmt = g_AudioHelper.CreateWVFMTEX(avstream, &mtype.cbFormat);

AudioHelper.CreateWVFMTEX never assign dwChannelMask

Like you can see that don't work at all (https://forum.doom9.org/showthread.php?p=1966828#post1966828).

nevcairiel
14th April 2022, 17:53
else
{
WAVEFORMATEX *wvfmt = g_AudioHelper.CreateWVFMTEX(avstream, &mtype.cbFormat);

AudioHelper.CreateWVFMTEX never assign dwChannelMask


CreateWVFMTEX doesn't even touch WAVEFORMATEXTENSIBLE at all (it only works on the much smaller WAVEFORMATEX), hence its logically incapable of ever touching that field - instead it copies the WAVEFORMATEXTENSIBLE extension from the container, and "assigns" it that way - as a result, it will have assigned that field.

But I don't think your file even runs through that code.


Like you can see that don't work at all (https://forum.doom9.org/showthread.php?p=1966828#post1966828).

Thats not the reason it doesn't work. In fact, you should check the generated media type by LAV Splitter, it clearly includes the dwChannelMask correctly already - its just not being used because you are using raw PCM with a decoder filter, which it wasn't designed for, instead of connecting it straight to the audio renderer, as I already pointed out in the other thread.

In any case I'm not going to explain my code any further. If you want to suggest changes, you should verify they actually fix your issue (by compiling and testing). Or just show some patience until I work on the next version and maybe consider your issue. Just because I haven't instantly fixed it doesn't mean I don't know whats going on. Its just a matter of time management.

clsid
14th April 2022, 18:27
Here is patch to ignore standard PCM:
https://github.com/clsid2/LAVFilters/commit/6142b012544c5021a75e8195e6ca6eeefd09aba3

tebasuna51
15th April 2022, 12:09
Here is patch to ignore standard PCM:
https://github.com/clsid2/LAVFilters/commit/6142b012544c5021a75e8195e6ca6eeefd09aba3

Thanks clsid, but cancel the use of internal LAV Filter make than mpc-hc (MPC-HC.1.9.20.56.x64) use the external DirectShow filter installed.

To work with this I need uninstall the external LAV Filters and install your old ffdshow filters, and I can't recommend that at all. I make this only for test (and work) but it is not a solution. Please revert to previous state, we need solve the problem in LAV Filters (external and internal)
...Or just show some patience until I work on the next version and maybe consider your issue. Just because I haven't instantly fixed it doesn't mean I don't know whats going on. Its just a matter of time management.
Of course, take your time. I only want to help found the solution.
Maybe I was wrong and for this I say "suggest".
Excuse me if I add some comments:

In fact, you should check the generated media type by LAV Splitter, it clearly includes the dwChannelMask correctly already - its just not being used because you are using raw PCM with a decoder filter, which it wasn't designed for, instead of connecting it straight to the audio renderer,...

Of course, and work fine connecting the Splitter to Render but GraphStudio and mpc-he (or mpc-be) insist in include the Audio Decoder between the Splitter and Render and I don't know for what the dwChannelMask read correctly by the splitter (in mpc-hc or GraphEdit):
Audio: PCM 48000Hz 4ch 3072kbps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 8
cbFormat: 40

WAVEFORMATEX:
wFormatTag: 0xfffe
nChannels: 4
nSamplesPerSec: 48000
nAvgBytesPerSec: 384000
nBlockAlign: 8
wBitsPerSample: 16
cbSize: 22 (extra bytes)

WAVEFORMATEXTENSIBLE:
wValidBitsPerSample: 16
dwChannelMask: 0x00000603 OK
SubFormat: {00000001-0000-0010-8000-00AA00389B71} MEDIASUBTYPE_PCM

pbFormat:
0000: fe ff 04 00 80 bb 00 00 00 dc 05 00 08 00 10 00 þÿ..?»...Ü......
0010: 16 00 10 00 03 06 00 00 01 00 00 00 00 00 10 00 ................
0020: 80 00 00 aa 00 38 9b 71 ?..ª.8?q
is not traslated be the decoder to the output pin:
Filter : LAV Audio Decoder - CLSID : {E8E73B6B-4CB3-44A4-BE99-4F7BCB96E491}
Pin [OUT]
- Connected to:

CLSID: {18C16B08-6497-420E-AD14-22D21C2CEAB7}
Filter: Audio Switcher
Pin: 4i220.wav

- Connection media type:

Audio: PCM 48000Hz 4ch 3072kbps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 8
cbFormat: 40

WAVEFORMATEX:
wFormatTag: 0xfffe
nChannels: 4
nSamplesPerSec: 48000
nAvgBytesPerSec: 384000
nBlockAlign: 8
wBitsPerSample: 16
cbSize: 22 (extra bytes)

WAVEFORMATEXTENSIBLE:
wValidBitsPerSample: 16
dwChannelMask: 0x0000000f WRONG
SubFormat: {00000001-0000-0010-8000-00AA00389B71}

pbFormat:
0000: fe ff 04 00 80 bb 00 00 00 dc 05 00 08 00 10 00 þÿ..?»...Ü......
0010: 16 00 10 00 0f 00 00 00 01 00 00 00 00 00 10 00 ................
For what the Audio Decoder show like input:
Filter : LAV Audio Decoder - CLSID : {E8E73B6B-4CB3-44A4-BE99-4F7BCB96E491} cbSize: 0 (extra bytes)
Pin [IN]
- Connected to: pbFormat:
0000: 00 00 01 00 01 00 04 00 80 bb 00 00 00 dc 05 00 ........?»...Ü..
CLSID: {B98D13E7-55DB-4385-A33D-09FD1BA26338} 0010: 08 00 10 00 00 00 00 00 ........
Filter: LAV Splitter Source (internal)
Pin: Audio

- Connection media type:

Audio

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: Unknown GUID Name {AFBC2343-3DCB-4047-9655-E1E62A61B1C5}
formattype: Unknown GUID Name {35189950-CAC9-4C8D-819D-B6FAEE15DD9D}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 256000
cbFormat: 24

WAVEFORMATEXFFMPEG:
nCodecId: 0x10000

WAVEFORMATEX:
wFormatTag: 0x0001
nChannels: 4
nSamplesPerSec: 48000
nAvgBytesPerSec: 384000
nBlockAlign: 8
wBitsPerSample: 16
cbSize: 0 (extra bytes)

pbFormat:
0000: 00 00 01 00 01 00 04 00 80 bb 00 00 00 dc 05 00 ........?»...Ü..
0010: 08 00 10 00 00 00 00 00 ........
losing the dwChannelMask info.

Just for fun, seems than the LAV Splitter assign other default for 4 channels when the input file is a wav with simple header (without ChannelMask info):
Audio: PCM 48000Hz 4ch 3072kbps SIMPLE HEADER WITHOUT ChannelMask

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 8
cbFormat: 40

WAVEFORMATEX:
wFormatTag: 0xfffe
nChannels: 4
nSamplesPerSec: 48000
nAvgBytesPerSec: 384000
nBlockAlign: 8
wBitsPerSample: 16
cbSize: 22 (extra bytes)

WAVEFORMATEXTENSIBLE:
wValidBitsPerSample: 16
dwChannelMask: 0x00000107 OTHER DEFAULT (FL FR FC BC)
SubFormat: {00000001-0000-0010-8000-00AA00389B71}

clsid
15th April 2022, 13:21
As a temporary solution you can simply disable PCM on formats tab in LAV Audio Settings to prevent it from being used. You could also register the LAV build from MPC-HC to use as external copy for use with other apps.

max79
17th April 2022, 15:04
Hello,

@nevcairiel:
When switching audio tracks using the "IAMStreamSelect" interface on a live stream, it sometimes triggers an EC_COMPLETE event, which ruins playback.
I have setting-"Remove Audio Decoder on Audio Stream Switch" enabled in "LAV Splitter".

Any feedback would be appreciated.

Sunspark
23rd April 2022, 05:51
I have an observation of different behaviour between two video renderers using the same LAV decoding method and wish to understand how come it works for one but not the other.

When LAV is set for DXVA2 (native), both video renderers are in D3D9 Exclusive mode and a 10-bit video file is played the following occurs:

MadVR- Screen is split, colours are pink and green. I've always known that copy-back is required for this type of file to play back properly.
MPCVR- Plays back no problem, colours are normal, screen is not split. Looking at the filter states that the active decoder is dxva2n and not software.

Why does MadVR require copy-back to have proper colours, but MPCVR does not?

clsid
23rd April 2022, 12:36
This is the place to report MadVR bugs:
http://bugs.madshi.net/view_all_bug_page.php?project_id=4

sebas_led
29th April 2022, 18:11
Hi:

I'm interesed on issue #355 https://github.com/Nevcairiel/LAVFilters/issues/355
So as first step I've checked the code of LAV Splitter https://github.com/Nevcairiel/LAVFilters/blob/master/demuxer/LAVSplitter/LAVSplitter.cpp
but I've noticed that LAVSplitter::GetCurrentPosition returns E_NOTIMPL
I can get the elapsed time when playing a http stream, but I receive 0 when trying to get the current play position in rtmp streams.

So how the graph knows what it's the elapsed time?

TIA
Sebas

nevcairiel
30th April 2022, 07:09
The graph manager manages the current position, the source is not necessarily involved - in fact, the source cannot always effectively know, because it does not know how much data is being buffered downstream.
The reference clock should have the accurate current position.

sebas_led
2nd May 2022, 22:27
Thanks Nev!
I'm trying to know why I can't get the elasped time of an rtmp stream like this: rtmp://inliveserver.com:1935/14102/14102
I've tested with a second stream from other stream with the same result.
I've analyzed the stream with Wireshark and the timestamp seems to be valid (said that, I'm not an expert on rtmp).
I'm also reading the source at https://github.com/Nevcairiel/LAVFilters/blob/master/demuxer/Demuxers/LAVFDemuxer.cpp trying to understand a little more about the issue.

Balling
15th May 2022, 15:15
Afaik the D3D12 stuff is basically just same as D3D11 but with a somewhat simplified API. So don't get your expectations up to high.

I suggest testing if your AMD issues also occur with the Movies&TV player from Windows.

D3d11on12 is a good thing. VRR can be controlled.

kasper93
15th May 2022, 15:25
D3d11on12 is a good thing. VRR can be controlled.Why? Why this is relevant to this thread?

Balling
18th May 2022, 13:45
Why? Why this is relevant to this thread?

For VFR video... All video on phones... MacOS already does it with its Promotion. Windows too with mpv. But there is no way to perfectly control VRR with d3d11. D3d12 allows manipulating VRR not just accounting for frames rendering.

huhn
18th May 2022, 15:53
and what has the decoder to do with that?
you can use DXVA native decode and still render on a dx12 surface.
it has nothing todo here.

Balling
18th May 2022, 22:00
and what has the decoder to do with that?
you can use DXVA native decode and still render on a dx12 surface.
it has nothing todo here.

That is what we do in chrome, sure.

VipZ
3rd June 2022, 14:30
Hi Nev,

With the aim to build LAV with VS 2022, I have added the below code within 3 files, platform.props, libbluray.vcxproj and IntelQuickSyncDecoder.vcxproj

<PropertyGroup Label="Configuration" Condition="'$(VisualStudioVersion)' == '17.0'">
<PlatformToolset>v143</PlatformToolset>
<SpectreMitigation>false</SpectreMitigation>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>

Have successfully complied all binaries, is there any unknown issue foreseen with this or should this be all ok?

Thanks

nevcairiel
7th June 2022, 16:01
I haven't really messed with VS2022 yet, but that should be fine.