Kodi Community Forum

Full Version: Hardware Deinterlacer is not frame adaptive in Kodi, but it is in MPC-BE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi guys,
I played a testfile that is MBAFF, so I can test the implementation of the hardware deinterlacer in Kodi. It is sadly not frame adaptive.
I use MPC-BE as media player beside Kodi and if I play the testfile with MPC-BE the hardware deinterlacer is frame adaptive.

Please note, that all AMD cards since RX 5000 series contains a bug in hardware deinterlacer (I do not know if it is located in hardware of "only" in driver but AMD refuses to fix anything).
So you need a Nvidia card or an older AMD card like RX 400 series or a iGPU like Ryzen 5600G or Ryzen 5700G. I tested the mentioned and these work as expected.

Here is the short sample:
https://drive.google.com/file/d/1Zs2T4-N...share_link

How to check if the deinterlacer is frame adaptive?
The Hardware Deinterlacer should be aware that the characters above "WWW.D88.COM" are progressive and should not be deinterlaced, otherwise you will see flickering like in this picture
Here you can see the characters of the logo in more detail
It is also working in mpv with this conf:
Code:
hwdec=yes
hwdec-codecs=all
vf=d3d11vpp=deint=yes:interlaced-only=yes


After I started this thread, AMD releases theri RX 7000 cards, which work fine again, so only all RX 5000 and RX 6000 cards are affected. Intel iGPUs should work, as Intel does such things normally correctly, but I can not test, since I do not have one.
it's been a while, but I seem to remember that MBAFF is a feature of AVC encoding. Once decoded the deinterlacer has no idea if the video was coded with MBAFF and I don't see why it would act differently.
However it's possible that we're disabling HW decode for those files, and depending on your settings, rendering may swicth to pixel shaders, instead of the dxva renderer that uses the frame adaptative deint when available.
I'll take a look, in the mean time try forcing the dxva renderer instead of Auto.
(2022-11-22, 15:51)Klaus1189 Wrote: [ -> ]Hi guys,
I played a testfile that is MBAFF, so I can test the implementation of the hardware deinterlacer in Kodi. It is sadly not frame adaptive.
I use MPC-BE as media player beside Kodi and if I play the testfile with MPC-BE the hardware deinterlacer is frame adaptive.

Please note, that all AMD cards since RX 5000 series contains a bug in hardware deinterlacer (I do not know if it is located in hardware of "only" in driver but AMD refuses to fix anything).
So you need a Nvidia card or an older AMD card like RX 400 series or a iGPU like Ryzen 5600G or Ryzen 5700G. I tested the mentioned and these work as expected.

Here is the short sample:
https://drive.google.com/file/d/1Zs2T4-N...share_link

How to check if the deinterlacer is frame adaptive?
The Hardware Deinterlacer should be aware that the characters above "WWW.D88.COM" are progressive and should not be deinterlaced, otherwise you will see flickering like in this picture
Here you can see the characters of the logo in more detail
For whatever reason I am unable to even start playback of your sample file. MPC-BE plays it back just fine.
Is the extension the problem? Because I accessed it from Kodi's File Manager and explicitly selected "play using" VideoPlayer... but still nothing happened.
the file contains errors, kodi cannot be expected to overcome bad files

https://paste.kodi.tv/opifenanis
These errors do not relate to my issue with deinterlacer. In Kodi 20.2 the file plays for me, but without frame adaptive deinterlacer despite Deinterlacer is set to DXVA in video options.

It is really hard to get a MBAFF samplefile which allows you to test the deinterlacer fast and easy. This one is perfect to test adaptive deinterlacer. But if you have a better one, one in TS format, since DVB recordings are often MBAFF, please upload anywhere, post link and I test. Not remuxed or anything else, only direct TS recording. But I need to to tell if the deinterlacer is adaptive, so progressive parts are untouched. A simple dumb deinterlacer will work but on progressive parts it will flicker.
i just see "a" problem being had when the file has errors

makes me ask the question "does it work properly with a file that does not have errors"
(2023-07-05, 20:28)jepsizofye Wrote: [ -> ]makes me ask the question "does it work properly with a file that does not have errors"

As already stated, I need a better sample I suspect a broken GOP at beginning, so an I frame is missing at the beginning. Recordings from SAT devices in ts container are always a bit strange and not perfect, but they still play.

Other than that I only have full interlaced content, but for these file every dumb deinterlacer passes. But I want a sample/testfile so I can test the adaptive-ness of the deinterlacer. Not easy to get one, since you need to be able to fully be able to say, yes, it is not working or else.

Nevertheless I was able to detect with this file that AMD broke the hardware deinterlacer in their RX 5000 and RX6000 cards back in the time. But RX 7000 cards are fine again. Nvidia is also fine.
(2022-11-22, 15:51)Klaus1189 Wrote: [ -> ]Here is the short sample:
https://drive.google.com/file/d/1Zs2T4-N...share_link

This sample works fine (no flickering) on Intel NUC8i3BEK using DXVA2 video decoding + DXVA render/deinterlacer (current master branch).  Not known in Nvidia or AMD.

If fail is AMD or Nvidia specific and only DXVA maybe is not Kodi "bug" but video drivers bug.
(2023-07-06, 15:15)jogal Wrote: [ -> ]If fail is AMD or Nvidia specific and only DXVA maybe is not Kodi "bug" but video drivers bug.

Please read the thread title again Tongue
AND I already found out that only RX 5000 and RX 6000 have bad hardware deinterlacer, all other generations are fine.
This ts file causes Kodi not to have adaptive deinterlacer, but it works with mpv, MPC-BE, ...

But i tested again and muxed the file into a mkv which "enables" adaptive deinterlacing in Kodi ... This is very strange. It seems like it is dependent on the container of the file in Kodi.
(2023-07-06, 16:55)Klaus1189 Wrote: [ -> ]
(2023-07-06, 15:15)jogal Wrote: [ -> ]If fail is AMD or Nvidia specific and only DXVA maybe is not Kodi "bug" but video drivers bug.

Please read the thread title again Tongue
AND I already found out that only RX 5000 and RX 6000 have bad hardware deinterlacer, all other generations are fine.
This ts file causes Kodi not to have adaptive deinterlacer, but it works with mpv, MPC-BE, ...

But i tested again and muxed the file into a mkv which "enables" adaptive deinterlacing in Kodi ... This is very strange. It seems like it is dependent on the container of the file in Kodi.

can you upload this new test file, the one that you remuxed, please
There is something slightly strange in the way the past and future pictures are setup before blitting.
Can you please provide a debug log of the system with the issue playing both samples.
(2023-07-07, 09:37)CrystalP Wrote: [ -> ]There is something slightly strange in the way the past and future pictures are setup before blitting.
Can you please provide a debug log of the system with the issue playing both samples.

https://drive.google.com/file/d/1FxLv63w...sp=sharing

I recognzied that if automatic refresh rate change is disabled the deinterlacer is broken for both files. This made me thinking about this issue a bit more and I recognized that while playing the ts file Kodi simply starts playback without changing the refresh rate, then playing for some seconds and then it finds the correct refresh refresh rate, switches to it and deinterlacer is finally adaptive. Very strange behavior. For MKV file Kodi has no problem at all, it find the correct refresh rate before playback starts.
My TV does not show OSD info like old Samsung TVs did when the refresh rate changed. It only shows OSD info for HDR or HLG HDR stuff.
(2023-07-07, 17:38)Klaus1189 Wrote: [ -> ]Kodi simply starts playback without changing the refresh rate, then playing for some seconds and then it finds the correct refresh refresh rate, switches to it and deinterlacer is finally adaptive. Very strange behavior.

This is by design thinking in Live TV fast channel switching (main use case of .ts is Live TV / PVR). 

If the refrsh rate change was instantaneous, it would cause a bad user experience, seeming that the channels are broken / without image when changing channels. If the change occurs later at least you get some image at the moment (even if it is not perfect yet).


Things are not as simple as "this works for me on MPC-BE so Kodi has a bug"....  Smile
Pages: 1 2 3