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

Stereodude
1st February 2014, 00:19
If you have a VOB sample file which exhibits the stuttering problem, that might be useful.Here you go. (http://www.sendspace.com/file/b1pxf5)

FWIW, I now think my previous guess may not have been completely correct on the what's happening, but something is definitely messed up.

RealSnoopyDog
1st February 2014, 09:42
I also get stuttering/choppy playback of many "normal" DVDs (VOB) after a while.

nevcairiel
1st February 2014, 12:58
Here you go. (http://www.sendspace.com/file/b1pxf5)

FWIW, I now think my previous guess may not have been completely correct on the what's happening, but something is definitely messed up.

Yeah something is seriously going wrong with the QuickSync decoder here. Not sure if its Intels fault or egur's decoder doing wonky things. Might be worth reporting to him.

Personally, i am not a huge fan of the QuickSync decoder anymore, it has too much weird behaviour in some situations, so I would always favor the DXVA2 decoders.

NikosD
1st February 2014, 14:04
QS decoder has its problems like DXVA has its own problems too.

For example, some of the clips posted above by me, work perfectly with QS, where DXVA fails.
And in one situation DXVA fails for every DXVA HW decoder by AMD and Nvidia, not only Intel.

Moreover, QS decoder is the only solution for someone who has a discrete card, but wants to use Intel's video processor for video decoding in Windows 8/8.1. I'm not sure it works on Windows 7.

And don't forget that your main resistance of implementing a DXVA VC-1 solution for Intel HW - after the addition of VC1_VLD2010 from Intel - was that we have QS decoder for VC-1 acceleration!

It was good that I insisted on this and it was good that you changed your mind.

Stereodude
1st February 2014, 14:06
Yeah something is seriously going wrong with the QuickSync decoder here. Not sure if its Intels fault or egur's decoder doing wonky things. Might be worth reporting to him.I have reported it to him (http://forum.doom9.org/showthread.php?p=1665442#post1665442). Thanks for the help.

Stereodude
1st February 2014, 14:14
Moreover, QS decoder is the only solution for someone who has a discrete card, but wants to use Intel's video processor for video decoding in Windows 8/8.1. I'm not sure it works on Windows 7.I'm doing the opposite in Windows 7. I'm using the HD4600 to drive my monitor and a discrete Nvidia card for CUVID decoding / DGDecNV (with no monitor).

If QuickSync decoding was a little more solid I think it would be a great asset for a HTPC in the scenario you describe. You could drive your display with a Discrete card and go crazy with the madVR settings, and let QuickSync do the decoding without eating up CPU or loading up the graphics card with decoding tasks leaving you more processing room for madVR. I guess you could do the same thing with a low end Nvidia card with the VP5 / VDPAU Feature Set D decode engine using CUVID also.

nevcairiel
1st February 2014, 14:16
There is no reason you couldn't use DXVA2-CB in the same way for decoding from a secondary GPU, there is just no way right now to specify which GPU to use for decoding.
For obvious reasons DXVA2-Native always needs to run on the same GPU that is being rendered on.

Stereodude
1st February 2014, 14:38
There is no reason you couldn't use DXVA2-CB in the same way for decoding from a secondary GPU, there is just no way right now to specify which GPU to use for decoding.It sounds like you just gave yourself some homework for the weekend. :sly:

AndreaMG
1st February 2014, 21:08
Hi Nev, I'm using latest MPCHC with LAV filters built inside. While watching my BD of "Fringe" if in MPCHC I click "navigate/jump to" it shows the chapters (TV episodes in my case) ordered by descending length, some episodes though are missing... I'm only able to play those by going under "BDMW/PLAYLIST" and manually selecting the "mpls" files. Why is that? Thanks :)

nevcairiel
1st February 2014, 21:22
Maybe you should ask the MPC-HC people? LAV has nothing to do with it.
Its their player, why would you ask me? :)

AndreaMG
1st February 2014, 21:29
Sorry :scared: thanks anyway

Xaurus
1st February 2014, 22:38
nev,

I have a 7.1 setup and I was wondering if there is a way of simply duplicating the rear speaker info in a 5.1 stream to output as 7.1?

nevcairiel
1st February 2014, 22:39
Not with LAV. If you use MPC-HC, its audio switcher has simple channel doubling functionality.

littleD
1st February 2014, 23:55
Hi nevcairiel, i have question regarding Stream AR, because i don't see it explicity explained.

During playback Anamorphic video - avc in mkv with correct stream AR and removed Container AR:
At Intermidiate option, what AR will be used when no Container AR exists? (It uses Frame AR in my case)
and
At Stream AR option unchecked, why lav decoder use Frame AR (Resolution) while it shouldn't?

pankov
2nd February 2014, 14:38
...The problem, however, is that I can't seek in my NDVR recording of those channels with LAV Splitter. Whenever I try to seek, playback starts from the beginning.

It doesn't matter if I play the file via http or download it first. However, if I cut a small chunk from the end of the file (or don't download it entirely with wget), seeking works. With VLC or Haali Splitter seeking works fine.

Thanks. This fixed the problem for some files but not all. I sent you a download link to another file.

Nev,
I'm having the same issue with some of the recordings I do with DVBViewer Recording Service.
There is an option in DVBViewer Rec Service (and in DVBViewer iteslf) called "Remove H.264 Filter Data" which is enabled by default and which I don't know what exactly is doing but sounds remotely connected. Though disabling it doesn't seem to fix the issue ... and since it works with Haali's Splitter I think it's more likely to be a bug in LAV/ffmpeg.

I've just sent you a PM with details for my FTP where I've uploaded a sample - the one from 2014-01-25 (1.2GB - sorry about the size but if I cut it the problem disappears).

I hope this will help you fix the issue

nevcairiel
2nd February 2014, 14:59
While I'm slowly downloading your sample, you could try this version, which fixed Qotscha's problems:
http://files.1f0.de/lavf/LAVFilters-0.60.1-10-g5f96d72.zip

pankov
2nd February 2014, 15:31
:(
sadly it doesn't fix it for me

nevcairiel
2nd February 2014, 15:49
So the same problem happens, when you try to seek it instead plays from the beginning?

Edit: no it doesn't, you just don't get any duration.

nevcairiel
2nd February 2014, 16:49
:(
sadly it doesn't fix it for me

The problem in your file seems to be that there is quite a bit of "garbage" at the end of the file. I'm not entirely certain what exactly the garbage is, but ffmpeg cannot parse it, and therefor doesn't find a end-time of the file.
Might be part of another program which doesn't fit the program table it has, so it doesn't accept it.

If i increase the amount of data it parses from 4 MB to 32 MB, it suddenly finds a duration.
I'll probably play around with the numbers a bit, so it doesn't try too long to find something, but 16MB wasn't enough, so..

pankov
2nd February 2014, 22:53
So the same problem happens, when you try to seek it instead plays from the beginning?

Edit: no it doesn't, you just don't get any duration.

You are correct about the missing duration but it does play from the beginning if I try to seek ... but I guess this is a result of the missing duration, right?

I guess the "garbage" at the end is because something got wrong with the satellite reception ... or DVB Rec Service ... or something else ... it happens always on satellite channels and never for cable

nevcairiel
2nd February 2014, 23:00
You can try this version:
http://files.1f0.de/lavf/LAVFilters-0.60.1-15-g49f7e2b.zip

No guarantees it'll work on all files, depending on how much garbage data there is. Works on the one I got from you.

pankov
2nd February 2014, 23:19
Yes, it works on this one here too but I found an older one which fails in the same way (missing duration) but it's a lot larger (more than 10GB) so I don't think you'd like to get it.
I guess there is not more you can do - it seems that the problem is in the recordings themselves ... for the big one Haali's splitter fails too - it doesn't even start to play it so this is a plus for LAV.
If only there was a way to seek in such files I wouldn't mind missing the full duration

nevcairiel
2nd February 2014, 23:20
Without a duration, you don't know where to seek to. :)
I suppose I can try to blindly increase the tolerance value for garbage even more and send you a test build, see if it helps at all.

pankov
2nd February 2014, 23:26
I don't mind testing if you don't mind making test builds
;)
and why is it that without duration there is no way to seek?
Sorry for the dumb question but how does seeking actually work? Isn't it possible for the source filter to guess the duration based on the size of the file and the average bitrate for a small sample of time? ... I propose this only as a last resort for such damaged files

nevcairiel
2nd February 2014, 23:32
Apparently the logic is slightly weird, it doesn't use bitrate guessing because it thinks it can get the duration from the file timestamps (which fails). Maybe I should tell it to use alternate guesses if the preferred one failed.

pankov
2nd February 2014, 23:36
If this is possible it sounds like a possible solution.

And here is another problem that I think is related but I could be totally wrong:
It's not possible to seek in ongoing recordings past the initial end.
If I start playing a file (.ts) that is still being written to when I reach what was initially the end the playback continues ... which is fine ... but the timeline in the player reaches it's end and there is no way to seek/skip past this point.
Isn't it possible to notify the player that the total duration has changed so it can update it's UI and the user can seek/FF in the new part?

nevcairiel
2nd February 2014, 23:40
The problem is not telling the player, its actually figuring out that it changed, and to what. While you're playing, you can't poke around in the file so easily.
Quite some time ago, someone wanted to work on that and contribute a patch, but for some reason I haven't heard of that a long time now. :)

pankov
2nd February 2014, 23:47
I guess nobody is as good as you and I must admit that you are my hope for finding a real solution ... if I remember correctly haali's splitter worked just fine in this situation ... well there was a slight glitch in the playback which I'm not sure is preferred but in different cases there are different preferences.
I didn't think is not that hard to do the same thing that the source filter/splitter does at the start of playback just before the end is reached and notify/update the main splitter/source "thread" and after this notify the player.
But I don't know a bit about direct show filters programming so this is all wild guessing

mindbomb
3rd February 2014, 02:52
I used to have that issue with mp4 files, but it went away a while ago.

andyvt
3rd February 2014, 11:00
The problem is not telling the player, its actually figuring out that it changed, and to what. While you're playing, you can't poke around in the file so easily.
Quite some time ago, someone wanted to work on that and contribute a patch, but for some reason I haven't heard of that a long time now. :)

It might have been me.

My idea was to use a secondary ffmpeg instance to update the duration when the file changed. Unfortunately the only way I was able to get it working properly was by polling the file periodically (detecting "when the file changed" wasn't reliable). IIRC it worked OK, but there were some issues that I never got around to fixing that should have been before submitting a patch (e.g. deciding when to stop polling a file), and you didn't seem that interested in accepting the feature when we discussed it so I let it slip away.

SamuriHL
3rd February 2014, 13:17
It might have been me.

My idea was to use a secondary ffmpeg instance to update the duration when the file changed. Unfortunately the only way I was able to get it working properly was by polling the file periodically (detecting "when the file changed" wasn't reliable). IIRC it worked OK, but there were some issues that I never got around to fixing that should have been before submitting a patch (e.g. deciding when to stop polling a file), and you didn't seem that interested in accepting the feature when we discussed it so I let it slip away.

Slacker. :P ;)

Sent from my SM-P600 using Tapatalk

pankov
3rd February 2014, 22:27
andyvt,
I'll be very glad if you return to this and finish the patch.
Can you elaborate on the issues that you stumbled upon?
May be someone here can think of a simple solution.

STaRGaZeR
3rd February 2014, 22:53
Not sure if related, but in incomplete Blu-ray .m2ts files (alone, no structure) like what incomplete WinRAR archives output, LAV can't seek at all because there is no duration. The old MPC-HC splitter has no problems figuring out the duration and seeking, the main reason I keep using an old version.

DragonQ
4th February 2014, 22:14
Nev, if a 25i video is played with YADIF 2x enabled in LAV Video, MadVR still reports that the frame rate is 25 fps rather than 50 fps. Can you correct this please?

nevcairiel
4th February 2014, 22:38
Not really, you never really know if a stream is interlaced or just pretends to be.

DragonQ
4th February 2014, 22:45
Damn, I can't think of any other way to sort out MadVR profiles on a GPU where it fails DXVA deinterlacing.

madshi
4th February 2014, 22:57
Isn't there a point when LAV decides whether to apply YADIF or not? And when it applies YADIF, does it only do that frame-by-frame? Or does it stay in YADIF mode once it enters it?

nevcairiel
4th February 2014, 23:26
Isn't there a point when LAV decides whether to apply YADIF or not? And when it applies YADIF, does it only do that frame-by-frame? Or does it stay in YADIF mode once it enters it?

Default is frame-by-frame, you can configure that though, aggressive mode deints all frames once one was interlaced.
I could make it send a new media type once YADIF is created the first time and send the new frame rate under the assumption its correct, but it might as well be wrong for the majority of the stream.

madshi
5th February 2014, 00:47
Hmmmm... A simple solution which can't go wrong would be to send the new frame rate only if agressive mode is active. That might already help. A more complicated solution would be to update the frame rate if it stays the same for the e.g. 100 frames in a row or so. If you don't like the complicated solution I think I would still prefer to get the double rate information when YADIF is created the first time. From the view point of madVR I think it's better to err on the high side of the frame rate.

DragonQ
5th February 2014, 02:10
Hmmmm... A simple solution which can't go wrong would be to send the new frame rate only if agressive mode is active.

I don't think this "aggressive mode" is exposed to the user though.

I'm not sure what difference it would make if MadVR was told the video was 50 fps when in fact it was 25 PsF, for example. DXVA2 deinterlacing produces 50p anyway for 25 PsF streams and that works fine. I have no idea how YADIF handles 25 PsF but presumably the output would be 50p regardless (if that's selected)? If not then...I dunno.

iSunrise
5th February 2014, 17:34
@nevcairiel:
When I usually need samples for e.x. bug reports I use the linux DD command to cut a certain part out of a file to be sure that itīs bit-identical and thereīs no additional tinkering with it through a remuxer or some editing application that does changes to the file/header. Iīve never ran into any problems with that until today, when I cut the first 100MB of a prores clip (itīs in a mov container) that just wouldnīt play.

Is there something special about prores/mov that doesnīt let LAV/ffmpeg parse/decode the file correctly? Because with every of about a couple dozen of my other files (also some mov containers, however, they donīt have prores video and PCM audio) that worked just perfectly.

Hereīs a sample (first 100MB, original filesize is 6GB):
http://www.mediafire.com/download/728mgs6qcs54krr/prores_sample.mov

Iīm using the latest official LAV Filters 0.60.1.

nevcairiel
5th February 2014, 17:36
Most MOV/MP4 files have the headers at the end of the file, so if you cut the end off, it stops functioning.
Only MOV/MP4 files which are optimized for streaming have the headers at the front.

Not every format can be cut in small pieces as simply as using DD. For example if you do it with MKV, you'll most likely use the ability to seek, and of course only the first segment works at all.
MOV is one of those were its easy to break it.

iSunrise
5th February 2014, 18:35
Most MOV/MP4 files have the headers at the end of the file, so if you cut the end off, it stops functioning.
Only MOV/MP4 files which are optimized for streaming have the headers at the front.

Not every format can be cut in small pieces as simply as using DD. For example if you do it with MKV, you'll most likely use the ability to seek, and of course only the first segment works at all.
MOV is one of those were its easy to break it.
So the reason why other MOV containers work is that theyīre probably all optimized for streaming (like the Apple trailers). Thanks for the explanation. Headers at the end of a file is a strange concept.

nekromantik
5th February 2014, 22:36
Quick question, in LAV Audio settings if you choose bitstream all types of audio and you dont have your laptop connected via HDMI then any file with 5.1 audio wont have audio and is played fast.
If you connect it via HDMI then it plays fine but if I want to watch the file only on my laptop alone I need to unselect the bitstream option.
Is this normal? Any workarounds?
Thanks

mindbomb
5th February 2014, 23:32
Quick question, in LAV Audio settings if you choose bitstream all types of audio and you dont have your laptop connected via HDMI then any file with 5.1 audio wont have audio and is played fast.
If you connect it via HDMI then it plays fine but if I want to watch the file only on my laptop alone I need to unselect the bitstream option.
Is this normal? Any workarounds?
Thanks

You can leave the bitstream options unchecked all the time. The one issue with this is DTS-HD MA playback, where you will need an external file to play it back at full quality.
The bitstreaming options tell the software not to decode the audio, and the options are generally used with a receiver since the receiver can decode certain audio formats.

nekromantik
5th February 2014, 23:38
You can leave the bitstream options unchecked all the time. The one issue with this is DTS-HD MA playback, where you will need an external file to play it back at full quality.
The bitstreaming options tell the software not to decode the audio, and the options are generally used with a receiver since the receiver can decode certain audio formats.

Ah ok thanks.
So if I leave it unchecked then I can use laptop to decode the AC3 and DTS and then output it direct to the amp when needed?

clsid
5th February 2014, 23:49
Yes. Only difference is that the amp will get uncompressed audio (PCM) as input instead of AC3/DTS. The sound will be the same.

mindbomb
5th February 2014, 23:53
Ah ok thanks.
So if I leave it unchecked then I can use laptop to decode the AC3 and DTS and then output it direct to the amp when needed?

if you leave it unchecked, lav audio will decode the audio in both cases. This shouldn't cause issues since hdmi receivers can accept decoded audio.

ryrynz
6th February 2014, 02:10
When I power off my receiver and have it use pass through HDMI from my Intel HD 3000 to my TV (2 channels supported), I have the Microsoft DTV-DVD decoder become active instead of LAV Audio.
The issue that arises having this enabled is whenever I switch from fullscreen to windowed mode the video stutters for about 5-10 seconds or so.
Is it possible to have LAV Audio deal with this and potentially avoid this stuttering?

wanezhiling
6th February 2014, 07:41
http://www.sendspace.com/file/8xz535

18fps with LAV :o