Disable Hardware Decoding for MPEG2?
#1
Hi,

Is it possible to disable Hardware decoding for MPEG2 video in a .mkv container?

Reason being, I have a Radeon HD6450, and for some reason, the hardware deinterlacing isn't working correctly.  In catalyst control center, the deinterlacing visibly/noticeably changes if I set if from "weave" to "bob", but moving the control anywhere further to "motion adaptive" or "vector adaptive" doesn't improve things, those supposedly-better settings look exactly the same as "bob", which leaves a lot of "stair-step" artifacting which doesn't look great.

When I disable DXVA rendering and DXVA2 acceleration, then Kodi lets me select the software deinterlacer (skin OSD reports YADIF is being used), and it looks *much* better, pretty much all of that ugly artifacting is gone.

But with DXVA/DXVA2 disabled, of course now all of my H264 and VC1 content play back with software decoders and I would like to leave those on the hardware decoder.

When DXVA/DXVA2 are enabled as normal, then when playing back MPEG2 content I am not able to select the software deinterlacer, my only choices are "DXVA" or "OFF".

Many thanks
TRJB
Reply
#2
Ask AMD to fix D3D11 drivers for your hardware in a part of deinterlacing.
Reply
#3
With all due respect, that is not a particularly helpful comment.  First of all, as I noted the 6450 card is legacy, so AMD is not going to fix or further develop any drivers for it.  Second, even if it was current, one unknown person asking a big corporation like AMD them to fix drivers isn't going to garner their attention.

As I noted, the workaround that is perfectly acceptable is for Kodi's software decoders to handle MPEG2 content.

So... back to the original question... Is there a way to force software decoding for MPEG2 and leave DXVA for all other content?

Thanks
TRJB
Reply
#4
The problem not in decoder, problem in dxva renderer which does deinterlacing in case of hw decoding. Disabling MPEG decoder gives you nothing. You will have the same issue with any interlaced material decoded by hw i.e. by dxva.
Reply
#5
Ok, well, possibly I've got the terminology incorrect.

If you go back and read my original post, I said that when I disable both DXVA and DXVA2 in the video settings (I guess that means disable DXVA renderer and DXVA decoder), then the OSD shows that Yadif is being used to deinterlace, and the picture looks perfect.  When those are on, the picture looks jagged because the hardware is doing the deinterlacing.

I would like the ability to have whatever settings are necessary for the software deinterlacer to work for MPEG2 content.  As I noted in my original post, whtn DXVA/DXVA2 are both enabled, then Yadif is not used.

Is that possible?
Reply
#6
I dont think its possible.  Hardware acceleration is an on/off feature.

The only suggestion I can offier is to look at the external players feature. 
https://kodi.wiki/view/External_players

Keep hardware acceleration on, but use an external player, setup as you need for playing MKV/MPEG2 content

In the longer term you probably need a new graphics card/upgraded PC
Reply
#7
(2018-02-21, 02:13)therealjoeblow Wrote: Is that possible?

Did you read that I wrote? You are mixed two things: DXVA decoding and DXVA rendering. Decoding in any case doesn't do deinterlacing, nor dxva nor software decoder, they just decode video streams. DXVA rendering can do deinterlacing for both hardware (DXVA) and sofware decoding. DXVA rendering is broken in your AMD drivers (why I'm not surprised?).

In case of DXVA decoding, proper deinterlacing can be performed by DXVA renderer only. Yadif it's just a filter that is applied when software decoder is used only. it's not possible to use it when DXVA decoder is used because all video data placed in GPU memory and yadif filter has no access to GPU memory. Copying from GPU to deinterlace then copying back for rendering is very inefficient.

If you disable (somehow) hw decoding of MPEG it gives you possibility to use yadif for MPEG but this not cure deinterlacing in case of hardware decoding interlaced material coded in h264/vc1.
Reply
#8
OK, so all that said, I've determined that the vector-adaptive deinterlacing appears to be broken only in Kodi.

Using MPC-HC with the MPC Video Decoder, and running the Slices MPEG2 NTSC 1080i 29.97.ts video, the decoder reports it is using the AMD Radeon device in DXVA mode, and I get perfect/smooth vector adaptive deinterlacing... looks virtually progressive.  And I also get a perfect 1:1 relationship with the deinterlacing slider control in Catalyst Control Center.  That is, if I stop playback, move the slider from V/A to any of the other lower settings, and restart playback, then I see the quality of the deinterlacing get worse each time until I get to Bob where it looks like it does all the time in Kodi (stair-steps).  And then moving the slider back to Adaptive, Motion Adaptive and finally Vector Adaptive makes the deinterlacing look better and better until at V/A it looks as good as progressive.

I tried that with a bunch of other NTSC and PAL interlaced MPEG2 content too with exact same repeatable visual results.  For sure V/A deinterlacing is working with the MPC Video Decoder but not with whatever method Kodi is using.

So then I guess I don't need to disable MPEG2 hardware decoding in Kodi, but request that whatever it is doing to break DXVA deinterlacing be fixed please.

Many thanks
TRJB
Reply
#9
(2018-02-22, 07:25)therealjoeblow Wrote: So then I guess I don't need to disable MPEG2 hardware decoding in Kodi, but request that whatever it is doing to break DXVA deinterlacing be fixed please.

As I said early it can be fixed by AMD only. AMD decided don't to waste time to implement proper support of D3D11 API in their drivers for legacy cards. MPC-HC uses D3D9 API and this is absolutely different API than Kodi uses.
Reply
#10
Ok, well, in that case, I guess I'm back to my original request... Can an option please be added to Kodi via advancedsettings.xml to disable both DXVA rendering and DXVA2 decoding on a per-format basis, so that I can have DXVA for H264 and VC1, but software for MPEG2?  MPEG2 decoding and deinterlacing by software is not hard for modern CPU's and I would think this would be a reasonable request and solution?

Many thanks
TRJB
Reply
#11
What I believe afedchin is trying to point out is that all interlaced content will have the same problem, so it's not a MPEG2 only problem, although perhaps that does not matter to you if you've got no interlaced H.264 or VC1 content.
Reply
#12
In the end a reasonable solution is to either
A) Get an updated graphics card that doesn't have broken drivers
B) Disable hardware acceleration
C) Look at external players that I suggested

In the end if you graphics card says 'I can do this' then Kodi expects that feature to be available.  Unfortunatly in this case its broken, and I wouldn't expect developers to code for such an edge case (although devs feel free to correct me)
Reply
#13
@jjd-uk Yes, that is exactly my case, and I would hazard a guess "fairly" normal for a lot of users - library consists largely of a combination of older DVD's stored in .mkv containers (so interlaced MPEG2 content), along with newer progressive H264 reencodes of blurays.  I have no interlaced H264 or VC1.  Obviously some people would, but I think what I described would represent a fairly standard library.  And since MPEG2 is easy to decode in software but H264 is not, that's why I was hoping for a workaround as described.

@jools5000 I would buy (yet another) video card, but really, there are very few fanless, single slot, low profile options available.  The variants of the Radeon HD6450 are one of the few that are readily available.  I bought that card fairly recently to (hopefully) resolve problems with an even older onboard HD3200 GPU.  If someone could suggest a good alternative (again, fanless, low profile, single slot, readily available to purchase), I would look at that, but I'm not sure what works and what doesn't given recent experience.  Obviously manufacturers putting DX11 on the box is meaningless and frustrating to the consumer.

Looks like it is what it is.  Thanks to all for enlightening information.

Cheers
TRJB
Reply
#14
By the way, @afedchin , I just coincidentally stumbled across and read through a bit more than 1/2 of the 56 page of the DX11 testing thread:

https://forum.kodi.tv/showthread.php?tid=218274

It might have been a shorter discussion here if you had pointed me there to read that first :-)

Thanks for all of your efforts!
TRJB
Reply

Logout Mark Read Team Forum Stats Members Help
Disable Hardware Decoding for MPEG2?0