HW deinterlacing

    • Official Post

    DEPRECATED: Patches were merged into main LE repo


    Someone here who would like to test HW deinterlacing and report back findings?

    H3 update: LibreELEC-H3.arm-9.80-devel-20201122150642-4bd5978.tar

    H6 update: LibreELEC-H6.arm-9.80-devel-20201122150517-4bd5978.tar

    source: Commits · jernejsk/LibreELEC.tv · GitHub


    Known issue:

    If display refresh rate is lower than double of video fps, audio and video will go out of sync. Bigger the difference, bigger sync issue.


    Workaround 1:

    Make sure that display refresh rate is higher than double of video fps. Easiest way to do that, is to set [email protected] display mode which most monitors and TVs should support nowadays.


    Workaround 2:

    If previous workaround isn't possible, change DRMPRIME render method to EGL. It will be less efficient but it will still avoid the problem.

  • Trying, just taking out my x2, will report back once i tried it.


    Edit: first impression is good, seems to run stable, not yet sure I already watched interlaced content. Maybe it adds a bit to motion blur?


    Edit 2: Didn't find any real problems, it easily has nightly quality.

    The only point I feel that might be slightly affected is some less smooth movements, but I can't really tell. If there is something it's very subtle.

    Edited 2 times, last by lumpi ().

  • Hello Jernej,


    Thank you very mutch for the update!

    With old LE version from 20191215 and your update there is only a red plane.

    Then I loaded the nightly LE from 20200613 and updated it. This doesn't deinterlace. Must I switch deinterlacing anywhere on?

    I tested with ts 1080i_h264 and 576i_mpeg2 from german TV. If you want this files I can send a link.

  • First impression:


    Looks great. Locks perfect. (I'm watching 20 min now)


    Board: MXQ 4K H3


    What I did:


    Flashed my SD Card with "LibreELEC-H3.arm-9.80-nightly-20200617-eb556b1-libretech-h3.img.gz"


    But the update with LibreELEC-H3.arm-9.80-devel-20200613185701-ebc62d6-deint.tar crashed the system.


    So I flashed the SD card again and made minimum configs in LE.


    Via ssh: LibreELEC:~ # mount -o remount,rw /flash/


    Then I copied the files KERNEL and SYSTEM from the "LibreELEC-H3.arm-9.80-devel-20200613185701-ebc62d6-deint.tar" unziped "target" folder to the flash folder in LE.


    LibreELEC:~ # sync && reboot


    All is doing well.


    Btw. reboot doesn't work, I have always to plug the power adapter AND the sd card.

    • Official Post

    I just moved talk about deinterlacing into new thread so the posts don't get lost in huge topic. Anyway, I made a few more improvements and I'll upload new test images soon and I'll update OP with links to them including with a list of known issues and workarounds.

  • With interlaced videos? Here the hw deinterlacer doesn't work.

    Sky Sport Bundesliga HD (Germany, 1920x1080i Astra 19,2e, encrypted)

    This channel sends only interlaced material.


    After jernej's update perfect picture.


    Can send a sample, but only as test, bc. highly copyrighted.

    • Official Post

    I updated images in OP. Now deinterlacing works pretty well for me, apart from the small issue mentioned in OP.


    Changelog:

    - proper cleanup of resources

    - it's possible to turn off and on deinterlacing in video settings on the fly

    - detection for HW deinterlacing (H3 and H6 have it, so this doesn't change anything for these two SoCs)

    - crash fixes in some corner cases


    Please report any issue. It's also possible that issue is in decoder (turn off deinterlacing and see if issue is still there). Anyway, I accept both type of issue reports but then please also provide video sample which triggers the issue.


    Note that Kodi is updated and also uses new addon location. You may need to start from fresh state if addons won't work.

  • I updated but found not a single working add on to play any video, trying with some video from sd card

  • found an m2t mpeg transport stream with h.264 video, and unfortunately audio and video are out of sync by a couple of seconds also every now and then some hiccups (fraction of a second stops).


    Not sure if it's a deinterlacer issue.


    Do you know how to get info on the used vodeo codecs and settings? Just can't seem to find that button on the remote...


    Edit:

    Just switched deinterlacing off and glitches are still there, also the loss of sync is there but seems bit less...


    Trying a different container soon


    P.S. is it normal I can only post again after 30 minutes? It's sometimes quite annoying and doesn't help the communication flow.

  • Oh ok got a new TV my 8years old Samsung was better for such tests.

    Maybe it's possible to limit resolution to 1080p?


    Tried changing resolution to 1080p/60 and it seems better now.


    How come this happens? That's a new thing right?


    Video looks good now, now just have to find out if its interlaced content...

    Edited once, last by lumpi ().

    • Official Post

    You can change resolution and refresh rate in display settings :) You can even set refresh rate to be selected automatically depending on video size and fps, but this option is in video player settings. To be honest, 4k resolution is actually useful only for 4k videos. You'll get better (more fluent) playback with lower resolutions which allow higher refresh rates. Anyway, H6 has potential to surpass this but HDMI driver is not there yet.

  • Sorry meant to say to limit it generally on H3 as a default setting.

    I guess the mali400 is not really up to the task with 4k GUI

    • Official Post

    UI is already limited to 1080p (hidden setting, introduced exactly for weaker GPUs), but display can still be at 4K (DRM plane scaling is used). Actual problem here is that decoding and then deinterlacing process produces more frames than renderer is able to display (one frame per vblank - vsync). Naturally, they should be dropped. But this feature is not yet implemented for DRMPRIME direct to plane render method. Same issue you get with progressive, 60 fps video. But as I said, why drop frames if you can enjoy smooth playback with slightly lower resolution which in most cases is same or bigger than video native size.