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 509 510 511

DragonQ
17th December 2013, 01:57
XP host can't compile LAV now, since newer versions of VS won't install on XP.
Cry me a river. :sly:

nevcairiel
17th December 2013, 07:42
I don't care if people still use XP, its their decision, and even if I personally wouldn't touch XP with a 10ft pole anymore, in the ends its their choice.
However, I won't let a 12 year old OS stand in the way of progress. :)

QQ
17th December 2013, 08:00
Hello,

how can I set network/input buffer on LAV Splitter? I have a wide bandwidth connection which isn't very stable, and would like to increase the buffer size..

wanezhiling
17th December 2013, 08:14
http://www.sendspace.com/file/kxx361
Latest git.
Playback is not smooth for some reasons (I guess that problem is in LAV V?)

nevcairiel
17th December 2013, 08:40
The file is just screwed up. It doesn't have a FPS, it doesn't have proper timestamps, what is it supposed to use to make playback smooth?

mkvtoolnix does NOT support RV40 in MKV correctly. In fact, I don't know of any tool that does.
Better encourage people to stop creating those files.

PS:
If you use a header editor to set the default duration to the appropriate FPS, it should probably play better.

wanezhiling
17th December 2013, 08:45
Hmm.. Real codec seems fine.
Well Broken files are broken. :)

wanezhiling
17th December 2013, 09:14
http://www.sendspace.com/file/p57vav
Can't seek, mpc-be seems fine.

nevcairiel
17th December 2013, 09:29
http://www.sendspace.com/file/p57vav
Can't seek, mpc-be seems fine.

That MP4 seems to have only one keyframe marked in its index, and seeking requires keyframes, so it seeks always to the first frame in the file.

While its possible that there are actually more keyframes that would allow seeking, in a MP4 they need to be marked in its index, or seeking becomes hard.

wanezhiling
17th December 2013, 09:32
Thanks for explanation.
Another thing about HEVC in mp4: lav s can't connect mpc video decoder (MPC-BE) and PotPlayer's video decoder.

NikosD
17th December 2013, 10:10
Nevcairiel,

I tried latest nightly build by roytam1 here (http://roy.orz.hm/lavf-w32-nightlies/) and I'm amazed by the progress you have made.

There is no slow start for any clip and there is no audio playing with frozen image.
There is only one clip with artifacts.

I have only 3 points:

1) During VC-1 seeking the image still pauses for a sec, with no audio playing and then starts again synchronized with audio.

I mean is not instant seeking.

If you do the seeking a lot of times, then it becomes instant.

In WMV3 clips, it is less obvious.


2) This clip still has a few artifacts in both DXVA native and CB:

http://www.sendspace.com/file/2ho9i9

3) The H.264 4080p file still is not recognized as HW accelerated in DXVA-CB using DXVA Checker (it doesn't select any suitable Decoder Device) and uses as much CPU as possible.

In order to check it with DXVA Checker, you have to force close Microsoft DTV-DVD video decoder (or disable DXVA acceleration for that decoder), because it can't handle that file and stalls DXVA Checker.

If you press the force close button, the app goes on and you can test DXVA-CB with LAV Video.

betaking
17th December 2013, 14:57
can not complier lavvideo.ax by last git 273b52e5ab5d0fb249419513487a45ef6baafa44

Asmodian
17th December 2013, 20:29
Just as a general information, as of today, compiling LAV Filters requires Visual Studio 2013, as I've started to use C++11 features which are not available in VS2012.
Please don't even bother complaining, I have thought about this decision for a while now, and I'll stick with it. As the only developer its my decision and mine alone.

While its only in one function as of today, and could be written differently to avoid this requirement, I do not want to have to think about this, and instead write code easier and more productively.

Maybe this is why?

clsid
17th December 2013, 21:51
The file is just screwed up. It doesn't have a FPS, it doesn't have proper timestamps, what is it supposed to use to make playback smooth?

mkvtoolnix does NOT support RV40 in MKV correctly. In fact, I don't know of any tool that does.
Better encourage people to stop creating those files.

PS:
If you use a header editor to set the default duration to the appropriate FPS, it should probably play better.Haali splitter has an option called "Force fake 25 fps in media type". If I enable that then the video plays smoothly at 23.976 fps.

noee
17th December 2013, 22:27
FYI, folks who want to use "express", you'll have to copy the /VC/atlmfc folder from a prev version...

You can then build it from the IDE. I don't think express has a command line build option.

nevcairiel
17th December 2013, 23:47
Haali splitter has an option called "Force fake 25 fps in media type". If I enable that then the video plays smoothly at 23.976 fps.

Probably not entirely smoothly, but 25 is close enough to not notice.
Anyway, its a hack for a broken file, might as well just get mkvtoolnix and add a defaultduration to the file.

andyvt
18th December 2013, 00:13
Just as a general information, as of today, compiling LAV Filters requires Visual Studio 2013, as I've started to use C++11 features which are not available in VS2012.
Please don't even bother complaining, I have thought about this decision for a while now, and I'll stick with it. As the only developer its my decision and mine alone.

While its only in one function as of today, and could be written differently to avoid this requirement, I do not want to have to think about this, and instead write code easier and more productively.

Are you going to start building ffmpeg with VS2013?

ryrynz
18th December 2013, 00:34
That's what the notes say, minimum requirement is VS2013. Oops that's LAV not FFmpeg.

nevcairiel
18th December 2013, 08:32
Are you going to start building ffmpeg with VS2013?

No, ffmpeg is build with GCC, and will remain that way. VS builds are simply quite a bit slower.
I made a speed comparison a while ago: https://docs.google.com/spreadsheet/ccc?key=0Ajo8vvjNtaZ5dFhqZ3BZQXZ0SW55RHdaWVctWmFxTnc&usp=sharing

clsid
18th December 2013, 18:29
Are there any downsides to overriding AvgTimePerFrame with a guessed value whenever it is zero?

Changing
avgFrameDuration = vih2->AvgTimePerFrame;
to
avgFrameDuration = vih2->AvgTimePerFrame ? vih2->AvgTimePerFrame : 400000;
in CLAVVideo::ReconnectOutput improves playback of the posted sample. Not perfect, but better than current behavior for those who don't know how to remux a file.

NikosD
18th December 2013, 21:47
No, ffmpeg is build with GCC, and will remain that way. VS builds are simply quite a bit slower.
I made a speed comparison a while ago: https://docs.google.com/spreadsheet/ccc?key=0Ajo8vvjNtaZ5dFhqZ3BZQXZ0SW55RHdaWVctWmFxTnc&usp=sharing

Any particular reason you don't use Intel compiler ?

I had used it 3-4 years ago and it was the fastest compiler out there.

nevcairiel
18th December 2013, 22:44
Any particular reason you don't use Intel compiler ?

I had used it 3-4 years ago and it was the fastest compiler out there.

GCC is faster for FFmpeg, and ICC is generally buggy because of too aggressive optimizations. Speed is no problem, as long as it doesn't need to work correctly. ;)
Also, ICC costs a lot of money.

wanezhiling
19th December 2013, 16:03
how do I force using LAV Audio Decoder for playback of Opus track?
http://i1.tietuku.com/dtft7aarm.png
FYI

NikosD
20th December 2013, 11:55
Eventually it seems that my old dog ATi Radeon 5750 card has the same performance between DXVA native and DXVA CB.

On a new platform with a PCI Express 2.0 x16 speed, you can't tell a performance difference between the 2 modes (except a minor CPU utilization and a small GPU load for copy-back of course).

But the average FPS are the same.

The bottleneck was my old platform with the PCI Express 1.1 x4 speed and not the card itself.

The ATi 5000 series even after four years, remain impressive cards and they were certainly ahead of their time.

STaRGaZeR
21st December 2013, 17:46
Nev, I just compiled myself a build with VS2013 to test it out, and I'm seeing something weird here. Every time I open some MKV files there is a stutter 1-2 seconds into the file. If you stop and replay it, it's gone. Put MPC-HC in repeat forever and it's also gone. Only the first time you open it. Can't remember seeing this in eairlier versions. Sample below. Tested with EVR, EVR Custom and Video Renderer, same result.

https://www.mediafire.com/?wa9gma1a0s6oasg

nevcairiel
21st December 2013, 18:05
Nev, I just compiled myself a build with VS2013 to test it out, and I'm seeing something weird here. Every time I open some MKV files there is a stutter 1-2 seconds into the file. If you stop and replay it, it's gone. Put MPC-HC in repeat forever and it's also gone. Only the first time you open it. Can't remember seeing this in eairlier versions. Sample below. Tested with EVR, EVR Custom and Video Renderer, same result.

https://www.mediafire.com/?wa9gma1a0s6oasg

Fixed, it was caused by a change in timestamp handling in LAV Audio that didn't consider one special case when dealing with PCM audio, but its fine again now.

Thanks for reporting!

STaRGaZeR
21st December 2013, 20:14
Fixed, it was caused by a change in timestamp handling in LAV Audio that didn't consider one special case when dealing with PCM audio, but its fine again now.

Thanks for reporting!

Fixed! Indeed, all of them had PCM audio inside. However, I'm still seeing kind of slow seeking on H.264+PCM mkv files (remuxed BDs). Audio seeks instantly, but video freezes for some time until it resumes playback. Not in all seeks though. I've tested previous versions and 0.59 was quite a bit faster here.

Happy holidays!

mindbomb
22nd December 2013, 00:38
I'm glad the issue is fixed, but I'm wondering why you didn't convert the pcm to flac? It gives you smaller sizes and better compatibility.

Soukyuu
22nd December 2013, 13:05
Size, yes, but compatibility? PCM is just a raw format, virtually anything can decode that. FLAC however, requires a decoder that decodes to PCM anyway.
That aside, I imagine the sample was ripped from a DVD/BD, with PCM kept to demonstrate the issue.

STaRGaZeR
22nd December 2013, 14:54
These are mostly stereo tracks, compared to video they are very small (~270MB for each 25 minutes), I guess that's why they are PCM in the first place. FLAC will certainly reduce that, but not worth the hassle.

I have a few PCM 5.1 BDs (Pirates of the Caribbean, Black Hawk Down) where the size is significant, but AFAIK there aren't many BDs out there with 5.1 PCM tracks.

Stanislav Mikhailenko
25th December 2013, 13:06
Hi,
i've the file https://dl.dropboxusercontent.com/u/9992211/trimmed.mp4 that is played by ffdshow, Microsoft DTV, Elecard AVC video decoder, MPC Video Decoder fine,
but with LAV Video decoder (LAV Filters 0.59.1 )there is colors distortion in the middle while playing

Could you please check it?

XinHong
25th December 2013, 13:58
Nev,

I can not read this file (http://6p6fvr.1fichier.com/) (6.3 MB). With MPC-HC and MPC-BE the file opens but don't start, timestamp remains 00:00:00.

Video codec is AVC but I don't know the encoder because it's not shown in MediaInfo.

I can read it with mplayer, this is the log:

Playing sample.mkv.
ID_VIDEO_ID=0
ID_VID_0_NAME=Vostfr
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC) "Vostfr", -vid 0
ID_AUDIO_ID=0
ID_AID_0_NAME=Japonais
ID_AID_0_LANG=jpn
[mkv] Track ID 2: audio (A_AAC) "Japonais", -aid 0, -alang jpn
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1280x720 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=sample.mkv
ID_DEMUXER=mkv
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=1280
ID_VIDEO_HEIGHT=720
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=1.7778
ID_AUDIO_FORMAT=MP4A
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=60.95
ID_SEEKABLE=1
ID_CHAPTERS=0
[ass] auto-open
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
[ass] Init
[ass] Updating font cache
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [dsound] 48000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=faad
[Mixer] No hardware mixing, inserting volume filter.
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.7778
VO: [direct3d] 1280x720 => 1280x720 Planar YV12
ID_VIDEO_TRACK=1
ID_AUDIO_TRACK=0

===== PAUSE =====
ID_PAUSED


Thanks

Sylt
25th December 2013, 15:41
Hello Nev,

can you please add Support for Voxware MetaSound Audio Codec? FFMPEG support this codec already.

Sample Video 1 (http://www.landeck-tirol.com/feuerwehr/media/video/2004_brand-pfunds.asf)

Sample Video 2 (http://www.landeck-tirol.com/feuerwehr/media/video/2004_brand-eisenbahnbruecke-landeck.asf)

nevcairiel
25th December 2013, 20:31
Hi,
i've the file https://dl.dropboxusercontent.com/u/9992211/trimmed.mp4 that is played by ffdshow, Microsoft DTV, Elecard AVC video decoder, MPC Video Decoder fine,
but with LAV Video decoder (LAV Filters 0.59.1 )there is colors distortion in the middle while playing

Could you please check it?

Should hopefully be fixed.


I can not read this file (http://6p6fvr.1fichier.com/) (6.3 MB). With MPC-HC and MPC-BE the file opens but don't start, timestamp remains 00:00:00.

The file violates the H.264 spec, it has several values in its headers which are out of range for the spec, which cause the decoder to reject reading it.

Can't really fix files that violate the codec spec, sorry.
mplayer probably uses a much older decoder, which doesn't have these validation checks yet. But i looked it up, and the checks where added to prevent infinite loops and other exploits on malformed/malicious files.


can you please add Support for Voxware MetaSound Audio Codec? FFMPEG support this codec already

I added support, however playback isn't entirely flawless it seems. Not sure why it doesn't work properly.
If you use LAV Splitter to read the ASF files, it works better, though.

omarank
26th December 2013, 06:38
When LAV video's mjpeg decoder is active, apparently it outputs in TV color levels and flags the output with PC color levels. I have seen this problem of incorrect levels with DCP samples and still image files which activate the mjpeg decoder.

NikosD
26th December 2013, 08:25
Nevcairiel,

I did some tests with your HW decoder and I think you should make some changes.

You artificially cut any clip above 1920 width or 1080 height, when both VP4 and UVD can go further.

In order to help you I can tell you that:

1) H.264 DXVA width limit is:

For VP4 -> 2032 x 720
For UVD -> 2064 x 720

2) H.264 DXVA height limit is:

For VP4 -> 1280 x 1632
For UVD -> 1280 x 2304

3) H.264 DXVA Square limit is:

For VP4 -> 1440 x 1440
For UVD -> 2048 x 2048

nevcairiel
26th December 2013, 10:09
You artificially cut any clip above 1920 width or 1080 height, when both VP4 and UVD can go further.


There are no artificial limits, it asks the hardware if a resolution is supported.
Just make sure to tic all the resolution check boxes in the configuration, anything above 1920x1080 counts as UHD regarding the configuration.

When LAV video's mjpeg decoder is active, apparently it outputs in TV color levels and flags the output with PC color levels. I have seen this problem of incorrect levels with DCP samples and still image files which activate the mjpeg decoder.

JPEG is typically always full-range content, its even commonly called JPEG-Color-Range and MPEG-Color-Range, for PC/Full and TV/Limited respectively.
In any case, jpegs can also carry metadata that say which color range it is, if its not supposed to be full-range, this metadata should be present.

NikosD
26th December 2013, 10:13
I did that, I checked UHD and nothing changed.

It falls back to software for every clip above 1920x1080, for both UVD and VP4.

nevcairiel
26th December 2013, 10:16
I did that, I checked UHD and nothing changed.

It falls back to software for every clip above 1920x1080, for both UVD and VP4.

Then your hardware refuses to decode those resolutions, at least with VP4.

AMD is currently limited to Full-HD, because their crappy driver is broken with UHD decoding, and those special resolutions are too rare to worry about them. Not spending time on fixing broken AMD messes, either.

NikosD
26th December 2013, 10:29
But with the same drivers, PotPlayer doesn't refuse to accelerate in HW those resolutions, at least for AMD.

If you actually leave it to the driver to choose if a resolution can be HW accelerated or not, then it should be accelerated judging by PotPlayer that can do it.

That's why I said you artificially cut the resolutions above 1920 x 1080.

You said the same thing about crappy drivers for Intel's VC1_VLD2010 support, but it was proved by yourself that you were completely wrong.

You , had to update your VC-1 decoder to the new standard of VC-1 (2010) in order to be DXVA VC1_VLD2010 compatible.

I think the same goes for AMD 2k x 2k support.

You have to update your decoder, not AMD.

Of course, I don't doubt that every driver release is not completely consistent with previous drivers and a lot of times they break things.

But this is not the case, as VC1_VLD2010 was not the case.

The work has to be done by your side and you have to stop complaining every time because you have things to do and not the others.

You always blame the other developers, like a little kid.

But I don't doubt that you are a talented developer.

nevcairiel
26th December 2013, 10:37
I blame AMD drivers, because they are crap. They claim they support 4K decoding, and output a corrupted mess, so anything above Full-HD is disabled.
I know that i could enable 2k x 2k decoding, but i don't want to. Feel free to use something else.

NikosD
26th December 2013, 10:45
so anything above Full-HD is disabled.


After three posts we finaly say same thing, everything above Full HD is artificially disabled by you.


I know that i could enable 2k x 2k decoding, but i don't want to. Feel free to use something else.

The last months AMD has disabled 4K decoding, so you won't get corrupted images by enabling more than 1920 x 1080 decoding.

Also, I gave you specific secure limits that you can enable without messing the picture for sure.

If you leave it to the driver, you can go safe.

I like LAV filters and I will use it, even if you don't fix it.

wanezhiling
26th December 2013, 11:58
I think LAV will remove the limit if AMD really support 4K decoding one day, like current NVIDIA VP5 & Intel IVB/HAS do at least.
Its meaningless to open those special resolutions 2064 x 720, 1280 x 2304, 2048 x 2048... for AMD.

NikosD
26th December 2013, 12:40
Leave it to the driver, unless you have a good reason not to do so.

wanezhiling
26th December 2013, 12:56
Leave it to the driver, its dangerous.
The latest legacy driver for HD2000-4000 still enables 4K.

And even for HD5000 above, many people are still using a very old driver, did you consider that?

NikosD
26th December 2013, 16:51
I tested my old ATI Radeon 3650 (UVD+) under Win XP SP3 with legacy drivers.

I used latest MPC-HC standalone filters before the integration of LAV filters which is v1.6.9.7503 of 30-06-2013

This ancient card with ancient drivers under an ancient OS managed to HW accelerate a lot of clips over full HD and under the 2k x 2k restriction, through DXVA1.

Anything else ?

wanezhiling
26th December 2013, 17:19
I've got BSOD many times on ATI myself, so I'd rather keep Full HD limitation.
If you care 2k x 2k, feel free to use something else, cuz LAV author doesn't care (I agree with him).

NikosD
26th December 2013, 17:23
Are you his lawyer or something ?

How old are u ? 18 ?

Waisting my time with kids...

wanezhiling
26th December 2013, 17:38
Hope nev open 2k for AMD,for you, you could wait for that day.

Same here, I won't waste my time with you any more, you are always so overbearing.

Boltron
26th December 2013, 17:45
It's obvious who the kid is here. Learn some manners why don't you.

avih
26th December 2013, 18:59
Keep it on topic, please. Thank you.