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]

Siso
9th June 2025, 09:15
Thanks for the sample, I can reproduce the issue. Will take a look.

Edit:
Fixed

Thank you for your quick response.

nevcairiel
20th June 2025, 11:18
LAV Filters 0.80

LAV Splitter
- NEW: Introduced the IURLSourceFilterLAV interface to allow opening URLs with custom user agent and referrer
- NEW: Added support for WebP images
- Changed: Increased the length of the advanced subtitle selection field, so its no longer cut off after 255 characters
- Changed: Improved buffering behavior on badly interleaved video files
- Fixed: Audio streams with an unknown/unsupported codec are no longer selected for playback, as long as others are present
- Fixed: Improved accuracy of reported FPS from AviSynth scripts

LAV Video
- NEW: D3D11 support for HEVC 4:2:2 and 4:4:4 hardware decoding
- NEW: Dolby Vision extension metadata is exported for renderers to use
- Changed: Added additional media types to support more video streams
- Changed: Updated dav1d for significant AV1 decoding improvements
- Fixed: Improved handling of H.264 4:4:4 files encoded by certain versions of x264
- Fixed: VP9 DXVA2/D3D11 decoding could result in artifacts on some clips
- Fixed: Decoding ProRes reports more accurate color details

LAV Audio
- Changed: Added support for additional ADPCM audio codecs


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

After a long wait, finally new update.
Headline change in this update, for me, D3D11 HEVC 4:2:2/4:4:4 support. Both in copy-back, and in theory in native, although I'm not sure if any renderer supports native (yet).

I do not currently plan to bring that to DXVA2 as well due to certain limitations, but maybe that changes in the future.

As always, report issues and regressions, in as much detail as possible.

lvqcl
20th June 2025, 21:02
Thanks!
LAV Filters 0.80
Headline change in this update, for me, D3D11 HEVC 4:2:2/4:4:4 support. Both in copy-back, and in theory in native, although I'm not sure if any renderer supports native (yet).


It seems that MPC VR supports 4:4:4 native (maybe it also supports 4:2:2, but I cannot test it right now).

But: I can get HEVC 4:4:4 8-bit native decode only if I manually enable AYUV format in LAV Video settings. If it's disabled then I get copyback with YV24.

No problems with 10-bit and 12-bit HEVC.

nevcairiel
20th June 2025, 21:28
That is expected, because AYUV is the 4:4:4 8-bit hardware surface format for the decoder. AYUV caused some issues in the past with some renderers, but maybe it should be enabled by now.

Note that 4:2:2 >8-bit native is not currently supported because LAV does not support Y210/Y216 output formats natively. I should probably add it at some point.

Blight
29th June 2025, 13:27
nev:
Is there a way to control the timeout on network connections? (.ts / .m3u8 streams)

I noticed that with some bad connections, the timeout can be ~20seconds, it would be nice to be able to control the timeout value.

tv-viewer
3rd July 2025, 07:05
The librempeg (https://github.com/librempeg/librempeg) fork of ffmpeg has added support for a number of codecs not supported in mainline ffmpeg, most notable to me being AC-4 due to its use in ATSC 3.0 broadcasts in the USA, Korea, and elsewhere. Can AC-4 support be added to LAV Filters?

v0lt
12th July 2025, 13:36
most notable to me being AC-4 due to its use in ATSC 3.0 broadcasts in the USA, Korea, and elsewhere.
Please provide recording files of real broadcasts with AC-4 audio (not tests, not demos).

tv-viewer
17th July 2025, 01:18
Please provide recording files of real broadcasts with AC-4 audio (not tests, not demos).
Happy to. Is there a preferred place to upload them?

v0lt
17th July 2025, 16:10
Happy to. Is there a preferred place to upload them?
drive.google.com, mega.io, www.dropbox.com, www.mediafire.com and other services.

ipanema
17th July 2025, 16:49
If I connect a custom DirectShow filter that only accepts samples in RGB format to the output of the LAV video decoder when D3D11 hardware acceleration is selected in the settings, will it output the RGB frames in GPU memory?

I know that the custom filter's input pin must also implement ID3D11DecoderConfiguration to receive samples in GPU memory.

But reading the source code suggests that only NV12 and some other YUV pixel formats can be output in GPU memory - for example in d3d11va.cpp we have:

CMediaType mt = m_pCallback->GetOutputMediaType();
if ((m_SurfaceFormat == DXGI_FORMAT_NV12 && mt.subtype != MEDIASUBTYPE_NV12) ||
(m_SurfaceFormat == DXGI_FORMAT_P010 && mt.subtype != MEDIASUBTYPE_P010) ||
(m_SurfaceFormat == DXGI_FORMAT_P016 && mt.subtype != MEDIASUBTYPE_P016) ||
(m_SurfaceFormat == DXGI_FORMAT_AYUV && mt.subtype != MEDIASUBTYPE_AYUV) ||
(m_SurfaceFormat == DXGI_FORMAT_Y410 && mt.subtype != MEDIASUBTYPE_Y410) ||
(m_SurfaceFormat == DXGI_FORMAT_Y416 && mt.subtype != MEDIASUBTYPE_Y416) ||
(m_SurfaceFormat == DXGI_FORMAT_YUY2 && mt.subtype != MEDIASUBTYPE_YUY2) ||
(m_SurfaceFormat == DXGI_FORMAT_Y210 && mt.subtype != MEDIASUBTYPE_Y210) ||
(m_SurfaceFormat == DXGI_FORMAT_Y216 && mt.subtype != MEDIASUBTYPE_Y216))
{
DbgLog((LOG_ERROR, 10, L"-> Connection is not the appropriate pixel format for D3D11 Native"));

SafeRelease(&pD3D11DecoderConfiguration);
}


So is LAV video decoder only capable of outputting frames in RGB format in CPU (not GPU) memory?

nevcairiel
17th July 2025, 21:55
So is LAV video decoder only capable of outputting frames in RGB format in CPU (not GPU) memory?

LAV Video can only output hardware frames in the same format as the decoder outputs them. First it would depend on the video you are decoding, as that would dictate the format, and secondly, RGB is not among those. Even if a video was RGB (eg. HEVC 4:4:4 in RGB), it would come out as AYUV/Y410 with a RGB color matrix instead.

LAV can certainly not convert any video to RGB as a hardware surface. If you require that, its on you to make happen.

ipanema
18th July 2025, 00:02
Thanks for confirming that. Sounds like the custom filter needs to accept nv12 to receive it in GPU memory, then use a shader to convert it to RGB, still in GPU memory.

ipanema
18th July 2025, 14:29
Just one more quick confirmation...

If the LAV decoder is configured to use D3D11, and it is outputting RGB (either because it is the only output format selected in the config window, or the downstream filter will only accept RGB), it will be outputting in CPU memory BUT the actual decoding will still be done in hardware (not using the software decoder)?

(So LAV will convert the decoded frames from NV12 in GPU memory to RGB in CPU memory for output.)

clsid
18th July 2025, 22:45
Yes, copyback mode can output/convert in all colorspace in cpu mem.

What does your custom filter do? Ideally it should support nv12/p010/etc.

tv-viewer
19th July 2025, 03:47
Please provide recording files of real broadcasts with AC-4 audio (not tests, not demos).
Couple of real ATSC 3.0 broadcasts from HDHomeRun:
WJCT-DT https://www.dropbox.com/scl/fi/8hcfd5hscr8cmd73gdpeq/WJCT.ts?rlkey=3fz6xh5n9cnnu57ql7ldwmgye&st=gdq04678&dl=0
KDAF-DT https://www.dropbox.com/scl/fi/63knsuhsdocns60oo82q0/KDAF.ts?rlkey=spa9qtat1n0dw1mdi8wa6klac&st=g9xho4xg&dl=0

v0lt
19th July 2025, 05:35
Thanks.
Checked in MPC-BE - plays.
Sent to ticket #8349 (FFmpeg) (https://trac.ffmpeg.org/ticket/8349#comment:96).

ipanema
20th July 2025, 14:38
Thanks - OK, think I've got it now.

Eventually hoping the filter will write text or other graphics directly onto the surface/texture in GPU memory - but it's early days so far! Still quite a bit to learn. Thanks again.

mclingo
26th July 2025, 21:35
I haven't got much DTSX material So I'm not sure how long I've had this issue when I play Dolby Atmos it correctly plays all the sounds on the correct speakers I have 5.1 .2 which is a 5.1 standard setup with two front height speakers. when I play DTSX it correctly plays the rear height out of the front heights But plays the front heights out of left and right where it should be summing both heights to the front heights, This works correctly in atmos so it can't be an issue with lav setup?

i have a yamaha V685 anyone any ideas

tebasuna51
27th July 2025, 09:14
LAV filters can't decode properly 3D audio from DTSX or Atmos. You need a proprietary decoder to do so (only Cavernize can decode EAC3 Atmos).
To obtain the 3D audio you need to tell the player to pass the Atmos or DTSX directly to your Yamaha for decoding.
Therefore, it can never be a problem with the LAV filters.

What is your player? Verify if have passtrough (bitstreaming HDMI) for audio TrueHD, Eac3, DTS...

mclingo
27th July 2025, 11:06
you can't get any height audio without using pass through, as atmos is perfectly fine it should tell you I'm already using bit streaming, this is just dts-x issue as far as I can tell

mclingo
27th July 2025, 11:59
I've actually had some progress with this using chat GPT Of all things, it told me to check what my front height present speakers were set to on my AVR which I just assumed was set correctly because atmos was working, however they were set to "overhead" and not "height" When they were set to it "height" it sent my front height audio out of my height speakers however it sent my rear height information out of my rear speakers, but as I don't have any rear heights having it come out of the might be better than come out of the front heights anyway.

I'm still not sure why it's not summing all high audio information to my front heights as my AVR is definitely set up as 5.1.2

tebasuna51
28th July 2025, 09:23
If you use always passtrough the problem concern always to your AVR YAMAHA RX-V685, maybe you can open other thread out off this LAV filter thread.

I have a Denon AVR and I can't help you with your Yamaha, sorry.

mclingo
28th July 2025, 13:07
out of interest, in LAV audio options, what should be ticked their for my setup, 5.1.2 using front heights to sum all height audio - I currently have expand 6.1 to 7.1 ticked, use legacy 5.1 layout ticked and convert to standard channels is unticked. Thoughts?

huhn
28th July 2025, 14:41
only matters for PCM if you are bit streaming and rare formats that may not be supported.

you have to know if you have the legacy 5.1 or "modern" 5.1 as a base layout.

mclingo
28th July 2025, 15:10
thanks for the info, not sure what you mean by modern or base, my AVR is set to BASIC which is 5.1.2 front height presence, maybe its normal behaviour, maybe ATMOS sums all height audio to whatever height speakers you have setup and DTS sends front height audio to front and if you dont have back heights it sends them to back surround, kind of makes sense, just thought someone might know if that was the case.

tebasuna51
29th July 2025, 10:14
out of interest, in LAV audio options, what should be ticked their for my setup, 5.1.2 using front heights to sum all height audio - I currently have expand 6.1 to 7.1 ticked, use legacy 5.1 layout ticked and convert to standard channels is unticked. Thoughts?
As I mentioned before, this is excluded from LAV filters when the source is Atmos or DTSX audio, as they cannot be properly decoded.

However, if these formats have been previously decoded to PCM 5.1.2, as I explained in Surround 3D (https://forum.doom9.org/showthread.php?t=186285) (I don't know how for DTSX), it would be interesting to investigate how a player that uses LAV filters can send that PCM to an AVR.

In my specific case, a Denon AVR, I was only able to achieve this with a trick (https://forum.doom9.org/showthread.php?p=2017560#post2017560), as any configuration I used failed to recognize the high front channels.

mclingo
29th July 2025, 10:55
right got you, I think I have it setup now with something I can live with, not much DTS in my collection anyway so great, thanks.

clsid
29th July 2025, 12:05
MPC-HC audio switcher has a channel mapping feature that you could use to redirect those two channels.

mclingo
29th July 2025, 12:38
that would only work with PCM surely though?

clsid
29th July 2025, 13:00
Of course.

When bitstreaming, the audio stream is send in its original compressed form to the receiver, and the receiver is completely and totally responsible for doing ALL decoding / processing / channel mixing / volume control. No exceptions. On the PC side the audio can not be manipulated at all (unless it is transcoded).

tebasuna51
30th July 2025, 07:33
that would only work with PCM surely though?
Like I say in my thread:

"This way, whether mpc-hc decodes a correct EAC3/m4a/flac 5.1.2 or an AAC/Opus 7.1 with inverted 5.1.2 channels, the result will be the desired one: hearing the top channels through the fake back channels."

LAV filters can decode previously (if EAC3 you need unmark the bitstreaming for it) and after the AudioSwitcher do the job.
I recommend m4a generated by ffmpeg with libfdk

Kurt.noise
25th August 2025, 14:22
Not sure if this is the right place to ask new request but is it possible to have the APV codec support since its officially available through FFmpeg 8.0 release ?

:thanks:

v0lt
25th August 2025, 14:48
Not sure if this is the right place to ask new request but is it possible to have the APV codec support since its officially available through FFmpeg 8.0 release ?
1. First, tell us what you need this codec for? :rolleyes:
2. Where is this codec used?
3. Please provide samples with this codec. Files should not be made in FFmpeg.

Kurt.noise
25th August 2025, 15:03
1. First, tell us what you need this codec for? :rolleyes:
why not ? why we have RealVideo, FLV1, VP3 in there ? Noone use them nowadays :rolleyes:
2. Where is this codec used?
All Android 16 devices (https://www.androidauthority.com/android-16-beta-1-3518608/) + Samsung stuff, mpv and related players, not enough for you ?
3. Please provide samples with this codec. Files should not be made in FFmpeg.
https://forum.doom9.org/showthread.php?t=185868

v0lt
25th August 2025, 16:09
why not ? why we have RealVideo, FLV1, VP3 in there ? People have old video files. :rolleyes:
People have old video files.
All Android 16 devices + Samsung stuff, mpv and related players, not enough for you ?
This does not answer the question of what this codec is used for.
https://forum.doom9.org/showthread.php?t=185868
There are no samples except one test file encoded with FFmpeg.

LigH
25th August 2025, 16:27
The media-autobuild suite added support for this high quality high resolution intermediate codec, similar to Apple ProRes.

The APV codec is a professional video codec, which was developed in response to the need for professional level high quality video recording and post production. The primary purpose of the APV codec is for use in professional video recording and editing workflows for various types of content.

https://github.com/AcademySoftwareFoundation/openapv (raw samples in test subdir)