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
2nd July 2019, 20:33
A question about mixing to stereo, is it better to let lav audio decoder do the mixing or mpc-be's sound processing?

Anyone?

lvqcl
2nd July 2019, 20:35
@nevcairiel
I wonder why git.1f0.de/gitweb?p=lavfsplitter.git is not updated, and there's no new nightlies..?

ryrynz
2nd July 2019, 22:58
Not much to wonder about. He doesn't want to spend time on it atm. Real life + work and factor in that it's stable and working well for most use cases means dev work is gonna calm down, + It's only been four weeks
What I'm curious about is why nobody else is helping co-develop it. Lav gets used a lot, so wonder why the lack of interest ¯\_(ツ)_/¯

nevcairiel
3rd July 2019, 00:17
@nevcairiel
I wonder why git.1f0.de/gitweb?p=lavfsplitter.git is not updated, and there's no new nightlies..?

Updated with what? It has the latest version. There are no nightlies if there are no changes.


What I'm curious about is why nobody else is helping co-develop it. Lav gets used a lot, so wonder why the lack of interest ¯\_(ツ)_/¯

DirectShow isn't exactly a field overflowing with developers, nevermind those wanting to work on open-source software for free. :)
But I also don't think that LAV is in desperate need of much work. There is always some open requests for special format support, or some new overhaul of hardware decoding stuff, but for the majority of people it works just fine as-is.

lvqcl
3rd July 2019, 17:06
Sorry. For some reason I misread "1 Jun" as "1 Jul" in the date of the latest commit...
I have no idea why it happened. :confused:

filler56789
3rd July 2019, 17:33
What I'm curious about is why nobody else is helping co-develop it.

By the way, I have always wondered who are the "WE" in the quote below :)
Hi folks,

We've been working on this for quite a while already, and i feel its time to release it into the wild for some more comprehensive testing.

huhn
3rd July 2019, 17:52
just keep reading
At this point i would like to thank Ti-BEN for his contributions. Without his work on this project, it probably would have stayed a design in my mind.

nevcairiel
4th July 2019, 01:25
Yeah that was 9 years ago, beyond the initial prototype that we made together, I was basically on my own though.

QBhd
4th July 2019, 07:12
I always thought it was a "Royal" "we" :P

QB

ryrynz
5th July 2019, 07:52
I have a partially downloaded video that I find MPC-BE's internal filters handle better than LAVs. With the internal filters the file stops playing, detecting the playback length at 20 seconds.
LAV shows the what would be entire length of the film, once it hits the 20 second point it appears to continue looking for playable content which there likely is none. Nothing basically happens as it continues to chug through the file.
Nev, are you interested at improving this at all? Can upload a chunk if interested, not sure how you feel about broken file playback.

Sunspark
6th July 2019, 01:31
Just wondering something.. In LAV, on my Windows 7 system selecting D3D11 as the decoder to use states "D3D11 requires Windows 8 or newer, and is not supported on this OS."

I have DirectX 11.0 installed, but I don't have the platform update installed which would give the system a partial DirectX 11.1. Is it actually DirectX 11.1 that is required, or the OS itself that is at fault?

lvqcl
6th July 2019, 07:53
there's this reply from the author:
The problem on Windows 7 is not that the decoder doesn't work, because it technically does - the problem is that NV12/P010 are not supported in D3D11. You need Windows 8 for that. But without NV12/P010, the decoder is mostly useless for most use-cases.

Sunspark
6th July 2019, 15:11
Ah, thanks for that info. I wasn't after 10-bit colour since I don't have a display that supports it anyway, but I was curious to take a look at Error Diffusion dithering which requires Direct Compute to function. Direct Compute is only available to dx10 and dx11.

clsid
6th July 2019, 16:33
D3D11 decoding and D3D11 rendering are two different and independent things! The decoder in LAV should not be confused with settings in MadVR.

Asmodian
8th July 2019, 22:49
Even in madVR they are independant. You can use D3D9 presentation and Error Diffusion dithering. You need DX10/11 installed but you can set every option in the playback chain to DXVA2/D3D9 and still use Error Diffusion dithering.

Sunspark
9th July 2019, 04:30
Asmodian, I am not sure that is true, unless it requires DX 11.1 as opposed to 11.0 which is what I have. The reason I say that is because I was looking at dithering patterns and both EDs in DX9 mode looked exactly the same as ordered dithering. At least with the low bit-depth on the video clip I was testing with. This is what made me think that the support just wasn't there, and that it simply just fell back to ordered. I just now tested with a still image 16 bit gradient in a window. Set the display to 2 bit, and turned off change dither pattern every frame. As I apply the selection through the ordered, ED 1 and ED 2 options, there is no change in the dither pattern.

huhn
9th July 2019, 05:31
maybe it needs dx 11.1 or your driver have a problem with direct compute but it has nothing todo with the decoder lav filter has nothing todo with that too.

d3d9 can use ED it works flawless here just as a general rule madVR does pretty much everything using d3d9 even with d3d11 decode and even with d3d11 presentation only a very small part is done with d3d11 these are interops and presentation in this example.

kolak
10th July 2019, 10:32
I can confirm your issues, LAV Filters for me always had such problems when dealing with HD transport streams. It looks like DirectShow is simply not good at seeking within transport streams... :mad:

Just to make sure that your clip was not corrupted I ran it through TSDoctor, and it came out fine without any complaints. My usual workaround for HD transport streams is to repack them into an MKV container. I either use MKVMerge or ffmpeg (using the dmMediaConverter GUI) for this, and the resulting MKVs play with just about any player and have no problems with seeking.


Cheers
manolito


I can also confirm TS seeking issues. I also know that those TS streams are 100% correct.

Aleksoid1978
10th July 2019, 11:33
I can also confirm TS seeking issues. I also know that those TS streams are 100% correct.

Can you upload .ts sample with seeking porblem ?

el Filou
10th July 2019, 12:21
I just now tested with a still image 16 bit gradient in a window. Set the display to 2 bit, and turned off change dither pattern every frame. As I apply the selection through the ordered, ED 1 and ED 2 options, there is no change in the dither pattern.You can check by creating a file called ShowRenderSteps (no extension, and delete the file after testing) in madVR's folder, and comparing the 'FinalStep' rendering step in the OSD. On my system, ED2 takes ~3x the rendering time as Ordered (first make sure that the other steps are the same time to eliminate GPU frequency variation).

kolak
10th July 2019, 16:40
Can you upload .ts sample with seeking porblem ?

I need to make one, as none of my files can be made public.

manolito
11th July 2019, 00:59
I cut out a 100MB sample of a standard DVB-T2 broadcast from German public television, get it here:
https://www.sendspace.com/file/51jlvy
//EDIT//
SendSpace has become painfully slow, here is an alternative link:
https://www.zeta-uploader.com/2126706227

It shows corrupted frames with every seek operation using DirectShow based players (which all employ LAV Filters). It plays and seeks nicely using VLC.

Using the preview in an older 32-bit StaxRip it behaves like this with different 32-bit source filters:

1. DSS2Mod with current stable LAVVideosource:
Corrupt frames

2. FFVideoSource version 2.23.1 (latest stable version by Myrsloik):
Major disaster. Preview is totally unusable. Stepping through frames not possible.

3. LWLibavVideoSource (from lsmash-r929-170224-32)
Works without problems. Seeking does not display any corrupt frames.


Frankly I have no idea what I should make out of this. If LSMASH can do it, why can't LAVVideo and FFMS2 ?


Cheers
manolito

nevcairiel
11th July 2019, 01:18
As mentioned a few weeks ago as this topic came up, this has nothing to do with the file being TS (although it doesn't help), but because of the codec being HEVC. Noone yet implemented a function to properly suppress corrupt frames after seeking, which are basically always going to be present, in the ffmpeg HEVC decoder like it was done for H.264. The problem is of course that as codecs get more complex, this logic also does.

This is not something I do in LAV itself, so it needs to happen in FFmpeg. Feel free to contribute if this is a topic of importance for you. :)

As a general rule, TS as a container just does not offer any proper seeking functionality. It barely has usable timestamps, and thats it. No keyframe flags, no index, no nothing. As such, if you want "artifact free" seeking in TS, this has to rely on deep knowledge of the codec inside the TS container. And as mentioned above, noone has really bothered with HEVC for that, because its not a very popular codec in the open-source world due to the patent nonsense.

ryrynz
12th July 2019, 08:18
Any chance of an update to latest GIT of dav1d? Thanks.

nevcairiel
12th July 2019, 10:42
I currently plan to update it to 0.4.0 once thats available, which should be not that much longer.

kolak
12th July 2019, 11:42
As mentioned a few weeks ago as this topic came up, this has nothing to do with the file being TS (although it doesn't help), but because of the codec being HEVC. Noone yet implemented a function to properly suppress corrupt frames after seeking, which are basically always going to be present, in the ffmpeg HEVC decoder like it was done for H.264. The problem is of course that as codecs get more complex, this logic also does.

This is not something I do in LAV itself, so it needs to happen in FFmpeg. Feel free to contribute if this is a topic of importance for you. :)

As a general rule, TS as a container just does not offer any proper seeking functionality. It barely has usable timestamps, and thats it. No keyframe flags, no index, no nothing. As such, if you want "artifact free" seeking in TS, this has to rely on deep knowledge of the codec inside the TS container. And as mentioned above, noone has really bothered with HEVC for that, because its not a very popular codec in the open-source world due to the patent nonsense.

Seeking problems (long/frozen seek) happens for H264 as well. Files are coming from Manzanita muxer (which is by many treated as reference).

nevcairiel
12th July 2019, 11:59
TS, as a format, is not designed for seeking. Its designed for broadcast and streaming. If you want local file playback with perfect seeking, use a format that is designed for these tasks. I have said that repeatedly over the years. I will not spend excessive amount of time trying to improve TS seeking, because its fundamentally not a concept helped by the container. There are perfect formats/tools for each job, use the right ones. :)

Seeking in a format like MPEG-TS is always just guess work. You "randomly" (with some educated guesses) look around in the file for a timestamp that matches the one you are interested in, because there is no index or any other clues where your target time is. This is a balance between the amount of file IO you perform to find it, obviously I could just read from the start and stop when I find it, but that would be slow, and the accuracy. Sometimes it finds one a bit too early, or a bit too late, which then takes the playback chain a bit to "catch up", or it just missed the previous key frame (and due to container inadequacy, it also has no clue where those are), hence "slow seeking".

There is a reason Blu-ray, for example, which uses MPEG-TS carries an external seeking index in a seperate file, so it can actually do seeking using that information.

LAV uses the FFmpeg MPEG-TS demuxer, so you know where to send improvements. :)

One final note, for example the cited "LWLibavVideoSource" in an earlier post which does "perfect seeking" - you know how it does that? It reads the entire TS file and builds a complete seeking index. A video processing tool can certainly afford to be a bit slow to do this, but something focused on playback like LAV is not in a position to be that slow on file opening or first seek.

el Filou
12th July 2019, 14:24
Personally never encountered any seeking issue in my H.264 TS files (muxed by MediaPortal's TSWriter, but even when opening a raw multi-program TS direct from the cable provider it's fine) when I open them in MPC-HC with LAV.
I don't consider glitches when seeking in broadcast stream an issue. You're seeking, the very operation you're doing is breaking normal playback. It's much less disturbing than audio crackles and pops.

manolito
12th July 2019, 14:45
My main requirement for TS streams is to reencode them (editing out commercials and get rid of station logos). Finding the correct cut points in the preview does require a lot of seeking, and always getting corrupt frames is very annoying.

So LAV Filters is simply the wrong source filter in this case, I should use a filter like LWLibavVideoSource which indexes the whole stream first. OK, I got that. But then how is it that FFVideoSource which also indexes the stream gives such catastrophic results in StaxRip when trying to seek? Is it its default seek mode (I did use the defaults)? Or is this a bug in v. 2.23.1 which has been fixed in later versions?

nevcairiel
12th July 2019, 15:41
But then how is it that FFVideoSource which also indexes the stream gives such catastrophic results in StaxRip when trying to seek? Is it its default seek mode (I did use the defaults)? Or is this a bug in v. 2.23.1 which has been fixed in later versions?

That I can't answer. It might just be broken, if it does indexing.

If I could realistically index a file from start to finish, seeking would be perfect every time, but alas I cannot, since people want their files to open instantly, and not in 10-20 seconds. :D

el Filou
12th July 2019, 16:32
My main requirement for TS streams is to reencode them (editing out commercials and get rid of station logos). Finding the correct cut points in the preview does require a lot of seeking, and always getting corrupt frames is very annoying.Sorry for the off-topic but have you tried TS-Doctor? It has configurable settings for automatically choosing the previous/next I-Frame for cutting, or you can also seek to I-Frames in a preview window. It's not freeware but I find the price well worth it.

manolito
12th July 2019, 17:02
TSDoctor is one of my standard tools for dealing with TS files. But cutting at I-Frame borders will not do it for editing out commercials (especially not with HEVC streams where the key frames can be spead apart very widely).

Since I reencode anyways I do the cutting in AVISynth, and this is frame accurate, no matter what the source format is.

manolito
12th July 2019, 22:06
That I can't answer. It might just be broken, if it does indexing.

Yes, you are right, v. 2.23.1 is broken... :scared:

After replacing it with this version
https://forum.doom9.org/showthread.php?p=1876703#post1876703

(I believe it is v. 2.31.0) seeking works perfectly using the default seek mode 1.

Asmodian
12th July 2019, 22:31
If I could realistically index a file from start to finish, seeking would be perfect every time, but alas I cannot, since people want their files to open instantly, and not in 10-20 seconds. :D

A cool feature would be an option to index or use a separate index file, for those who want better seeking in ts or other bad files. I do encounter broken files which are unable to seek more often than I would like (incomplete mp4 is my most common, due to canceling encodes). The way FFMS2 works has always struck me as very convenient and functional. A way to tell LAV that I wouldn't mind indexing the file, or even automatic loading of a previously created index file I have to generate manually would be nice. At least it doesn't seem crazy. :)

I do have to admit that only a small percentage of the user base would benefit, so it may not be worth the effort, but it would still be cool for me. :o

huhn
13th July 2019, 07:03
even very advanced user get confused by the decoder names and what that means just imagine what will happen with that setting when user start wondering why it sometimes takes so long to start playback.

Asmodian
13th July 2019, 21:18
Yeah, it would probably generate a lot of extra questions. :o

This is a reason simply detecting an index you have to create manually would be good.. but probably not too important anyway. I can always use Vapoursynth. :p

clsid
22nd July 2019, 16:54
Good time for a FFmpeg update, now that 4.2 has been branched? ;)

videoh
22nd July 2019, 18:02
The player should start decoding and seeking without an index and kick off indexing in the background. When the index is ready, the player begins using it.

el Filou
23rd July 2019, 00:12
Wouldn't that bring a lot of I/O trashing on anything other than an SSD?
If such a feature is ever added, it should be as an option and disabled by default.

nevcairiel
23rd July 2019, 01:15
Indeed, that would not be very well received by the majority of users. I don't currently have any such plans. LAV is designed primarily as a tool for playback, in which cases perfect seeking accuracy for example is not a strict requirement, as long as it comes close. I realize since its practically the only option for many codecs in DirectShow, some users like to use it for other tasks as well, and while I don't want to discourage that, I also don't plan to work on complex features for such tasks.

LigH
25th July 2019, 07:46
I am quite satisfied with the performance of LAV Filters (e.g. as used in MPC-HC), with one exception: playing WMV may have severe issues catching up after seeking; but that may be related to attributes of specific files. I would blame LAV Filters last here.

filler56789
25th July 2019, 09:03
I am quite satisfied with the performance of LAV Filters (e.g. as used in MPC-HC), with one exception: playing WMV may have severe issues catching up after seeking; but that may be related to attributes of specific files. I would blame LAV Filters last here.

Indeed, the ASF container is highly pesky and "sucky" :mad: :D
I often remux the WMV files to AVIs — direct stream-copy for the video and re-encode for the audio.

bluesky507
25th July 2019, 15:25
Hello
I use lav splitter for play H265 TS file and it works well.
http://87.98.232.3:5050/browser/1.jpg
now i want use lav splitter for play TS from USB DVB-T dongle.
but when i want connect BDA filter to lavsplitter filter i got following error
http://87.98.232.3:5050/browser/2.jpg
How i can solve it?

nevcairiel
25th July 2019, 16:20
LAV Splitter is not designed as a broadcast demuxer. You'll need to use a filter designed for that purpose, I reckon.

bluesky507
25th July 2019, 18:10
do you any filter can do this? my stream is H265 coded video.

kolak
29th July 2019, 21:44
Can we find any use for this:

https://www.anandtech.com/show/14682/nvidia-siggraph-2019-nv-to-enable-30bit-opengl-support-on-geforce-cards

nevcairiel
29th July 2019, 22:49
Windows video stuff really doesn't use OpenGL if it can avoid it. Direct3D has supported full 10-bit on consumer cards for a long time already.

littleD
30th July 2019, 06:15
Can we find any use for this:

https://www.anandtech.com/show/14682/nvidia-siggraph-2019-nv-to-enable-30bit-opengl-support-on-geforce-cardsThis is for applications, not for video output- which is separated thing from system application workflow. However, i am impressed with that move. 30 bit was only enabled in drivers for quadro/professional cards for so long time that everybody forgotten about it. One of possible reason for this move is that nowadays proffesional cards occupy high performance market by most and enabling 30 bit for graphic designers will not influence nvidia income (Quadro cards are much much expensive than GeForce's consumer cards). Similar situation was wat AMD team.

el Filou
30th July 2019, 13:58
Their official stance is that now that there's consumer HDR, 10-bit isn't a pro-only feature anymore (which was true before, tbf). It's just like the simple/double precision float performance, we all know the consumer hardware could do it at 1/2x but they segment their portfolio that way.

kolak
30th July 2019, 19:47
This is for applications, not for video output- which is separated thing from system application workflow..

Not sure what you mean by this.
OpenGL is/was used in eg. Photoshop (and some other tools) for previewing at 10bit. Some pro apps use OpenGL surface to display video as apparently this allows for better control and separation from OS influence. For example Assimilate Scratch uses OpenGL. It allows for color accurate video preview and screen calibration. My understanding is that Direct3D is more tight to OS and harder to control. OpenGL is also cross platform and apparently more efficient. I may be very wrong. Of course old days only pro card had 10bit support for OpenGL surface, but now it's changing.

https://en.wikipedia.org/wiki/Comparison_of_OpenGL_and_Direct3D comparison tab explains it quite well (at least for my limited understanding).