Kodi Community Forum

Full Version: KODI on RPi2 stutters on playback of some media
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've searched for "stutter" here, but didn't find any answer relevant to my issue.

My setup is the folllowing:
Quote:KODI v15.2
OpenElect 5.0.3
RPi2.arm
Connected via NFS to a Synology server across a wired network

I've been using KODI on my RPi2 for about a year without any problems. Today I tried playing back a video, and it constantly stutters during playback. The CPU and memory usage figures are between 85-100% for both CPU cores, compared with 7-20% when playing back other video files. The video is from a series. I downloaded the series from three different sources and all episodes I've tried from the three series have the same problem, so I think it must be a codec problem. Is it possible that the problem videos are decoded locally on the RPi instead of being decoded on the Synology?

I've used MediaInfo to analyze the good and bad files, but I don't know enough about codecs to understand what the figures mean. I notice that the good file uses AVC inside the MPEG-4 container, while all the bad files I tried use HEVC inside the Matroska container.

Can anyone help?

Good file:

Video
Code:
MPEG-4 (Base Media)
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1 h 0 min
Bit rate                                 : 2 051 kb/s
Maximum bit rate                         : 36.7 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 078 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.041
Stream size                              : 883 MiB (94%)
Writing library                          : x264 core 146 r2538 121396c
Encoding settings                        : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=4 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=2051 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=62500 / vbv_bufsize=78125 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date                             : UTC 2015-06-16 20:06:06
Tagged date                              : UTC 2015-06-16 20:06:13

Bad file:
Code:
Matroska
1 video stream: HEVA
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : [email protected]@Main
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 49 min 55 s
Bit rate                                 : 635 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Original height                          : 718 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.029
Stream size                              : 227 MiB (91%)
Writing library                          : x265 1.8+2-55a4a9b920ff:[Windows][GCC 5.2.0][64 bit] 8bit+10bit+12bit
Encoding settings                        : wpp / ctu=64 / min-cu-size=8 / max-tu-size=32 / tu-intra-depth=1 / tu-inter-depth=1 / me=1 / subme=2 / merange=57 / no-rect / no-amp / max-merge=2 / temporal-mvp / no-early-skip / rdpenalty=0 / no-tskip / no-tskip-fast / strong-intra-smoothing / no-lossless / no-cu-lossless / no-constrained-intra / no-fast-intra / open-gop / no-temporal-layers / interlace=0 / keyint=250 / min-keyint=23 / scenecut=40 / rc-lookahead=20 / lookahead-slices=0 / bframes=4 / bframe-bias=0 / b-adapt=2 / ref=3 / limit-refs=0 / weightp / no-weightb / aq-mode=1 / qg-size=32 / aq-strength=1.00 / cbqpoffs=0 / crqpoffs=0 / rd=3 / psy-rd=0.30 / rdoq-level=0 / psy-rdoq=0.00 / signhide / deblock / sao / no-sao-non-deblock / b-pyramid / cutree / rc=2 / pass / bitrate=634 / qcomp=0.60 / qpmin=0 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ipratio=1.40 / pbratio=1.30
Default                                  : Yes
Forced                                   : No
Pi2 can't really do HEVC
Yes it can. OP needs to update to a more recent version of Kodi (eg. LibreELEC 7).

Edit: To qualify this statement, most 720 HEVC is no problem for a RPi2, though some higher-bitrate 1080 HEVC could be a problem (greater chance of success with 1080p HEVC on RPi3). Since the RPi2 (and RPi3) doesn't support hardware HEVC decoding there is no guarantee it will play all HEVC content, but certainly should play quite a lot (and without stutters).
Many thanks for the explanation.

Is H.265/HEVC so much more cpu-intensive than other codecs? I measured 100% vs 20% cpu usage. Is it because the compression is better that it needs so much more processing to be able to decode it?
Or is it that the other decodings such as H.264 can be done on the NAS?
I see from this that H.265 is supported, it's not clearly specified on which models, though.
https://www.synology.com/en-global/knowl..._my_device
The h264 decoding is done by the GPU (aka hardware decoding) on the RPi which is why the CPU is barely used at all (even the RPi1 and RPi Zero can decode h264 without any issues). h265 (HEVC) on the other hand isn't supported by the GPU so h265 has to be decoded by the CPU (aka software decoding) and until recently this wasn't possible on the RPi2 without stuttering. Since Kodi 16.x there have been optimisations added that enable more efficient h265 software decoding on the RPi2 and RPi3, with yet more optimisations added in Kodi 17.
Great explanation.

Thanks, Paul