[RPi4][9.1.501] Getting proper performances on > 1080p videos

  • Hello folks,

    Context

    I recently bought a RPi4 4Gb (using a starter kit with the official RP power supply, HDMI<->miniHDMI cable - plug into the closest port to the USB-C power plug -, and a very basic case), in the hope that I could get to watch my local backup of "Star Wars SC38 reimagined" in the best quality on my TV. As the 2160p version simply didn't run (black screen) on the RPi 3b, I thought it would be a good test case for the new setup. So I've downloaded the video in 3 different versions : 720p, 1080p, and 2160p. I also have the Star Wars Saga Trailer 3 in both 1080p and 1440p.


    I'm using a 2012 Philips 46PFL5507K LED "Full HD" 1080p TV. The files are stored on my Synology DS215j+ NAS, connected through Gigabit Ethernet on an ASUS 4G-AC55U LTE Modem. The display is set to 1920 x 1080. I've added "hdmi_enable_4kp60=1" to "config.txt" (though I'm not sure I should have, as I'm not running the interface in 4k ?)


    As far as Kodi Player settings go, I've set :

    • Adjust display refresh rate : Always
    • Sync playback to display : On
    • Enable HQ scalers for scaling above : 20%
    • Allow hardware acceleration MMAL : On
    • /storage/.kodi/userdata/advancedsettings.xml (which has not been updated since I've switched to RPi4)
      <advancedsettings><cache><buffermode>1</buffermode><memorysize>139460608</memorysize><readfactor>20</readfactor></cache><network><curlclienttimeout>10</curlclienttimeout></network></advancedsettings>

    Test

    On the RPi4, all the videos start. Which is already, well, a start ! :) But the performance is as follow :

    • Star Wars SC38 reimagined
      • 720p : MEM 3471968 / 3750264 KB, FPS 15.6, CPU #0 5.9%, #1 9.8%, #2 0.0%, #3 6.0% (CPU-KODI 14.99%). Runs "okay" to my taste, but I hope it could be more fluid.
      • 1080p : MEM 3456540 / 3750264 KB, FPS 14.8, CPU #0 8.2%, #1 7.8%, #2 9.8%, #3 5.9% (CPU-KODI 20.54%) Runs "okay" to my taste, but I hope it could be more fluid.
      • 2160p : MEM 3370388 / 3750264 KB, FPS 22.4, CPU #0 100%, #1 8.0%, #2 0.0%, #3 2.0% (CPU-KODI 106.59%). Audio seems to be playing at the proper "speed" (and is fluid), but the image is like 10 times slower than it should be and completely jerky ; it's unwatchable. After playing if for a minute or two, I start getting the "things are too hot" warning icon on the upper right corner.
    • Star Wars Saga Trailer 3
      • 1080p : MEM 3450360 / 3750264 KB, FPS 12.7, CPU #0 2.0%, #1 4.0%, #2 5.9%, #3 4.1% (CPU-KODI 15.98%). Runs "okay" to my taste, but I hope it could be more fluid.
      • 1440p : MEM 3380320 / 3750264 KB, FPS 24.4, CPU #0 0.0%, #1 6.1%, #2 18%, #3 98% (CPU-KODI 123.37%). Audio seems to be playing at the proper "speed" (and is fluid), but the image is just a little slower than it should be (we can perceive it's off after about 1 minute of video - when Anakin says "I'm sorry" multiple times it's obvious) and it's shaky.

    I've tried both 30.00 and 60.00 as the refresh rate with similar results.

    Question

    Is there anything in this scenario that seems off to you ? Some settings that I could optimize ? Or is it expected results with the current state of the LibreELEC software stack on RPi4 or with my setup ? And... is my TV getting too old ? (I'm not sure if it plays a role in the playback ? With upscaling for example ?)


    I've just received a fan for the case, I'll try to set it up and see if it improves anything.


    Thanks for your help ! Let me know if you need any more information/logs to understand/improve this.
    gnutix

    Edited 2 times, last by gnutix ().

  • chewitt

    Approved the thread.
  • Could you state what codecs your files are?


    RPi4 has hardware decoding up to 1080p with h264 codec and up to 2160p with HEVC.

  • Here's the output of "mediainfo --fullscan *" on my Star Wars files : Running `mediainfo --fullscan *` on my Star Wars test files · GitHub


    So apparently (if I understood well) :

    Star Wars Scene 38 Reimagined 720p.mp4 : h264

    Star Wars Scene 38 Reimagined 1080p.mp4 : h264

    Star Wars Scene 38 Reimagined 4k.mkv : VP9

    Star Wars SAGA TRAILER #3 1080p.mp4 : h264

    Star Wars SAGA TRAILER #3 1440p.webm : VP9


    Seems like I'm hitting a known issue then (VP9 support) ? RPi LibreELEC fails to play VP9 codec in mkv file

    Do you know of any way to convert the files in a format supported ?

    Edited 3 times, last by gnutix ().

  • So I tried two different ffmpeg commands this night, and none produce a proper result (the first had an awful quality, the second had weird colors). Trying a third one now.


    Edit: ran all day, no proper result... Guess I'll just have to use the 1080p for now.

    Any other optimizations you might recommend looking at my setup ?

    Edited once, last by gnutix ().