[SOLVED] s805 / s905 glitchy hardware decoding of h.264 main10 profile video

  • Hi,

    amlogic cannot hardware decode main10 profile h.264 video streams, but both the S805 and S905 libreelec versions use the hardware to play them, resulting in artefacts and glitchy playback. Currently, there is only an option to either use or not use the "amcodec" decoder as well as options for chosing hardware acceleration for certain mpeg-2 and mp4 files.

    My S905 box played my test files (720p/1080p h.264 main10) fine when I disabled hardware acceleration completely, but I would like to use the hardware where possible.

    This problem does not appear on Libreelec/x64 with intel or nvidia graphics. There, regular h.264 files play using hardware acceleration while h.264 main10 play using software.

    Is there any way to fix this or at least extend the playback options in settings to force software decoding on h.264/main10 video?


    Best regards,

    Magnus

    Edited once, last by kszaq (August 21, 2016 at 2:03 AM).

  • To reproduce issue: Play back any "hi10p" anime encode. Sample files: Hi10P Anime Sample files

    Debug log: v005 playing back a h264 10-bit encoded sample file:


    [hr]
    Image showing visible glitches from one of the sample files. Software decode is glitch-free.


    Edited once, last by mmpp (July 30, 2016 at 9:02 PM).

  • I can confirm the same with the samples from Dropbox - hi10_samples

    Both 720p and 1080p h264 struggle to play and you get artifacts.
    1080p HEVC main10 plays perfectly.

    Software decode has no artifacts, but the above h264 samples lag under software decode.
    Beelink Mini MXIII Rev C

    Edited once, last by JonSnow (July 31, 2016 at 7:33 AM).

  • Hello,

    thanks for the confirmation and the additional samples.

    Your 720p sample played fine without lag or frame drops using software decode on my MXQ Pro 4k (Libreelec version 005 on SD card) , the 1080p was too much for it: full CPU load on all cores and skipped frames.


  • Hello,

    thanks for the confirmation and the additional samples.

    Your 720p sample played fine without lag or frame drops using software decode on my MXQ Pro 4k (Libreelec version 005 on SD card) , the 1080p was too much for it: full CPU load on all cores and skipped frames.

    Can you try again with the performance cpu governor?

    Quote


    echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

  • Same as with "ondemand" (default in 005): "Another" sample at 720p plays fine, at 1080p jerky playback with dropped frames.

    I was only mentioning it as you said you could not play both files on your S905.

  • Yes 720p plays fine with software, if you read the below thread wrxtasy says this will never be fixed with hardware unless the s905 rev C has the fix. The only thing i can see is kszaq optimzing the software and putting in a flag to decode using software.

    Easier solution is just to get HEVC instead.

    ODROID C2 S905 2GB RAM HDMI 2.0 $46

    Edited once, last by JonSnow (August 2, 2016 at 4:11 AM).

  • I am aware that the S905/S805 SoCs cannot hardware decode h.264 "hi10p" videos. All I seek is either an option to software decode them (like the options for mpeg2/mp4 already present for amcodec) or to stop using hardware acceleration for video codecs the hardware is incapable of playing properly, like libreelec/kodi does on x64.

  • I had a look at Wrxtasy's patches and they don't apply to Hi10P videos - you can only choose to not HW decode SD videos. I have made another patch that should prevent from enabling hardware decoder only for Hi10p videos.

  • Thank you for your dedicated work! It is weird that wrxtasy explicitly mentions h10p 720p Anime, but the patch would not include the proper setting. Where did you find it, by the way? I had a look at his github repository, but the version there was not from August.

  • 7.0.2.5 build for S805 and 7.0.2.006 build for S905 now include a patch that disables hardware decoder for Hi10P videos unconditionally. This should allow artifact-free decoding but keep in mind that it may not be possible to decode 1080p Hi10P in software.