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

Aleksoid1978
21st February 2018, 06:33
There is no Atmos/DTS:X decoder. ffmpeg can decode only TrueHD/DTS.

jaytrinitron
21st February 2018, 06:37
There is no Atmos/DTS:X decoder. ffmpeg can decode only TrueHD/DTS.

Oh yeah I had forgot there was nothing for PC that decodes that. But Atmos and DTS:X have a DTS-HD MA and TrueHD core right? And what about on the video side? Can I still put a UHD disc in and have MPC-HC play it, with HDR, 4k, 10 bit and all the rest (using LAV)?

nevcairiel
21st February 2018, 08:08
Oh yeah I had forgot there was nothing for PC that decodes that. But Atmos and DTS:X have a DTS-HD MA and TrueHD core right? And what about on the video side? Can I still put a UHD disc in and have MPC-HC play it, with HDR, 4k, 10 bit and all the rest (using LAV)?

If you have a way to decrypt the disc, it should work.

PCU
22nd February 2018, 16:54
i don't know why, but the quality of d3d11 hardware acceleration is so much better than intel quicksync.

Klaus1189
22nd February 2018, 17:47
I use latest versions of MPC-BE x64, LAV Filters and madVR and MPC-BE crashes when I play a file recorded with my STB. Going back to 0.71.0-5 works fine.

EDIT: reinstalled latest LAV 0.71.0-8, now it is fine. I don't know what it was.

P.J
23rd February 2018, 16:28
Why does AYUV use about twice more CPU rather than RGB32 for 4:4:4 10bit videos? :confused:

neno
23rd February 2018, 21:22
Hi, nevcairiel. I use lav 0.71 with latest madVR in D3D11 native mode, and the picture is always(no matter what video) split into the top and bottom part. The top part is the picture content turned into a flat size, and the bottom part is often a green image.
While D3D11 CB can just play normally.
I use WIN10 and a RX480.
Is there any idea about the problem?
Thanks.

nevcairiel
23rd February 2018, 21:27
Sounds like a driver problem to me. But you'll probably want to talk to madshi instead, since madVR handles the processing of "native" frames.

JarrettH
24th February 2018, 07:24
Did anything change with the audio mixing or DRC since the last stable version?

I can't decide now whether to use software or D3D11. Versus software, D3D11 is a bit faster on native 1080p movies and slightly slower when upscaling (for example 720p) is involved.

steakhutzeee
27th February 2018, 16:05
Hi, can you give me details about this?

D3D11 hardware accelerated decoding (native mode with madVR, Copy-Back otherwise).

Can't update lav/madvr now. This means in madvr there is a new D3D11 option?

Just curious, btw I'll update these days. Thanks :)

sneaker_ger
27th February 2018, 16:08
https://forum.doom9.org/showpost.php?p=1833761&postcount=22604

kolak
2nd March 2018, 15:38
PCs cannot stay in YUV. Its always RGB at some point. Basically you always have to feed RGB to the GPU, even if the GPU then outputs YUV again (which should therefor be avoided, if possible).

What about OpenGL?

nevcairiel
2nd March 2018, 15:55
The final frame buffer is always RGB.

kolak
2nd March 2018, 17:56
Thank you.
Is it really a problem assuming we convert YUV<=>RGB at high precision? All high-end grading/finishing tools operate on GPU so on RGB (even if source is YUV based) and no one really questions this.
I assume this is not end of the world (if done accurately) as at the end signal will became RGB anyway (at the display).

If we talk about pure transcoding then this should be avoided (as in this case it's much easier).

nevcairiel
2nd March 2018, 17:59
No, its perfectly fine. There is just a bit of loss in every YUV<->RGB conversion due to potential rounding, so if you do something like YUV (file) -> RGB (frame buffer) -> YUV (HDMI) -> RGB (display), thats a lot of conversions. Best would of course be to do YUV (file) -> RGB (everywhere else), but a lot of things don't necessarily support that.

kolak
2nd March 2018, 18:15
So in case of a player if you can send RGB over HDMI it's better to set output to RGB to limit number of conversions.

In the same time if you use e.g. DisplayPort 1.2+ connection to your "end monitor", which supports RGB for "all" signals (at least up to UHD 60p 10bit) then you don't really loose quality at all compared to some pro equipment which can send YUV data "as is" to monitor. In both cases you end up with 1x YUV->RGB conversion for YUV based source (assuming your player path is well designed). The difference is that conversion happens at different stage.
For high-end work which is RGB based (from source) you are actually gaining quality and reducing delay which is always present with additional pro cards (data has to go from GPU to the card).

pkirill
15th March 2018, 12:08
Hello Hendrik, thanks for the great project.
We are making an educational application (CoSpaces) and we need to be able to play mp4 and m4a audio in our app.
We have many target platforms: WebGL, iOS, Android, and Windows.
All we know that on Windows DirectShow stack does not support playing m4a out of the box.
So I have two questions here:

Is it possible to include you binaries into our app ?
Is it possible to use you binaries inside the app (in our process) without COM registration on the admin level, having only user level rights.
To build a FilterGraph over a m4a with you splitter in the process.

Thanks
-Kirill

LigH
15th March 2018, 12:34
LAV Filters is a DirectShow interface for the libavcodec / libavformat libraries, the kernels of the ffmpeg project. To create platform independent software, you may better focus on using the kernel libraries, rather than subtracting DirectShow from this one, I believe... mplayer derivates and VLC may be the more useful places to start from, IMHO.

pkirill
16th March 2018, 10:55
LAV Filters is a DirectShow interface for the libavcodec / libavformat libraries,

That is exactly what I need.
I need only windows implementation, all other plaforms has build in playing capabilities.

LigH
16th March 2018, 14:51
But you don't want to install them as DirectShow filters system-wide?

MPC-HC uses LAV Filters as "internal splitter/decoder", and the AviSynth plugin DSS2Mod (to be found e.g. in the Xvid4PSP project, or in the AviSynth Wiki) can do that as well. If you have developers who are able to read their C/C++ sources, you will most probably find how they do that directly, bypassing DirectShow automatic graph building.

clsid
16th March 2018, 15:51
Windows has native support for .m4a playback through Media Foundation.

manolito
16th March 2018, 16:31
Windows has native support for .m4a playback through Media Foundation.

Not WinXP... :D:D

pikaczu
17th March 2018, 13:22
I am using the mpc hc 1.7.15 program, I have given the aac file for the rehearsal, and there is such a thing, it's about time:

Klaus1189
17th March 2018, 14:35
I am using the mpc hc 1.7.15 program, I have given the aac file for the rehearsal, and there is such a thing, it's about time:

better use google drive or similar for posting pics, I cannot view your jpg right now, for example. It is still pending ...

LigH
17th March 2018, 14:44
https://frupic.frubar.net (sorry for suggesting this over and over, groundhog day again)

pikaczu
17th March 2018, 19:46
better use google drive or similar for posting pics, I cannot view your jpg right now, for example. It is still pending ...

good, please

https://images83.fotosik.pl/1019/e29588f59d353a85m.jpg (https://www.fotosik.pl/zdjecie/e29588f59d353a85)

LigH
17th March 2018, 19:56
It displays a playing time of 28:32:59; which other value would you have expected instead?

And BTW, this is a play time of an MKV, according to the window title, what do you mean with AAC? Did you try to load an external audio file in parallel? Missing details.

pikaczu
17th March 2018, 20:18
this is the time, after loading aac file.

nevcairiel
17th March 2018, 20:34
I have no plans to work on that. You should wrap your audio into an actual container if you are about its duration being accurate.

LigH
17th March 2018, 20:38
AAC has a variable bitrate. To estimate the playing time accurately, an application would have to collect statistics about the whole audio; a DirectShow decoder will not be able to do that until you have played the whole media already.

pikaczu
17th March 2018, 20:40
It is a pity that there will be no amendment.

how?

pkirill
19th March 2018, 12:25
Windows has native support for .m4a playback through Media Foundation.

It can not render it using FilterGraph.

But you don't want to install them as DirectShow filters system-wide?

I do not have an option to register it system wide.

MPC-HC uses LAV Filters as "internal splitter/decoder", and the AviSynth plugin DSS2Mod (to be found e.g. in the Xvid4PSP project, or in the AviSynth Wiki) can do that as well. If you have developers who are able to read their C/C++ sources, you will most probably find how they do that directly, bypassing DirectShow automatic graph building.

Thanks, will look at this.

LigH
19th March 2018, 12:35
No, Media Foundation is not DirectShow.

pkirill
20th March 2018, 16:44
No, Media Foundation is not DirectShow.

Right, i support what i need, looking at this now.
It seems that it is something I need.
Thanks

nevcairiel
20th March 2018, 18:37
You can do what you ask with LAV Filters, several other projects load it without registration, and bundling with apps is allowed within what the license allows.

tyrindor
20th March 2018, 22:13
Is there anyway to have advanced splitter mode ignore all subtitles labelled as "Signs"?

Right now I have it set to: "jpn:*|d;jpn:eng;*|f" but many releases flag "signs" as the default subtitle track for anime, and put english subtitles on track 2.

LigH
20th March 2018, 22:23
With "signs", they possibly mean "scene subtitles" (translations of readable signs only) in contrast to complete translations of the whole audible speech?

tyrindor
20th March 2018, 22:42
With "signs", they possibly mean "scene subtitles" (translations of readable signs only) in contrast to complete translations of the whole audible speech?

Yes, that's correct. I'd like to ignore them and select the next another english subtitle track if possible.

sneaker_ger
20th March 2018, 22:42
Is there anyway to have advanced splitter mode ignore all subtitles labelled as "Signs"?

Right now I have it set to: "jpn:*|d;jpn:eng;*|f" but many releases flag "signs" as the default subtitle track for anime, and put english subtitles on track 2.
Not really. I think the "!" operator doesn't work on track names (@nev: feature request?). Maybe you could do e.g.:
jpn:eng|!d jpn:eng
Then it would select the non-default English track first and only if that doesn't exist the first English track regardless of default/forced flagging.

tyrindor
20th March 2018, 23:09
Not really.

You could do e.g.:
jpn:eng|!d jpn:eng
Then it would select the non-default English track first and only if that doesn't exist the first English track regardless of default/forced flagging.

Well at least I can do that while watching shows that do this. Thanks.

I've been trying forever to get my subtitles to work automatically but there's so many releases with flagged "default" english subtitle tracks on english language content throwing me off. I can't get my anime to play well with them.

For example:
*|d;eng:*|f;jpn:eng

I would read this as "First set default track, if english is found enable english forced subs instead, if Japanese is found enable english subs instead. This doesn't work though, english audio content still has default subs selected. Putting *|d at the end instead has the same effect.

So what's the best way to achieve this in one command?
- If japanese audio is found enable english subs, if no english subs enable default subs.
- If english is found enable forced subs.
- If unknown language (or simply not english) enable default subs. <-this seems impossible without overwriting everything else.

Greatly appreciated...

sneaker_ger
20th March 2018, 23:26
For example:
*|d;eng:*|f;jpn:eng

I would read this as "First set default track, if english is found enable english forced subs instead, if Japanese is found enable english subs instead. This doesn't work though, some english audio content still has default subs selected.
Priority is from left to right. It stops after the first match. If "*|d" (which I assume is the same as "*:*|d") is there it will match any audio, any subtitle language as long as there is a track marked as "default". Nothing after that is considered anymore when such a match is found.

So what's the best way to achieve this in one command?
- If japanese audio is found enable english subs, if no english subs enable default subs.
- If english is found enable forced subs.
- If unknown language enable default subs. <-this is what I am struggling with, it always overwrites everything else.
If I strictly go by your description:
jpn:eng jpn:*|d eng:*|f *:*|d

But I also assume you want subtitles to be off for English audio unless there is English forced subs. You need an extra rule for that so it doesn't match the last rule which is basically a wildcard:
jpn:eng jpn:*|d eng:*|f eng:off *:*|d
And mostly you don't want any forced subtitles for English audio but also the English ones first:
jpn:eng jpn:*|d eng:eng|f eng:*|f eng:off *:*|d

You have to be exact.

tyrindor
20th March 2018, 23:39
Man you are a lifesaver, I've been tweaking it for days trying to figure it out. Just tested like 20 various problematic MKVs and it did them all correctly.

Thanks!

chros
21st March 2018, 10:55
@sneaker_ger: thanks for the detailed info, I didn't even know that feature exists :)

Grimsdyke
21st March 2018, 13:00
@ Nev. When using D3D11 and Automatic/Native I am getting sometimes green screens in MPC-BE (+ MadVR) especially on lower resolution files !! The file keeps playing and I hear the sound.
The only way to fix this seem to be to select the GPU in LAV video decoder settings. Please let me know if you need more details.

pkirill
21st March 2018, 13:33
You can do what you ask with LAV Filters, several other projects load it without registration, and bundling with apps is allowed within what the license allows.

Do you have any Idea how to do that ? In terms of C++.

LigH
21st March 2018, 13:57
As already mentioned...

MPC-HC uses LAV Filters as "internal splitter/decoder", and the AviSynth plugin DSS2Mod (to be found e.g. in the Xvid4PSP project, or in the AviSynth Wiki) can do that as well.

The amount of source code in DSS2Mod may be more manageable for reading and searching.

pkirill
22nd March 2018, 15:49
Well I managed to get it working, at least on my local machine:
I looks like that

LAVSplitterClassID = "171252A0-8820-4AFE-9DF8-5C92B2D66B04";
HMODULE hDLL = loadLibrary("LAVSplitter.ax");
LPFNGETCLASSOBJECT pFactory = GetProcAddress(HMODULE(hDll), "DllGetClassObject");
IClassFactory * pFactory = pFactory(LAVSplitterClassID, _uuidof(IClassFactory));
IUnknown *filter = pFactory.CreateInstance();
IBaseFilter *pfilter = filter->QueryInterface<IBaseFilter>();
graphBuilder->AddFilter( pfilter, L"LAVSplitter");


That`s it. Thanks.
And I un-registered the filters before tests.
Next I will try to add Media Foundation based playback.

anas
24th March 2018, 03:52
Well I managed to get it working, at least on my local machine:
I looks like that



That`s it. Thanks.
And I un-registered the filters before tests.
Next I will try to add Media Foundation based playback.

man, can you put dll file here?
i used DSS2mod before, but i need DSS load lav without reg because DSS2mod has some issues and admin system permissions don't allow me reg or install lav
thanks ..

LigH
24th March 2018, 23:37
A current set of LAV Filters is included in MPC-HC; you can direct DSS2Mod to load it from there. I believe...

anas
25th March 2018, 11:37
A current set of LAV Filters is included in MPC-HC; you can direct DSS2Mod to load it from there. I believe...

it doesn't support avisynth+ x64?
is there any one can build dss2 64 bit?