View Full Version : LAV Filters - DirectShow Media Splitter and Decoders
fluffy01
6th December 2013, 08:51
Ahh ok. That makes more sense. I just assumed that LAV was automatically making use of all the cores and that the multi-threading worked well there.
That's why I was so puzzled over the lack of power.
But if the threading problem is in ffmpeg, I guess that would explain my problems.
Thanks for the effort and the quick reply.
If you need a bigger sample for any reason, let me know.
fluffy01
6th December 2013, 15:36
Btw. Sorry if I seemed a little daft by not understanding what you pointed out already in the 2nd answer. I somehow misread what you said about threading in ffmpeg, and didn't put two and two together...
I guess I was a bit tired last evening after a hard day at work.
So thanks for the patience and for spelling it out to me two more times before I finally realized what you were writing :)
nevcairiel
6th December 2013, 15:47
No worries. :)
The good news is that we've found where the speed went down, it was a change in the H264 decoder in March '13, which would explain why ffdshow is still faster, since its ffmpeg decoder is from Aug '12.
Just needs a fix now. :)
fluffy01
6th December 2013, 16:14
Cool! That is awesome news :)
Is it related to the 10 bit, 4:2:2 or the interlaced part of the video? Or maybe a combination? Not that it is important, I'm just curious :)
nevcairiel
7th December 2013, 08:56
Is it related to the 10 bit, 4:2:2 or the interlaced part of the video? Or maybe a combination? Not that it is important, I'm just curious :)
It was related to the clip being interlaced. The error correction didn't work properly on interlaced clips and thought there were errors when there actually weren't any, blocking the decoding.
Anyhow, the issue has been fixed, and with 4 threads the performance increased by about 60% for me (from 33 fps to 53 fps)
Sadly it still doesn't multi-thread ideally, so the CPU usage may still not reach 100%, but it should hopefully play properly.
Here is a test build:
http://files.1f0.de/lavf/LAVFilters-0.59.1-52-g0b90b46.zip
fluffy01
7th December 2013, 10:11
That was fast :)
It works now. It plays the clip flawlessly now :)
CPU increased to about 48% now, so I guess it was just a couple of percent too slow before, and now it has enough power :)
Awesome job! Thanks.
Thunderbolt8
8th December 2013, 13:31
would it be possible to upload the small sample somewhere public?
Bandito
9th December 2013, 13:56
Is it normal for the temperature of my graphics card to go up by 15-20 degrees when I'm watching something on MPC even though I have "Hardware decoder to use" set to None in LAV video options? I don't even have to be playing the video. If I have it paused the temperature still increases by 15 degrees.
sneaker_ger
9th December 2013, 14:11
Probably has something to do with the interaction of the OS'/GPU's power management and the renderer, not with LAV. Some cards go into low power state when using DXVA, so not using the graphics card for decoding can have the counter-intuitive effect of actually raising its power usage.
michkrol
9th December 2013, 16:39
Is it normal for the temperature of my graphics card to go up by 15-20 degrees when I'm watching something on MPC even though I have "Hardware decoder to use" set to None in LAV video options? I don't even have to be playing the video. If I have it paused the temperature still increases by 15 degrees.
The GPU is used for displaying the video (obviously) and scaling the picture, which can use lots of power. If you're on madVR check with bilinear set for all scaling, just to be sure.
It's normal for the GPU to get hotter, but 15 degrees at pause is a little to much.
As mentioned by sneaker_ger might have to do with power profile or the renderer, so check the core frequency at pause with GPU-Z (or similar) and perhaps check with another renderer/media player. Make sure you're not running a web browser or some other software that uses the GPU in background.
And yes, it's not LAVFilters-dependant.
vood007
9th December 2013, 16:50
Is it normal for the temperature of my graphics card to go up by 15-20 degrees when I'm watching something on MPC even though I have "Hardware decoder to use" set to None in LAV video options? I don't even have to be playing the video. If I have it paused the temperature still increases by 15 degrees.
If you have a Nvidia card get "Nvidia Inspector" and use its "MultiDisplay Powersaver" to force your card into the low power profile whenever possible and only go to higher mode when necessary. http://orbmu2k.de/tools/nvidia-inspector-tool
Eliminateur
10th December 2013, 04:27
nev, wanted to ask you something that's been going around my mind for quite some time:
¿How does LAV filter deal with deblocking?, specially compared to old ffdshow "disable deblocking" / "disable deblocking when safe".
is LAV deblocking always?
wanezhiling
10th December 2013, 05:42
Always.
LAV will never add some feature/option to hurt quality.
Bandito
10th December 2013, 14:03
Probably has something to do with the interaction of the OS'/GPU's power management and the renderer, not with LAV. Some cards go into low power state when using DXVA, so not using the graphics card for decoding can have the counter-intuitive effect of actually raising its power usage.
I've tested it using CUVID and the temp actually goes higher by like 5 degrees.
The GPU is used for displaying the video (obviously) and scaling the picture, which can use lots of power. If you're on madVR check with bilinear set for all scaling, just to be sure.
It's normal for the GPU to get hotter, but 15 degrees at pause is a little to much.
As mentioned by sneaker_ger might have to do with power profile or the renderer, so check the core frequency at pause with GPU-Z (or similar) and perhaps check with another renderer/media player. Make sure you're not running a web browser or some other software that uses the GPU in background.
And yes, it's not LAVFilters-dependant.
You mean I should use Bilinear for chroma upscaling and image up/downscaling? I had it set to Jinc 3 taps for chroma and image upscaling and Catmull-Rom for image downscaling.
I typically do have my browser open at all times. I will check the core freq. with GPU-Z.
If you have a Nvidia card get "Nvidia Inspector" and use its "MultiDisplay Powersaver" to force your card into the low power profile whenever possible and only go to higher mode when necessary. http://orbmu2k.de/tools/nvidia-inspector-tool
Ok thanks for this suggestion.
nevcairiel
10th December 2013, 14:06
I've tested it using CUVID and the temp actually goes higher by like 5 degrees
CUVID is special, it always forces the GPU into maximum performance mode.
Try DXVA2 Native as the least CPU/GPU intensive option.
michkrol
10th December 2013, 14:12
You mean I should use Bilinear for chroma upscaling and image up/downscaling?
Sorry, phrased it wrong. Test your temps with bilinear and your current settings, so you know it's high because of GPU usage. It probably is while using Jinc3. The GPU-Z will also allow you to check the GPU usage with different renderer's settings, while you're at it.
If you still have problems after trying every suggestion, consider creating a separate forum thread as we're going more and more offtopic.
iSunrise
10th December 2013, 17:46
nev, did you see my question here:
http://forum.doom9.org/showthread.php?p=1656716#post1656716
Just wondering, since usually you´re pretty fast answering these requests. Thanks.
NikosD
10th December 2013, 18:04
Nevcairiel,
Haswell QS now supports VC1_VLD2010 which can decode VC-1 progressive in DXVA native mode.
I found a lot of problems with LAV Video 0.59.1 using that decoder.
WMVideo MFT and PotPlayer built-in have no problem decoding VC-1 progressive and WMV3 in DXVA native mode.
VC-1 interlaced, still has problems even using that new VC-1 mode.
Can you fix them (ideally both) ?
nevcairiel
10th December 2013, 19:50
Can you add RTMP-support to the splitter filter?
Network protocols are stupid. I would rather remove support for the ones i have.
In any case, RTMP is even more stupid then the others, so it may not happen anytime soon.
Haswell QS now supports VC1_VLD2010 which can decode VC-1 progressive in DXVA native mode.
"Supports". All i get is crashes deep in Intels driver. They need to learn to write code that doesn't crash. I'm not going to waste my time on this.
Its already turned off for the next LAV version so that no-one can accidantelly crash their PC on intels broken driver.
Use the QuickSync decoder on Intel, problem solved.
NikosD
10th December 2013, 20:00
"Supports". All i get is crashes deep in Intels driver. They need to learn to write code that doesn't crash. I'm not going to waste my time on this.
On signature system and drivers both WMVideo MFT decoder and PotPlayer's built-in codecs have no problem playing in DXVA native VC-1/WMV3 clips.
Usually if something is supported by PotPlayer's built-in codecs, LAV video also supports it because both are based on ffmpeg.
Why not VC1_VLD2010 mode ?
nevcairiel
10th December 2013, 20:07
How do you know potplayer doesn't use the Intel MediaSDK for DXVA?
I could tell you if they had a standalone decoder, but they don't, you have to use their weirdo player, so i cannot tell anything about the decoder.
That they violate the GPL and don't provide the source code for their ffmpeg does not help, either.
NikosD
10th December 2013, 20:16
How do you know potplayer doesn't use the Intel MediaSDK for DXVA?
That's an easy answer for me.
Because PotPlayer supports both modes - DXVA native and QuickSync decoder (using MediaSDK)
When you enable DXVA native the CPU utilization goes down.
If you use QS mode, the CPU goes up.
I could tell you if they had a standalone decoder, but they don't, you have to use their weirdo player, so i cannot tell anything about the decoder.
Their player is unique and very useful for me - it even supports partial acceleration for older GPUs and DXVA1 for Windows XP.
That they violate the GPL and don't provide the source code for their ffmpeg does not help, either.
True but...
And what about WMvideo MFT ?
nevcairiel
10th December 2013, 20:16
That's an easy answer for me.
Because PotPlayer supports both modes - DXVA native and QuickSync decoder (using MediaSDK)
You can implement dxva native with the Media SDK as well, its not a big deal.
NikosD
10th December 2013, 20:18
But no one else has done it yet ;)
Will you ?
I'm not sure it's that, Intel GPA monitor is not working on signature system.
nevcairiel
10th December 2013, 20:19
Why would I? Just for VC-1?
Its a dying codec, usually with only average bitrates, which work just fine in software, or with QuickSync. There is no use. I don't get paid for this, so I do what i think is useful to me and the users, and this is not. Its just time spent for nothing.
Also, CyberLinks decoder in PowerDVD uses DXVA Native with the Media SDK.
NikosD
10th December 2013, 20:25
Sure, it's your software.
But I think PotPlayer is free too.
Anyway, personally I use LAV Video only in DXVA Checker for testing and benchmarking reasons.
The last 3 years my main playback software is PotPlayer and I don't see that changing soon.
Cybercrap program is not free, like PotPlayer.
Yes there are people nowadays that they pay for crap software like that!
iSunrise
10th December 2013, 21:58
Network protocols are stupid. I would rather remove support for the ones i have.
In any case, RTMP is even more stupid then the others, so it may not happen anytime soon.
Can you define stupid? You mean like the way they work? Well, I just thought that RTMP still seems to be (apart from HLS) widely used a lot and there´s a lot of websites where you can directly stream with a mediaplayer, instead of having a webbrowser open, just for streaming. Not sure why you even added RTP and RTSP in the first place, I never came across an application that uses it, so feel free to remove it.
If RTMP-support is not worth your time, I guess we´d have to rely on the native support of PotPlayer etc. then.
nevcairiel
10th December 2013, 23:04
Yes RTMP i stupid because of the way it works.
Most streams you can't just open a rtmp://server/ URL, noo, it has to send 20 different metadata attributes or it won't work. Its a terrible protocol. No wonder, its of Flash origins.
DragonQ
11th December 2013, 00:00
Yep, it annoys me that MediaPortal uses it for multi-seat environments. You can have a perfect setup with loads of spare bandwidth and no CPU usage and it'll still have discontinuities every now and then. If they sorted out the fact that UNC paths don't work properly when resuming from sleep I could stop using it. >_>
Asmodian
11th December 2013, 00:36
Sure, it's your software.
But I think PotPlayer is free too.
Anyway, personally I use LAV Video only in DXVA Checker for testing and benchmarking reasons.
The last 3 years my main playback software is PotPlayer and I don't see that changing soon.
Wow, are you really saying GPL doesn't matter to you when asking for help from a respected GPL developer? Projects like PotPlayer make developers not want to develop using open source licenses; that is bad. Free does not equal open source. People seem to think the constant improvement to ffmpeg is a given. :mad:
sorry for the rant :o
maneash
11th December 2013, 01:12
I have a question regarding a flv I recorded via rtmpdump - and I wonder if this is the same question as the one with the rtmp support because I don't know exactly what was meant with rtmp support. (Sorry if this may sound totally dumb to you).
I have a rtmpdump'ed flv with speex/h264. I use KMPlayer which has it's own flv splitter or Gabest (http://sourceforge.net/projects/guliverkli/) filter for flv - both make the file perfectly seekable but they both won't give sound.
I tried LAVFilters which gave perfect sound but made the video no longer seekable - you cannot jump in the video.
So is this the question you already answered and you won't fix?
Thanks (&Sorry if it's the same).
Anakunda
11th December 2013, 10:01
Hiyas, how do I force using LAV Audio Decoder for playback of Opus track? In playback info for PotPlayer I see the filter path from LAV Splitter Source (1) to LAV Video Decoder (2) and video Codec/Transform (3) which is something obscure to me but for sure not LAV Audio Decoder. The pitty on that is that splitter is used for matroska correctly, but seems not to control decoders self but rather the player (PotPlayer) which doesn't yet recognize this audio format. So the question would be if I can control audio filter out of player, perhaps on system or splitter level (in CodecTweakTool I verify lavaudio.ax is registered and enabled, but no see where I can setup the decoder priority.
nevcairiel
11th December 2013, 10:03
If the player has its own way of controlling which decoders get used for playback, you'll have to to ask the players developers how to force another codec. I'm afraid in such a case there is nothing that can be realistically done from the filter level.
Anakunda
11th December 2013, 10:12
I'm afraid of that. Can you verify that PotPlayer doesnot control, and what is the Video Codec/Transform thing? I suppose that by some setting lavaudio.ax can substitute generic VideoTransform filter.
wanezhiling
11th December 2013, 10:59
Video Codec/Transform is PotPlayer's internal video codec(decoder/encoder) & internal video post-processing filter.
When you use internal video decoder, Video Codec/Transform means deocder & pp filter both.
When you use external video decoder like LAV, Video Codec/Transform means pp filter only. You'd better disable internal video/audio pp filters if you use external video/audio decoders. http://i1.tietuku.com/lyv2kpmgm.png
how do I force using LAV Audio Decoder for playback of Opus track?
You can't, because PotPlayer doesn't offer an interface for this format. http://i1.tietuku.com/xjg6ohkxn.png
NikosD
11th December 2013, 12:30
Nevcairiel,
testing VC-1 1080p60fps clip (40Mbps) I got these results:
1) LAV Video 0.59.1 Avg fps: 175 fps Avg CPU utilization: 53%
(Using QS decoder: VC1_VLD_2_ClearVideo)
2) WMVideo MFT Avg fps: 219 fps Avg CPU utilization: 2%
(Using VC1_VLD2010)
Both decoders have perfect image without artifacts.
Maybe Microsoft developers used DXVA through MediaSDK.
Anakunda
11th December 2013, 12:30
I understand already, thanks for explaining.
NikosD
11th December 2013, 12:55
Why would I? Just for VC-1?
Its a dying codec, usually with only average bitrates, which work just fine in software, or with QuickSync. There is no use. I don't get paid for this, so I do what i think is useful to me and the users, and this is not. Its just time spent for nothing.
Also, CyberLinks decoder in PowerDVD uses DXVA Native with the Media SDK.
You can implement dxva native with the Media SDK as well, its not a big deal.
My last post and reply about this issue, is your own answer in my thread EXACTLY 4 months ago .
There is only documentation missing how to do it, but that doesn't mean its not possible. Could also try to reverse engineer from the Media SDK, but thats annoying work.
The Hardware supports it, its only software thats missing.
Even then, you don't need to manually implement it, you can use the Media SDK and use it as a native DXVA decoder. Someone just needs to do it.
I believe some of the commercial decoders implement it (most likely using the MSDK in exactly this way), Cyberlink or ArcSoft, i forgot which one, maybe both? Its a Blu-ray format, so they usually try to support it on new hardware.
Apparently you have to decide if it's a big deal or not.
dukey
11th December 2013, 17:03
VC1 is used a fair bit for bluray, maybe not necessarily for main titles, for for all the intros etc
nevcairiel
11th December 2013, 22:31
I decided to spend another hour or so on the topic, and i actually found one reason for failure, and fixed it. The white flashing observed in some videos is now gone and it plays properly. However, I'm still seeing crashes with other files, so we'll see if i can get it stable enough.
NikosD
11th December 2013, 22:58
That's good news.
I get more artifacts than white flashes.
You can try also WMV3 clips besides VC-1.
nevcairiel
11th December 2013, 23:14
If these artifacts are white or at least very bright, then it was probably the same issue.
Anyhow, maybe i can also figure out the crash issue, then it would be good to enable again.
NikosD
11th December 2013, 23:17
Right.
The artifacts are indeed like white squares.
NikosD
12th December 2013, 10:24
Anyhow, maybe i can also figure out the crash issue, then it would be good to enable again.
Can you upload the new version in order to test it ?
nevcairiel
12th December 2013, 12:26
Here is a test build:
http://files.1f0.de/lavf/LAVFilters-0.59.1-58-gea5125d.zip
I still have one sample that shows a bit of corruption, will need to look at it closer.
Kay Diefenthal
12th December 2013, 12:40
I hope that you dont want remove rtp rtsp protocol Support from LAV Directshow
this is required for 2 of my Projects
ArgusTV MediaCenter Client and SatIp Rtsp Sample
NikosD
12th December 2013, 17:05
Here is a test build:
http://files.1f0.de/lavf/LAVFilters-0.59.1-58-gea5125d.zip
I still have one sample that shows a bit of corruption, will need to look at it closer.
After a lot of tests I can say that your test build is crash proof.
I only managed to crash it with one clip - a VC-1 interlaced clip called MC.ts (with Beyoncé).
Do you have it or you want me to upload it ?
I think I got the link from this thread.
With the difficult VC-1 1080p60fps clip from here ftp://helpedia.com/pub/multimedia/x264/testvideos/2010%20-%2009%20-%20DXVA%20benchmarks%20-%20Avivo%20vs%20PureVideo%20vs%20Clear%20Video/Devil_May_Cry_Gameplay.wmv
I have a frozen image at the beginning of the clip.
But that behavior with that clip I have it also with LAV Video and Nvidia VP4/VP5 and other hardware.
I think you should take a look of that freeze in general.
I got many artifacts with various WMV HD clips like the ones from this page:
http://homepage.ntlworld.com/shaun.zoe/projects/hdtv.htm
Try for example:
Speed_1080, http://download.microsoft.com/download/f/d/5/fd5bdd21-f1ac-426a-adf1-d3d105b448d3/Speed_1080.exe
To the Limit 1080p, http://download.microsoft.com/download/6/1/c/61ca6316-a44f-46ef-9e8c-074c3dd813c0/To_The_Limit_1080.exe
They are not executables, just self-archived.
The decoding speed is amazing (about 50% faster than WMVideo MFT) and it's the only decoder that works with DXVA VC-1 interlaced.
nevcairiel
12th December 2013, 19:22
Here is another one:
http://files.1f0.de/lavf/LAVFilters-0.59.1-59-g0e20811.zip
I fixed the crash in MC.ts, and i think 2 other causes of video corruption. The samples I have seem to play pretty much perfect now.
The fozen image as you call it is still there, but thats independent of the DXVA decoder here, it happens with others for me as well.
NikosD
12th December 2013, 19:58
OK.
Now the decoder is "uncrashable" and MC.ts plays perfect.
I have only one file "halo2_WMV9" clip with heavy video corruption.
All the others VC-1/WMV3 clips have no artifacts.
But, all of the clips that previously had artifacts and now they don't, they are very slow starters - I mean you have to wait even 4 seconds to start playing clip.
You can hear the audio but the picture is just a still image.
Also those clips when you seek the file, have the same above behavior.
You have to wait 1 to 2 seconds in order to see the image changing while the audio is decoded in real-time.
If you fix that you are close to perfection.
nevcairiel
12th December 2013, 20:04
The new delay was a bug, I fixed it already. Can you share the clip with corruption?
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.