RPi 4 - 9.2.1 - Live TV Playback (interlacing and aliasing issues)

  • Hi all,

    I just setup my new RPi4 with the latest LibreELEC and it works great but my main use case is for Live TV to replace an old DVB-C cable box.

    Got Tvheadend setup and working just fine however when playing the streams the interlacing and aliasing is pretty bad :(

    I've tried all the settings but no real improvements with disabling MMAL HW acceleration, change the playback interlacing (bob, mmal half/full) etc.

    Can anyone suggest anything else to try as its so close to being a perfect solution just the video quality is bad.

    Thanks in advance for any help.

  • Hello!

    I don't have a rpi4

    But settings should be the same as on x86...

    Set Resolution Change on start/Stop

    Make a Whitelist for Display Resolution and refreshrates to use.

    Use a refreshrate which ist equal to the TV Signal (50/60Hz)

    Try different deinterlacer and scaler settings.

    Deactivate sync to Display.


    Search the forum...

    If I remember Well there was at least one thread with settings for Rpi4.

    Regards

    Nicolas

  • Hello kreeture!

    I saw something but not in a thread starting with asking for settings...

    If I will find it again I am Posting a Link Here.

    Regards

    Nicolas

  • Thanks Nicolas, tried all the settings and it definitely improved but still the 720x576 mpeg2 live tv video quality isn't great :(

    Hopefully this will be improved in the future.

  • For the Rpi4 ist there still the Option to buy a mpeg2 hardware Decoder license?

    For Live TV I am using this settings.

    1080p 50Hz (Germany)

    Deinterlacing: vaapi Motion compensation

    Scaler: Lanczos3

    Use HQ Scaler above 30%

    Sync to Display off

    For Intel Hardware with HD 500 or above those settings work. Plus Intel stutter fix.

    Maybe bei you can select Something equal?

    Regards

    Nicolas

  • chewitt I think i saw you are streaming tv from finland, thats where I’m based so would love to know your kodi and tvheadend setup.

    I’m running everything on a pi 4 and just updated to latest libreelec 9.2.3 but still suffer from slight juddering on the tv stream.

    I run kodi at 1080p 50hz and keep that resolution as the tv stream is 576p, I’ve tried so many settings on kodi but still get slight judder when using the full MMAL or BOB deinterlacing. Using half results in bad aliasing :(


    I found using hw decoding and 1080p 50hz, full mmal deinterlacing gives ok results but still a slight judder for the live tv stream from tvheadend server DVB-C usb tuner.

    My tv is a 55” 4k sony. Which looks fine with my old dvb-c digibox at 1080i.


    cheers for the help.

    • Official Post

    I have Kodi set to 1080@60 desktop with 1080p 23.976/24/50/59.94/60 and 4K 23.976/24/25/29.97/30 modes whitelisted, adjust refresh enabled, and everything else video related on defaults (so deinterlace is auto) and audio on a 5.1 pcm config. Kodi outputs progressive always, so if you are working with deinterlaced content it's important to exclude the 25Hz mode as Kodi needs 50Hz to render 25x2 interlaced frames.

    NB: I don't really know how TVH is configured because someone else (one of the Kodi developers, who is Finnish) runs that bit. He aggregates DVB-S and DVB-T connections. I only use it for DVB testing in LE and watching the occasional F1 race but AFAIK the TVH bit is left more or less default. I see some artefacts and judders in the streams from time to time, but my client device(s) are 4,500Km from the server and I route everthing thruogh a VPN to the UK so I have fairly low expectations on performance.

  • I noticed that there was judder in sports scenes.

    Forcing adjust display refresh rate on start/ stop and "sync playback to display" to off kills all judder effects.

    I watch 25 / 50 tv transmissions at 1080i and 1080p.

    I've setup kodi more or less as chewitt mentioned above.

    I use tvheadend "pass" profile, or one ffmpeg profile that transcodes to 512kbps with libx264 .

  • Thanks guys,

    Interestingly there is no 25hz option for 1080 and I tried just whitelisting 1080 at 50 but I still get the judder as the TV is switching to 1080p.

    Is there anyway to force Kodi to use 1080i instead, maybe this would solve my issue?

    • Official Post

    Kodi only outputs progressive. In other words, 1080i does not exist, only 1080p. Kodi needs to render each interlaced half-frame as one real frame, so needs to use 1080p50 to render 1080i content. Do not whitelist 1080p25, do enable 1080p50 (and adjust refresh). Do not "sync playback to display" as that will force everything to be resampled and ARM devices are rubbish at that.

  • ... Do not "sync playback to display" ....

    Exactly.


    Thanks guys,

    Interestingly there is no 25hz option for 1080 and I tried just whitelisting 1080 at 50 but I still get the judder as the TV is switching to 1080p.

    Is there anyway to force Kodi to use 1080i instead, maybe this would solve my issue?

    Just whitelist 1920x1080@ 50, disable sync playback to display, and enable "Adjust display refresh rate" "on start/stop".

    That would be all you need.

    I use a usb dvb-c receiver and there are no issues .

    ---

    You should also look into your tvheadend configuration:

    Aren't you using any stream processing that may be changing the framerate ?

    Try to force "pass" profile as default.

    The attached images are my "Pass" and "htsp" profiles current configurations:

    (tweaked a little bit to get best results with handling some video artefacts in reception)

    [configuration / stream / streamprofiles]

    I also use:

    "General / base / packet backlog" : active

  • Thanks again, but still same issue :(

    I set all the settings you suggest in both kodi and tvheadend.


    The judder goes away when disabling the deinterlace method but with it off the quality sucks.


    Also after checking the tvheadend settings i noticed that although the default stream is pass kodi still switches to htsp. In fact with htsp disabled the stream wont even play.

  • My experience is exactly the same, my RPI3 B+ Works perfectly with 2 dual tuner USB Dvb-c (Hauppauge). Some update mixed up my setup completely, so that I decided to gain Rpi4 due USB 3 ports and more processing power to cut commercials.

    Long story short, Rpi4 didn't work too well with live TV, stream was pixelized and buffering hit in constantly. I tried many ways of settings, without any luck.

    Finally got fed up with struggling and re-installed libreelec to RPI3 which works perfectly.

    I use Tvheadend as frontend as well as backend to transcode.

  • Also after checking the tvheadend settings i noticed that although the default stream is pass kodi still switches to htsp. In fact with htsp disabled the stream wont even play.

    HTSP uses Pass for streaming..it just adds tvheadend info to the connection for PVR to show additional info...signal etc

    Just leave tvheadend htsp as default and focus to troubleshoot on the frontend..to be sure try to stream from another PC or phone..but it's probably something with RPi4..out of curiosity..do you get the same issues with recordings?

    Quote

    My experience is exactly the same, my RPI3 B+ Works perfectly with 2 dual tuner USB Dvb-c (Hauppauge). Some update mixed up my setup completely, so that I decided to gain Rpi4 due USB 3 ports and more processing power to cut commercials.

    Long story short, Rpi4 didn't work too well with live TV, stream was pixelized and buffering hit in constantly. I tried many ways of settings, without any luck.

    Finally got fed up with struggling and re-installed libreelec to RPI3 which works perfectly.

    I use Tvheadend as frontend as well as backend to transcode.

    At this point in time I would use the Rpi4 as TvHeadend Server and use the Rpi2/3 for streaming..

    Edited once, last by Mario77 (August 11, 2020 at 12:33 PM).