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

nevcairiel
26th April 2012, 08:04
If there's no error on my part I'd like to request that the splitter re-estimates its subtitles choice everytime the audio stream gets changed.

Not going to happen.
If at all, this should be a feature a player should implement.


Also is there a way to make MPC use the LAV Splitter Source instead of File Source? Blocking the later and setting LAV as preferred only gives me a "Cannot render file".
Use the Installer, it'll set everything up for the LAV Splitter Source to be used (at least for the file extensions known to the installer)

hmkay
26th April 2012, 08:39
Not going to happen. If at all, this should be a feature a player should implement
Isn't LAV Splitter already patronizing the player by preselecting subtitles? It would only be consistent to enforce the same ruleset you apply at first load.

I try the installer. Thanks.

egur
26th April 2012, 12:16
Of course not.
Like i explained numerous times before, the auto-detection of 4k hardware support is not working properly (yet), so i blacklisted it.

However, i only did so for DXVA2 Native.
QS has no such artificial limitation. If 4K decoding does not work (it doesn't for me), its most likely your driver being bad (or go blame egur)

Can you pinpoint which function fails within my code?
Also which driver version is used?

The function CQuickSyncDecoder::CheckHwAcceleration() should succeed on IVB and fail on SNB.
This is the last check being performed and the rest pass on SNB. If it does fail on IVB then it's probably a bug.

nevcairiel
26th April 2012, 12:21
My IVB is not in my development system, so not easily, no.
I am using the 2712 driver.

I also only tried one clip, maybe there is something odd about it (its 2160p50)

Maybe we should just wait until next week, when Intel will hopefully push out a set of updated drivers to the public.
Right now, we're not even supposed to have the CPUs yet. ;)

SamuriHL
26th April 2012, 12:49
No kidding! :p

Sent from my Xoom using Tapatalk 2

egur
26th April 2012, 13:20
My IVB is not in my development system, so not easily, no.
I am using the 2712 driver.

I also only tried one clip, maybe there is something odd about it (its 2160p50)

Maybe we should just wait until next week, when Intel will hopefully push out a set of updated drivers to the public.
Right now, we're not even supposed to have the CPUs yet. ;)

I'll try to setup an IVB system at work next week (now it's a Hollyday in Israel).

FDisk80
26th April 2012, 15:29
Something else is wrong : look at your screen refresh-rate from the first picture : 56, ... an probably not even constant while it should be 60.
That's the reason why you see these "spikes".
Try with Madvr to find out your real refresh rate from your display.

But this only happens with latest nightly builds of LAV. Older versions work just fine.
I'm guessing the funky refresh rate is also because of LAV.
With older version of LAV refresh rate is exactly 59.94. Without change.
I also posted the problem here.
http://www.svp-team.com/forum/viewtopic.php?id=684

Maybe latest LAV's report the refresh rate wrong and SVP tries to constantly match it, so it's all stutters to hell. Just a guess.

nevcairiel
26th April 2012, 16:09
But this only happens with latest nightly builds of LAV. Older versions work just fine.
I'm guessing the funky refresh rate is also because of LAV.
With older version of LAV refresh rate is exactly 59.94. Without change.
I also posted the problem here.
http://www.svp-team.com/forum/viewtopic.php?id=684

Maybe latest LAV's report the refresh rate wrong and SVP tries to constantly match it, so it's all stutters to hell. Just a guess.

I suggest trying one of my builds, and not unsupported 3rd party builds by other people, i cannot guarantee for anything with them.

I recently posted one here:
http://files.1f0.de/lavf/LAVFilters-0.50.1-50-ga4c4634.zip

Also, you should offer more information then "its broken". Specifically, which decoder configuration you use in LAV (software, dxva, ...), and if it happens with another one too (most importantly, if you use a hardware decoder, try a software one), and which Splitter you're using. It generally also helps to just switch the splitter for a moment, to possibly narrow down the source of the problem.

nevcairiel
26th April 2012, 16:30
Oh, and if the version above still has the issue, please try this one:

http://files.1f0.de/lavf/LAVFilters-svp-lagging.zip

FDisk80
26th April 2012, 16:40
I suggest trying one of my builds, and not unsupported 3rd party builds by other people, i cannot guarantee for anything with them.

I recently posted one here:
http://files.1f0.de/lavf/LAVFilters-0.50.1-50-ga4c4634.zip

Also, you should offer more information then "its broken". Specifically, which decoder configuration you use in LAV (software, dxva, ...), and if it happens with another one too (most importantly, if you use a hardware decoder, try a software one), and which Splitter you're using. It generally also helps to just switch the splitter for a moment, to possibly narrow down the source of the problem.

I did use your nightlies. Same problem.
This is what I have in my filters:

http://i.imgur.com/l5Mdd.jpg

Setup:
HPC-HC x86 v1.6.2.4485 (Set to EVR Custom Pres.) (LAV is set to DXVA2 (copy-back))
SVP v3.1.1 (GPU acceleration OpenCL Enabled)
ffdshow rev 4436 apr 23 2012 MSVC 2010 x86 (needed for SVP to kick in. and use the AviSynth script.)
Any version of LAV after version 0.50.1 – 2012/03/29 is buggy for me.

Any other info you need or something I can try just let me know. :)

FDisk80
26th April 2012, 16:40
Oh, and if the version above still has the issue, please try this one:

http://files.1f0.de/lavf/LAVFilters-svp-lagging.zip

I've completely disabled SVP to test this, so you can see this is not SVP's fault.
The Refresh rate reported is very jumpy. It sometimes goes down to 54Hz and up to 74Hz. With V-Sync enabled in MPC-HC the video is stuttering. The monitor is set to 60Hz as it always was and can't really do anything above this.

http://i.imgur.com/ttNJr.jpg


Now let's go back to older version of LAV v0.50.1 from 2012/03/29
The Refresh Rate is reported correctly now. Constant 59.934Hz. All stuttering stops.

http://i.imgur.com/dDQUl.jpg

nevcairiel
26th April 2012, 17:15
Please test these options (preferably one at a time, not all at once)

- In LAV Video, disable any hardware decoding.
- In LAV Audio, disable "Auto A/V Sync correction"

Does it happen on all files, or just this one?
Is it a MKV file with a DTS-HD Audio Track?

FDisk80
26th April 2012, 17:23
Please test these options (preferably one at a time, not all at once)

- In LAV Video, disable any hardware decoding.
- In LAV Audio, disable "Auto A/V Sync correction"

Does it happen on all files, or just this one?
Is it a MKV file with a DTS-HD Audio Track?

This happens on all files I tried until now.
Yes, In this case this is an MKV with DTS-HD Audio Track.

I'll try what you suggested now.

FDisk80
26th April 2012, 17:34
Please test these options (preferably one at a time, not all at once)

- In LAV Video, disable any hardware decoding.
- In LAV Audio, disable "Auto A/V Sync correction"

Does it happen on all files, or just this one?
Is it a MKV file with a DTS-HD Audio Track?

"Auto A/V Sync correction" was already disabled.
disabling DXVA does fix the problem and refresh rate is reported correctly. 59.93Hz but now there is no DXVA and SVP is raping my CPU:D

nevcairiel
26th April 2012, 17:39
disabling DXVA does fix the problem and refresh rate is reported correctly. 59.93Hz but now there is no DXVA and SVP is raping my CPU:D

That doesn't make much sense... oh well.
Try this one:
http://files.1f0.de/lavf/LAVFilters-test2.zip

If it also doesn't help, try enabling the internal MKV Splitter in MPC-HC and try again then.

DXVA decoding really hasn't changed much since 0.50.1...

FDisk80
26th April 2012, 18:00
That doesn't make much sense... oh well.
Try this one:
http://files.1f0.de/lavf/LAVFilters-test2.zip

If it also doesn't help, try enabling the internal MKV Splitter in MPC-HC and try again then.

DXVA decoding really hasn't changed much since 0.50.1...

THIS! :D
With LAVFilters-test2 the problem is solved, the refresh rate is reported correctly and not jumping all over with DXVA enabled.
No stutters with or without SVP.

:thanks:

nevcairiel
26th April 2012, 18:03
Who knew that AMD cards are *that* picky...

FDisk80
26th April 2012, 18:07
Who knew that AMD cards are *that* picky...

Heh, I guess. So what was it? Or is it to technical?

nevcairiel
26th April 2012, 18:13
Heh, I guess. So what was it? Or is it to technical?

All i changed was how the DXVA decoder was fed with new data to decode. In 0.50.1, it would get one data packet, decode it, and wait for the next. Afterwards, i changed it to be able to get up to 4 packets, so it can skip the waiting for new data in many cases.
I guess for some reason, decoding too fast isn't good for the AMD card. :p It needs the waiting period to catch a breath, or something.

SamuriHL
26th April 2012, 18:19
One more reason to switch to nVidia. :D

FDisk80
26th April 2012, 18:19
All i changed was how the DXVA decoder was fed with new data to decode. In 0.50.1, it would get one data packet, decode it, and wait for the next. Afterwards, i changed it to be able to get up to 4 packets, so it can skip the waiting for new data in many cases.
I guess for some reason, decoding too fast isn't good for the AMD card. :p It needs the waiting period to catch a breath, or something.

Ha! Makes sense. :)

nevcairiel
26th April 2012, 18:28
LAV Filters 0.50.2

LAV Splitter
- Improved support for Playback Rates other then 1.0x
- Improved demuxing performance by implementing a custom Sample Allocator to avoid one extra memory copy

LAV Video
- Fixed a rare crash when using YV12 output on non-mod16 video
- Fixed excessive memory consumption with Haali Splitter and DXVA2-CB
- Fixed a deadlock on dynamic format changes with DXVA2 Native
- Added support for YV24 output

LAV Audio
- Improved support for Playback Rates other then 1.0x
- Support for ALAC and ALS with the MPC-HC MP4 splitter
- Improved A/V Sync on dynamic format changes
- Improved Auto A/V Sync Correction algorithm (lower threshold, faster reaction)
- Fixed audio pitch when bitstreaming 44.1KHz AC3/DTS


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

This version is basically one big bugfix. Some small improvements, a lot of fixes, some internal restructuring, nothing "new" to be really excited about, hence only the minor version increment.

FYI, i'll be working on audio downmixing for 0.51 soon, but i can't be sure when i'll have time to work on that.

DragonQ
26th April 2012, 18:39
Thanks for the option to not re-add Start menu shortcuts every time an upgrade is performed. Great developers listen to their users! :D

fastplayer
26th April 2012, 19:31
This version is basically one big bugfix.:thanks:

FYI, i'll be working on audio downmixing for 0.51 soon, but i can't be sure when i'll have time to work on that.
Great! Does that mean that ffmpeg is finally providing the necessary logic/functions or are you gonna write your own mixer?

nevcairiel
26th April 2012, 20:09
Great! Does that mean that ffmpeg is finally providing the necessary logic/functions or are you gonna write your own mixer?

I'll have to test how their mixing functions work and if they fullfill my needs, i didn't look too closely yet.

sneaker_ger
26th April 2012, 20:55
Any plans to support speex in flv demuxing and speex audio decoding?

Seems some people use it for their wev videos as it's supported by Flash Player:
http://forum.doom9.org/showthread.php?t=164788

Here's the first 15 MB cut with DGSplit:
https://rapidshare.com/files/745628388/speex_in_flv_sample.flv
If you need more just follow the link from the thread and use something like jdownloader.

sneaker_ger
26th April 2012, 21:45
Staying at that sample:
https://rapidshare.com/files/1987282200/high_cpu.mkv

Very high CPU usage for LAV Video in software mode. The file is kinda b0rked, but maybe you want to take a look at it anyways.

ageback
27th April 2012, 00:29
When building commit 98156e2f08ffdfb51d1dd8d2d4443f42e18f878a the following 5 files were not regenerated,they are still old ones.Never happend this issue before.
swscale-lav-2.dll
avutil-lav-51.dll
avformat-lav-54.dll
avfilter-lav-2.dll
avcodec-lav-54.dll

roytam1
27th April 2012, 01:57
build is broken in ffmpeg.git e47a9f7be72d754c9092bc45ef1a4287b1292e95:
libavformat/matroskadec_haali.c: In function 'mkv_read_header':
libavformat/matroskadec_haali.c:458:36: error: 'MatroskaTrack' has no member named 'default_duration'
make: *** [libavformat/matroskadec_haali.o] Error 1

lauhangwoo
27th April 2012, 04:25
Newly added Input Format to LAV Splitter.
mgsts - Metal Gear Solid: The Twin Snakes
WTH!?

nevcairiel
27th April 2012, 05:49
build is broken in ffmpeg.git e47a9f7be72d754c9092bc45ef1a4287b1292e95:
libavformat/matroskadec_haali.c: In function 'mkv_read_header':
libavformat/matroskadec_haali.c:458:36: error: 'MatroskaTrack' has no member named 'default_duration'
make: *** [libavformat/matroskadec_haali.o] Error 1

Fixed, accidentally commited the wrong version. :p

Kurtnoise
27th April 2012, 07:05
Nev, which gcc version did you use to compile lav* libs ?

nevcairiel
27th April 2012, 07:05
Nev, which gcc version did you use to compile lav* libs ?

4.7.0 at this time.

Octo-puss
27th April 2012, 07:08
nev, do you have any rough idea about DVD decoding - as in when? I'd like to get rid of ffdshow ;)

nevcairiel
27th April 2012, 07:09
nev, do you have any rough idea about DVD decoding - as in when? I'd like to get rid of ffdshow ;)

Decoding is easy, however when you want to decode DVD Video, you also need to support Menus and Subtitles, which is not trivial.

Kurtnoise
27th April 2012, 07:10
4.7.0 at this time.

Damn, I use the same version but sometimes LAV Splitter crashes with some random mkv files...I have to debug this.

nevcairiel
27th April 2012, 07:10
Damn, I use the same version but sometimes LAV Splitter crashes with some random mkv files...I have to debug this.

I assume it doesn't happen with my build? :)

Kurtnoise
27th April 2012, 07:12
yes, all is fine w/ your build.

egur
27th April 2012, 08:15
Decoding is easy, however when you want to decode DVD Video, you also need to support Menus and Subtitles, which is not trivial.

There's relatively little code in ffdshow to deal with menus (they are just regular video frames). Video comes in different packets but ffdshow's code is pretty straight forward with this regard.

The issues I had with DVD decoding compared to media files is:
* Need code to parse the new video packets (copy & paste from ffdshow). See ffdshow's CDeCSSInputPin::StripPacket().
* Media Samples arrive with the major type MEDIATYPE_DVD_ENCRYPTED_PACK not MEDIATYPE_Video.
* Decoder will not receive NewSegment or EndOfStream events. Should rely on the async events BeginFlush and EndFlush.
* For menus to display properly, the decoder must not queue frames. The Media SDK decoder delays the output frames too much that's why it doesn't work for me. You should use libavcodec. Maybe the 15.16 family drivers fixed this. I need to check.

nevcairiel
27th April 2012, 08:19
I have decoding working, thats not the problem.
All thats missing is actually rendering of the Menu overlays and the subtitles.

The only "problem" i have is that this doesn't work with the QS decoder, because for some reason you choose to require a IMediaSample input, instead of just a straigh-forward byte-buffer. Guess i need to write soem code to re-pack the stripped byte buffer into a Media Sample to allow QS to use it.

droc
27th April 2012, 08:31
Sorry guys) may be i don`t understand.I want Yv24 output with LAV, what i need to do in Mpc-hc output???

egur
27th April 2012, 08:52
I have decoding working, thats not the problem.
All thats missing is actually rendering of the Menu overlays and the subtitles.

The only "problem" i have is that this doesn't work with the QS decoder, because for some reason you choose to require a IMediaSample input, instead of just a straigh-forward byte-buffer. Guess i need to write soem code to re-pack the stripped byte buffer into a Media Sample to allow QS to use it.

Like I just wrote, I don't support DVD decoding because of the MSDK decoder frame delay. You can try flushing the QS decoder on every menu frame if you can identify them...
If you know how to do this, let me know and I'll patch up ffdshow.

I'll add second decode function that accepts a buffer+size.

Sebastiii
27th April 2012, 12:14
Fixed, accidentally commited the wrong version. :p

Thanks :)

nevcairiel
27th April 2012, 14:39
Staying at that sample:
https://rapidshare.com/files/1987282200/high_cpu.mkv

Very high CPU usage for LAV Video in software mode. The file is kinda b0rked, but maybe you want to take a look at it anyways.

It has a very high CPU usage because it timestamps want it to play at something like 1000fps.
It'll decode as fast as it can, or more likely as fast as the renderer can consume the frames, which was something like 300 fps for me.

sneaker_ger
27th April 2012, 14:58
Ah, yes, I see. Timecodes are always +1ms of the preceding timecode. I was converting the files using a few different ways and one of them got the timecodes wrong and I didn't notice because of this strange game instead of live action. Sorry for that.

Thunderbolt8
27th April 2012, 22:06
All i changed was how the DXVA decoder was fed with new data to decode. In 0.50.1, it would get one data packet, decode it, and wait for the next. Afterwards, i changed it to be able to get up to 4 packets, so it can skip the waiting for new data in many cases.
I guess for some reason, decoding too fast isn't good for the AMD card. :p It needs the waiting period to catch a breath, or something.I dont know whether this has to do with this^^, but playing the twinpeaks.1080.wmv test file does now work smoothly without any dropped or delayed frames for me with dxva2 native mode, while it didnt before (also not with copy back method; active decoder: wmv9 dmo)

coreavc is still faster than dxva2 though in case of avc/h264

aufkrawall
27th April 2012, 22:16
FYI, i'll be working on audio downmixing for 0.51 soon, but i can't be sure when i'll have time to work on that.
Great news, that's what keeps me away from using LAV audio.
Will there also be a simple volume gain feature?

Really great work with 0.50.2, now x264 I444 works well with default settings and EVR.
This will hopefully make it easier to deploy such videos.

Superb
27th April 2012, 23:00
Yep, 0.50.2 works really great here too. Everything is smooth.
Can't wait for the audio mixer.
Thank you nev.

cengizhan
28th April 2012, 03:50
if you use Lav splitter with avi files containing mp3 track and seek fast with keyboard you hear lots of poppings, clickings etc. Also with some mp3 files seek bar is disabled. i am using latest mpc-hc and latest lav filters 0.50.2. will post some files later.

Alexey1975
28th April 2012, 10:00
Hi, nevcairiel
Thank you for adding YV24 support in LAV VD. But for nVidia videocard owners it's need NV24 support.
It wouldn't be superfluous :o