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

noee
25th February 2012, 14:07
Okay, yeah, there is a performance hit going on with the renderers and DXVA CopyBack vs. Native. I just tried in MPC-HC (later build) with EVR vanilla and again, flawless with both modes. Switched to madVR (for copyback) or EVR-CP and I get slideshows with CopyBAck mode. EVR-CP works fine too with Native mode. Same "birds" sample from above.

Mercury_22
25th February 2012, 14:09
Are you guys sure about this? I just tested Birds_1080p60fps.mp4 (from the link with the benches) in LAV, both DXVA2 CopyBack and Native, in jRiver Media Center with EVR and it works flawlessly with both and the GUI acts just normal. Using HD6570, CCC 12.2 pre-cert.

I've just tested that file too and it's the same here : working "flawlessly" with both native and CB :)

chros
25th February 2012, 15:04
I would like to thanks you nev again from helping me with my Nvidia 9600GT (from my DEV pc).
In fact this card and surely old one need to set some option to make it work correctly at least for VC1i movies.
We need to uncheck YV12 and NV12 from LAV Video Decoder otherwise, video was slow and desync (tested on 290.36 and the latest 295.73 WHQL).
Well, works for me on my 9600m gt with blrueray VC1, lavcuvid (only IDCT acceleration) and madvr (mobil gpu, which is far worser than the desktop 9600GT). MadVR reports NV12, 4:2:0.
What renderer are you using?

nevcairiel
25th February 2012, 15:05
That specific problem would most likely only occur with EVR - if it even occurs for anyone else. :p

NikosD
25th February 2012, 16:31
The new DXVA checker v2.8.0 (it's in beta) has fixed the problem with LAV Video and Basketball clip and it will support renderless VMR and EVR benchmark modes.

e-t172
25th February 2012, 18:36
I'm trying to watch a HD video file over HTTP over a DSL line. I know I have sufficient bandwidth to do that (more than 3x the bitrate of the video). I'm unable to get it working properly:

- By default, when opening a URL with DirectShow, it uses File Source (URL), which then gets attached to LAV Splitter. The video seems to play properly, but the displayed duration is completely wrong (fortunately, it keeps playing "past the end") and most importantly, I cannot seek.
- If I use LAV Splitter Source in GraphStudio and give it the URL, the video plays very slowly, as if the link was too slow. If I try to seek, GraphStudio freezes.

It would be great if LAV Splitter could play files over HTTP without issues. Also, I would like to be able to configure LAV Splitter so that it does massive buffering (e.g. 50 MB with 5 MB pre-buffer); this would greatly decrease the risk of buffer underruns when playing from a remote location, or even locally when the storage is under heavy load (e.g. playing video while copying files).

Also, does anyone know how to make LAV Splitter Source the default when opening URLs in MPC-HC?

nevcairiel
25th February 2012, 19:15
The File Source (URL) isn't great on seeking, so if you have any format that requires seeks to gather all information (like most formats do), you might end up with a limited subset of information, like wrong duration.
LAV itself didn't actually have http support yet, i guess Windows somehow emulated it when it tried to opened a file with the name of a URL.

I enabled http support (no https yet, need to fix the build system), and first tests look good.
http://files.1f0.de/lavf/LAVFilters-0.48-http.zip

You can use this reg file to force LAV as http source:
http://pastebin.com/XUT3AjZe

I'll have to check if there are better ways or if that one has side effects.

Regarding buffering, there already is good buffering in place, at about 1000 video frames. In MPC-HC, enable the "Statistics" panel to see the queue status (Ctrl+4)
I can probably think about increasing that in case of URL access, if its really required. On a Blu-ray sourced 1080p MKV, the buffer is around 110-120MB for those 1000 frames.

aufkrawall
25th February 2012, 19:49
I have a progressive VC-1 sample that doesn't work with VPU if I've chosen CUVID.
With DXVA it works. Unfortunately, it's ASF container and about 900 MB.
Another prog. VC-1 sample works with it.

What to do now?

nevcairiel
25th February 2012, 19:51
I suggest to sit on it, maybe something will hatch from it! :)
Anyhow, the CUVID decoder is a blackbox, can't look into it. Its all handled by the driver. (Try another one)
Are you sure its really VC-1 and not WMV3 in disguise?

aufkrawall
25th February 2012, 20:05
I suggest to sit on it, maybe something will hatch from it! :)

It might hurt to sit on WD Caviar Black HDDs, so I won't do this. :scared:


Anyhow, the CUVID decoder is a blackbox, can't look into it. Its all handled by the driver. (Try another one)
Are you sure its really VC-1 and not WMV3 in disguise?
Ah yes, MediaInfo says VC-1/WMV3.
But why should it work with DXVA and not CUVID?
It plays, but with CUVID there's no VPU usage.
Does CUVID not support WMV3 acceleration?

I found out that it's just Windows Movie Maker output, so here is a short sample (8,5 MB):
http://www.mediafire.com/?zpug3goyrj7fwnc

nevcairiel
25th February 2012, 20:12
The cuvid parser for some reason doesn't support wmv3, even though the hardware supports it.

aufkrawall
25th February 2012, 20:19
The cuvid parser for some reason doesn't support wmv3, even though the hardware supports it.
*sigh*

Do you still not plan to implement DXVA support for MPEG-4 ASP? :)

nevcairiel
25th February 2012, 20:22
I do not.

aufkrawall
25th February 2012, 20:24
I do not.
QuickSync does work with every DXVA capable format?

nevcairiel
25th February 2012, 20:26
QuickSync only supports H264, MPEG2 and VC1. Not WMV3 and not MPEG4-ASP. It may support WMV3 HW accel in the future, but right now it doesn't. Its up to Intels driver team.

aufkrawall
25th February 2012, 20:31
Alright, thanks.
Then I won't try it out and stick to CUVID.

e-t172
25th February 2012, 20:43
The File Source (URL) isn't great on seeking, so if you have any format that requires seeks to gather all information (like most formats do), you might end up with a limited subset of information, like wrong duration.
LAV itself didn't actually have http support yet, i guess Windows somehow emulated it when it tried to opened a file with the name of a URL.

I enabled http support (no https yet, need to fix the build system), and first tests look good.
http://files.1f0.de/lavf/LAVFilters-0.48-http.zip

Are you sure your build is correct? It tried it, but it didn't change anything.

Regarding buffering, there already is good buffering in place, at about 1000 video frames. In MPC-HC, enable the "Statistics" panel to see the queue status (Ctrl+4)
I can probably think about increasing that in case of URL access, if its really required. On a Blu-ray sourced 1080p MKV, the buffer is around 110-120MB for those 1000 frames.

Testing with LAV Splitter Source in your build, all buffers stay at 0 in the MPC-HC stats.

nevcairiel
25th February 2012, 21:05
Are you sure your build is correct? It tried it, but it didn't change anything.
Pretty sure. Works fine streaming some .ts file from my own web space, with proper duration and seeking and everything. Just applied the reg file, and it used LAV Splitter Source in MPC-HC for the http url. Like i said, https is no worky yet. Also, it will most likely not obey any proxy settings.

Are you sure you installed it correctly? :)

Weirdo
25th February 2012, 21:06
Thanks for the great updates! Is there a way to lock different LAV settings per application?

aufkrawall
25th February 2012, 21:22
Thanks for the great updates! Is there a way to lock different LAV settings per application?
Since there are only global settings available in the registry and nev doesn't want to make LAV store them in an ini, I don't think so.

e-t172
25th February 2012, 21:40
Pretty sure. Works fine streaming some .ts file from my own web space, with proper duration and seeking and everything. Just applied the reg file, and it used LAV Splitter Source in MPC-HC for the http url. Like i said, https is no worky yet. Also, it will most likely not obey any proxy settings.

Ah, now that you mention it, the duration bug is indeed fixed. The video is still extremely slow (completely unwatchable). Seeking works, but is very slow.

Here's some more context, maybe that will help understanding my issues:
- I'm streaming H.264/AC3 in Matroska, 1.4 GB for 44 minutes, average bitrate: 540 KB/s.
- Downloading the MKV from a browser yields approx. 1.5 MB/s. Round-trip time is 43 ms. Protocol is classic HTTP from Apache HTTP server.
- Again, File Source (URL) plays the file fast enough. Your HTTP build of LAV Splitter Source displays the right duration and is seekable, but everything is extremely slow.

But here's the catch: I fired up Wireshark to see what LAV was doing on the network and I got something interesting: I expected to see one long-lived HTTP request (or maybe several at the beginning) but I was shocked to see that LAV was instead sending approx. 10 HTTP requests per second! In fact, instead of just fetching the file as a stream, it seems to fetch exactly 16 KB of data at a time, and creates a new HTTP request each time it needs to get the next 16 KB, which is completely absurd since the request's offsets are sequential (I checked)…

Of course, this is incredibly inefficient since it puts heavy load on my webserver, makes my server's logs explode, and of course the extreme overhead of closing a TCP connection, opening a new one, and making a HTTP request for each 16KB chunk of data. With 1.5 MB/s it normally takes 10 milliseconds to download 16 KB. Reading the timings in Wireshark, it takes LAV Splitter 100 ms to fetch a 16 KB chunk (I'm surprised it isn't worse than that), which is equivalent to a 150 KB/s line… no wonder why it's so slow!

I get the feeling that Matroska might be the culprit here. Maybe the Matroska implementation isn't designed for a streaming scenario?

nevcairiel
25th February 2012, 21:54
The reason the file source works is that it buffers the whole file locally. But thats also the reason seeking fails, because it can only seek to parts it already has.

Anyhow, yes Matroska isn't all that great for this. It requires a lot of seeking back and forth, at least the way its implemented.

e-t172
25th February 2012, 22:03
Is there any hope it can be improved? Matroska seems to be designed (http://matroska.org/technical/streaming/index.html) for efficient streaming…

My point is, the current implementation doesn't even seek, it justs reads the file sequentially (I checked the offsets with Wireshark), but takes extra care to do it in the worst possible way. Just merging all those HTTP requests (or make them much bigger than 16 KB, say 10MB) would fix the issue.

RBG
25th February 2012, 22:14
Just imagine for a second that you had an AMD 6xxx (or older) GPU and wanted to use "DXVA copyback". Furthermore imagine you have both 24p and 60p videos. What will happen now? If you enable "DXVA copyback", 24p playback will be smooth, but 60p playback will stutter. That's not a good solution for the average user.

Can't agree here. The first reason, 60p vids are themselves relatively rare, so I doubt that average user will ever encounter them, guys who have 60p vids usually know the AMD hw decoding limitations. For vc-1 format software fallback on 60p content is useless due to poor optimization of software decoding in ffmpeg, even mine i7-2600 has not enouth power to decode vc-1 60p with LAV(SOFT), also there is a possibility that the end-user has slow cpu not capable of decoding even h.264 60p. The second reason, in fact there is a crooked way to force smooth playback of 60p on AMD hardware, though I have never tested it myself. The third reason, I hope someday AMD will fix their driver.

So I suggest, the best solution is to make some kind of check box to disable dxva(c/b) for 60p on ATI GPUs, or to write a hint(warning) for an average user, or just leave LAV as it is now.:D

noee
Mercury_22

If you want to test 60p playback capabilities of yours GPU try this (http://www.mediafire.com/?l2zwm5piwftkk3x).

nevcairiel
25th February 2012, 23:40
Is there any hope it can be improved? Matroska seems to be designed (http://matroska.org/technical/streaming/index.html) for efficient streaming…

My point is, the current implementation doesn't even seek, it justs reads the file sequentially (I checked the offsets with Wireshark), but takes extra care to do it in the worst possible way. Just merging all those HTTP requests (or make them much bigger than 16 KB, say 10MB) would fix the issue.

Try with this version:

http://files.1f0.de/lavf/LAVFilters-0.48-http2.zip

I hope i properly corrected all spots to now directly read the data and cache it instead of just reporting the position of the data to the caller. On first glance, it didn't seem like i introduced memory leaks or things of that sort, so here is hoping. ;)

The Seeker
25th February 2012, 23:41
Looking at the specs in my sig, what hardware decoder would you suggest I use? I'm guessing something that utilises my AMD card.

e-t172
26th February 2012, 00:06
Try with this version:

http://files.1f0.de/lavf/LAVFilters-0.48-http2.zip

I hope i properly corrected all spots to now directly read the data and cache it instead of just reporting the position of the data to the caller. On first glance, it didn't seem like i introduced memory leaks or things of that sort, so here is hoping. ;)

Absolutely perfect, thanks. My MKV now plays flawlessly. Wireshark shows some HTTP requests in the beginning (for metadata, I assume), then it's just one nice long TCP stream. Seeking works perfectly and is amazingly fast. This is really great, now I don't even have to download videos anymore when I'm away from home :)

A last feature request: it would be cool if LAV would ask for username/password if the URL is password protected (I'm talking about HTTP authentication). But that I can do without.

Prinz
26th February 2012, 00:37
Try with this version:

http://files.1f0.de/lavf/LAVFilters-0.48-http2.zip


I tested that version with my DVB-S-Receiver (HTTP Live-Stream). I can watch SD-TV Channels, but HDTV Channels only play for a few seconds.

With the File Source Filter and LAV Splitter all SD and HD Channels play ok. But the File Source Filter caches the Stream on HDD (IE-Cache) :rolleyes: So I'm stuck with VLC at the moment.

Mercury_22
26th February 2012, 08:38
....

noee
Mercury_22

If you want to test 60p playback capabilities of yours GPU try this (http://www.mediafire.com/?l2zwm5piwftkk3x).
It's playing smooth :)
http://imageshack.us/photo/my-images/20/capturehxb.png/

EDIT: just tested with madVR 0.81 and it's almost a slideshow :mad:

RBG
26th February 2012, 09:26
It's playing smooth :)
http://imageshack.us/photo/my-images/20/capturehxb.png/

EDIT: just tested with madVR 0.81 and it's almost a slideshow :mad:

That's interesting :), can you also test this vid with DXVA(native) and tell me gpu(shader clock, mem. clock) frequencies for both DXVA(native) and DXVA(C/B). Also if you're running any kind of benchmarking tools e.g. graph studio, dxvaChecker, please close it before testing.

nevcairiel
26th February 2012, 09:43
Its possible that the AMD driver somehow behaves differently if EVR is active. It wouldn't be the first time for AMD to do silly things like that. When benchmarking with GraphStudio, the best i saw out of a 6xxx series was 50fps or so.

VipZ
26th February 2012, 09:54
On that Avatar clip I get the following,
AMD 7970: 71avg (goes to UVD Clocks)
AMD 6570: 74avg (goes to full 3D clocks)

MadVR is also fine on my 7970 when playing but 6570 is a slideshow like everyone else is reporting

madshi
26th February 2012, 10:04
@VipZ, is that with "copyback"?

VipZ
26th February 2012, 10:19
@VipZ, is that with "copyback"?

Would have been useful to state that :) Yep its copyback.

I also see why the 7970 works while others don't. 6xxx series require full 3D clocks to decode that stream while 7970 only requires UVD (500 vs 925). When I use madVR as well my 7970 goes into full 3D clocks and the 1st few frames are decoded with UVD clocks and also a sideshow.

diizzy
26th February 2012, 12:35
Great work as always, I do have some video "regression" issues.
I have a few video files that are encoded using the infamous Project Mayo codec which are showing artifacts using LAV Filters. This also occurs with ffdshow unless you check "Padding bug" and "Edge" under libavcodec options (Decoder options). These settings doesn't seem to be available in LAV Video at all.

Also, are there any plans of including a channel mixer (useful if you have 2.0 and running a > 2.0 source) and possibly a normalizer (5.1+ gets really low if you just mix them) in LAV Audio?

//Danne

kasper93
26th February 2012, 13:29
@nevcairiel
Could you look at http://dl.dropbox.com/u/16282309/doom9/sample.vob I think it should not be detected as interlaced, but I guess you can't do much because it's marked interlaced?

nevcairiel
26th February 2012, 13:31
@nevcairiel
Could you look at http://dl.dropbox.com/u/16282309/doom9/sample.vob I think it should not be detected as interlaced, but I guess you can't do much because it's marked interlaced?

All the frames are marked as interlaced, its behaving exactly like it should be.

iSunrise
26th February 2012, 14:17
Also, are there any plans of including a channel mixer (useful if you have 2.0 and running a > 2.0 source) and possibly a normalizer (5.1+ gets really low if you just mix them) in LAV Audio?

//Danne
This has been requested by some and I guess that nevcairiel already is working on it. A normalizer would be a great addition, indeed.

noee
26th February 2012, 14:25
noee
Mercury_22

If you want to test 60p playback capabilities of yours GPU try this.

Cool clip. Just built LAV, just updated to madVR .81.

DXVA Native with EVR work flawless, slight pause when clip starts. (CPU idle freq/GPU at full clocks 650Mhz)
DXVA CB with EVR stutters for a few seconds, then playback goes smooth, clip plays fine. (CPU clocks up/GPU at full clocks 650Mhz)

DXVA CB with madVR stutters for about 5 seconds, then playback gets smooth, clip plays fine. (CPU clocks up/GPU at full clocks 650Mhz)

again, jRiver MC17, HD6570 (RO standard for EVR, ROHQ for madVR)

NikosD
26th February 2012, 14:45
If you want to test 60p playback capabilities of yours GPU try this (http://www.mediafire.com/?l2zwm5piwftkk3x).

Excellent clip to add to my benchmark collection.
It has both high bitrate and high frame rate.

6233638
26th February 2012, 16:48
Well this was unexpected. Lav Splitter isn't finding any audio tracks with the Eternal Sunshine of the Spotless Mind Blu-ray, whether I load up the index.bdmv or m2ts file.

The "MediaInfo" tab in MPC-HC's properties for it says there's a DTS-HD MA and AC3 track there, and if I block Lav Splitter/source from loading, it works.

Not sure how to get a sample of this to give you though.

nevcairiel
26th February 2012, 17:05
Well this was unexpected. Lav Splitter isn't finding any audio tracks with the Eternal Sunshine of the Spotless Mind Blu-ray, whether I load up the index.bdmv or m2ts file.

The "MediaInfo" tab in MPC-HC's properties for it says there's a DTS-HD MA and AC3 track there, and if I block Lav Splitter/source from loading, it works.

I ordered that movie from the UK, but it won't be here for another 2 weeks or so.

Anyway, the only case where i've ever seen such a problem before was with some rare releases of Avatar, but only with Subtitles there. Usually an indicator of the muxing of that disc gone wrong.
I always wanted to take the metadata from the BD playlists into account when finding streams, but sadly that isn't all that easy.

Maybe just cut the first 20MB off the m2ts and see if the problem persists.

6233638
26th February 2012, 17:08
I ordered that movie from the UK, but it won't be here for another 2 weeks or so.Well that's the disc I have too, so hopefully you'll be able to fix it from that if I can't get you a sample.

Maybe just cut the first 20MB off the m2ts and see if the problem persists.How would I go about doing this?

nevcairiel
26th February 2012, 17:14
How would I go about doing this?

DGSplit is usually an easy enough tool for binary splitting.

6233638
26th February 2012, 17:31
DGSplit is usually an easy enough tool for binary splitting.No audio when I use that. Weird.

mzso
26th February 2012, 18:21
Hi!
Is it possible to set LAV filters to prefer the TrueHD track? I have a file in which the first audio track is an AC3 track and the second is a TrueHD but no matter what I do always the AC3 plays when I start playback. Even after I set the TrueHD one as default.

nevcairiel
26th February 2012, 18:32
Hi!
Is it possible to set LAV filters to prefer the TrueHD track? I have a file in which the first audio track is an AC3 track and the second is a TrueHD but no matter what I do always the AC3 plays when I start playback. Even after I set the TrueHD one as default.

The logic is quite simple. It selects the stream with the highest number of channels and the "best" codec. So if they have the same number of channels, it should always go with TrueHD.

However, MKV "Default" flag will override this, and it'll go with the first stream it finds marked as "Default".

mzso
26th February 2012, 18:45
The logic is quite simple. It selects the stream with the highest number of channels and the "best" codec. So if they have the same number of channels, it should always go with TrueHD.

However, MKV "Default" flag will override this, and it'll go with the first stream it finds marked as "Default".

But it doesn't for some reason. Could the player be an issue?

nevcairiel
26th February 2012, 18:46
Sure, some players do their own stream selection.
Also, language is of course taken into account.

diizzy
26th February 2012, 19:20
@ nevcairiel
Do you want a sample of the issue?

//Danne