Frameskipping in some 4K files

I have some serious frameskipping in some 4K files, which results in a very stuttering playback.

Here’s the mediainfo:

General
Unique ID : 181560397915929821937345350357778885631 (0x889742BDA2CE47849E8585F0739AEBFF)
Complete name :
Format : Matroska
Format version : Version 4 / Version 2
File size : 12.4 GiB
Duration : 52 min 9 s
Overall bit rate : 34.1 Mb/s
Encoded date : UTC 2017-04-11 15:28:30
Writing application : mkvmerge v9.6.0 (‘Slave To Your Mind’) 64bit
Writing library : libebml v1.3.4 + libmatroska v1.4.5
Group : ViSUM

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.1
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 52 min 9 s
Bit rate : 33.7 Mb/s
Width : 3 840 pixels
Height : 2 160 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.169
Stream size : 12.3 GiB (99%)
Writing library : x264 core 148 r2638 7599210
Encoding settings : cabac=1 / ref=5 / deblock=1:-3:-3 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=48 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=24 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=9 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=0 / crf=19.5 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / pb_ratio=1.30 / aq=3:0.70
Default : Yes
Forced : No

Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : A_AC3
Duration : 52 min 9 s
Bit rate mode : Constant
Bit rate : 384 kb/s
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 spf)
Compression mode : Lossy
Stream size : 143 MiB (1%)
Language : English
Default : Yes
Forced : No

Text #1
ID : 3
Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Duration : 43 min 26 s
Bit rate : 46 b/s
Count of elements : 414
Stream size : 14.7 KiB (0%)
Language : English
Default : No
Forced : No

Text #2
ID : 4
Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Duration : 51 min 55 s
Bit rate : 45 b/s
Count of elements : 568
Stream size : 17.5 KiB (0%)
Title : SDH
Language : English
Default : No
Forced : No

Hi,

Full logs, showing the issue would also help.

Also are you playing these files locally or over your network, wired or wireless?

Thanks Tom.

Here’s the log: http://paste.osmc.tv/wobulibifa

The file is played locally from a USB drive.

Hi,

Are you still having the same issue, with may update; which was released today?

Thanks Tom.

Yes, same issue unfortunately.

Here’s another 2160p file. This one doesn’t play at all. It freezes almost instantly.
http://paste.osmc.tv/ajunovubab

Also played from internal USB drive. May update.

Mediainfo:

General
Unique ID : 181170119153994717390550834488127255806 (0x884C18831DFA5CC183A3D7D77D53F4FE)
Complete name :
Format : Matroska
Format version : Version 4 / Version 2
File size : 16.4 GiB
Duration : 1 h 2 min
Overall bit rate : 37.4 Mb/s
Encoded date : UTC 2017-05-08 10:52:43
Writing application : mkvmerge v10.0.0 (‘To Drown In You’) 64bit
Writing library : libebml v1.3.4 + libmatroska v1.4.5
IsTruncated : Yes

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.1
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 1 h 2 min
Bit rate : 36.0 Mb/s
Width : 3 840 pixels
Height : 2 160 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.181
Stream size : 15.8 GiB (96%)
Writing library : x264 core 148 r2744 b97ae06
Encoding settings : cabac=1 / ref=5 / deblock=1:-3:-3 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=48 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=24 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=9 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=0 / crf=19.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=300000 / vbv_bufsize=300000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / pb_ratio=1.30 / aq=3:0.70
Default : Yes
Forced : No

Audio
ID : 2
Format : E-AC-3
Format/Info : Audio Coding 3
Format settings, Endianness : Big
Codec ID : A_EAC3
Duration : 1 h 2 min
Bit rate mode : Constant
Bit rate : 640 kb/s
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 kHz
Frame rate : 187.500 FPS (256 spf)
Compression mode : Lossy
Stream size : 288 MiB (2%)
Language : English
Default : Yes
Forced : No

Text
ID : 3
Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Language : English
Default : No
Forced : No

Seeing as even ffmpeg complains for thumbnail extraction, I’m inclined to say that the file is corrupt or needs remuxing.

19:31:55.851 T:4088394736   DEBUG: ExtractThumb - seeking to pos 1256480ms (total: 3769440ms) in /media/NAS/stutter2.mkv
19:31:55.972 T:4088394736   ERROR: ffmpeg[F3AFF3F0]: [matroska,webm] Read error at pos. 4250644 (0x40dc14)````

I was just about to make another post regarding that file. The file is corrupt, sorry about that.

The stuttering issue with the first file, is real though. The file played flawless on Minix and on my PC.

Hi,

Reduxing may be useful, even just for investigation.

essentially:

ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4

Another user on forum, admittedly this was on the pi; with 3d movies using mkvs. After reduxing he found the issue resolved.

Thanks Tom.

Hi Tom, no dice I’m afraid, but thanks for the suggestion.

There is some progress though: It looks like the problem is caused by the “adjust display refresh rate” option in Kodi. When disabled the file plays almost flawlessly! But note - this is when I run the file with my default Kodi display settings which are 1920x1080 60hz.

If I change the display settings to 1920x1080 24hz and KEEP “adjust display refresh rate” disabled, the stuttering is back. :open_mouth:

What does that tell you?

Hi,

I don’t think lowering the refresh of the kodi interface is going to help.

What did you have “adjust display refresh rate” set to: on start stop or always?

Thanks Tom.

Agree, and it didn’t (as I wrote). :smirk:

I’m just puzzled why 1920x1080 60hz results in a smooth playback when 1920x1080 24hz makes it stutter like crazy. The file is 24fps.

“Adjust display refresh rate” setting was start/stop, but ‘always’ gives the same result.

Hi,

Shot in the dark here, have you tried 1920x1080 50hz and adjust rate set to always.

I know I just said lowering probably wouldn’t help, its just these are the settings I’m using and I’m having no problems with anything I throw at my 4k. Result will probably be no different, but experimenting may get us closer to the cause.

Also what are the rest of your settings #player, videos?

Thanks Tom.

Didn’t help.

I looks like “Adjust display refresh rate” is doing what it should. The refresh rate gets changed, but THAT actually causes the problem: This file just wont play correctly at 24hz, even though its 24fps, and this is why the same thing happens when I turn off the refresh rate adjustment, and set the display to 24hz manually.

Strange!

Player and video settings are set to default values.

Hi,

Are all the files you are having issues with:

MKV,
Advanced Video Codec
23.976

?

Thanks Tom.

Hi Tom.

Yes. But “only” 4K files. 1080p MKVs are fine.

Hi,

Long shot here:

http://kodi.wiki/view/HOW-TO%3AModify_the_video_cache

The wiki reports “This setting will force Kodi to use a cache for all video files, including local network, internet, and even the local hard drive” I maybe wrong, but I assuming this means the buffer mode can be set to 1; even for videos played back from a usb. Also there is a read factor setting, which should help with the frame skipping.

I would try these settings and see if there is any improvement for the the 4k movies:

<advancedsettings>
	<cache>
  		<memorysize>62914560</memorysize>  <!-- number of bytes used for buffering streams in memory 
   When set to 0 the cache will be written to disk instead of RAM -->
  		<buffermode>1</buffermode>
  		<readfactor>6.0</readfactor> 
	</cache>
</advancedsettings>

Thanks Tom.

Tried it out - but no change.

Again: frameskipping doesn’t occur when “Adjust display refresh rate” is disabled and display is 60hz. But that’s of course not perfect either for 24fps files…

Hi,

I know you advised that player and video settings are set to default, could you please just clarify what those are; as I’m away from my vk at the moment.

Also your audio settings, may shed some light aswell.

Thanks Tom.

Maybe you could try playing the Kodi sample files . I suggest trying the normal samples listed under 6 and not the torture test clips :slight_smile:

However, due to the lack of a 4K TV I can’t check them out myself so maybe someone else will be able to do this and make a comparison.