MP4 playback stutters

I am finding that some MP4 files stutter when playing and others play fine, is there anything I can do in the settings about this? A file that works is a DVD I ripped using Handbrake and one that doesnt work is a home movie I created using MS Movie Maker.

Raspberry Pi V1 with only 256MB
Files live on a Dlink NAS accessed using an NFS share
I use homeplugs to connect from the Pi in the lounge to the Router in the study, the Dlink NAS is connected via 10/100 ethernet to the router

I read another post on here about mediainfo and here is details of a file that works:

General
Complete name : Z:\Films\DVD_RIP.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 1.19 GiB
Duration : 2h 11mn
Overall bit rate mode : Variable
Overall bit rate : 1 289 Kbps
Encoded date : UTC 2015-10-03 12:16:14
Tagged date : UTC 2015-10-03 13:42:43
Writing application : HandBrake 0.9.6 2012022800

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2h 11mn
Bit rate : 1 125 Kbps
Width : 720 pixels
Height : 428 pixels
Display aspect ratio : 2.40:1
Original display aspect ratio : 2.40:1
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.146
Stream size : 1.04 GiB (87%)
Writing library : x264 core 120
Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=3 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2015-10-03 12:16:15
Tagged date : UTC 2015-10-03 13:42:43
Color range : Limited
Color primaries : BT.601 NTSC
Transfer characteristics : BT.709
Matrix coefficients : BT.601

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 2h 11mn
Bit rate mode : Variable
Bit rate : 160 Kbps
Maximum bit rate : 236 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 151 MiB (12%)
Title : Stereo
Language : English
Encoded date : UTC 2015-10-03 12:16:15
Tagged date : UTC 2015-10-03 13:42:43

Menu
ID : 3
Codec ID : text
Duration : 2h 11mn
Encoded date : UTC 2015-10-03 12:16:15
Tagged date : UTC 2015-10-03 13:42:43
00:00:00.000 : Chapter 1
00:03:48.160 : Chapter 2
00:09:32.720 : Chapter 3
00:14:29.480 : Chapter 4
00:23:21.600 : Chapter 5
00:30:34.200 : Chapter 6
00:38:15.520 : Chapter 7
00:42:59.480 : Chapter 8
00:48:15.680 : Chapter 9
00:58:10.960 : Chapter 10
01:01:47.000 : Chapter 11
01:09:27.520 : Chapter 12
01:17:16.480 : Chapter 13
01:27:03.760 : Chapter 14
01:31:57.560 : Chapter 15
01:38:52.440 : Chapter 16
01:46:46.560 : Chapter 17
01:51:11.840 : Chapter 18
01:58:41.280 : Chapter 19
02:03:39.800 : Chapter 20
Bit rate mode : VBR

And here is a file that doesnt work:

General
Complete name : Z:\Family_Videos\ACWS Portsmouth 2015.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 310 MiB
Duration : 4mn 34s
Overall bit rate : 9 468 Kbps

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L4
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=15
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 4mn 34s
Source duration : 4mn 34s
Bit rate : 9 272 Kbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.149
Stream size : 304 MiB (98%)
Source stream size : 304 MiB (98%)
mdhd_Duration : 274875

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 4mn 34s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 6.32 MiB (2%)
mdhd_Duration : 274816

Can anyone help?

Thanks
Simon

What TV, connected via HDMI?

Can you check/verify the real active framerate of the TV while playback? Some TVs tell you when using the ‘info’ button.

Does it make a difference if you set the refresh rate of the OSMC desktop to 50 fps in Settings->System->Video Output before starting the playback?

It is a Sony 40 inch LCD TV. The Pi is connected by HDMI.
I will try your other suggestions tonight.
I had read on another post that it may be the bit rate is too high for my network to stream, any thoughts on this?
Thanks

Copy the file onto the SD card and try playing it there, that’s one way to rule out the network. You can use something like WinSCP to easily copy it over from Windows to the /home/osmc folder.

I uploaded the file to the Pi using WinSCP, it uploaded at about 1300KB/s which presumably gives an idea of network speeds. The file played perfectly fine from /home/osmc but via the network it plays very badly.

I tried setting to 50fps but this didnt have much effect.

I presume this points to the network? If so what can I do? Do I only have 3 alternatives…

Somehow connect the Pi via ethernet rather than homeplug
Copy the videos to the Pi and watch from there
re-encode the videos with a lower quality/bitrate

Is there another simpler alternative to somehow tell the Pi to use a lower bitrate?

Thanks
Simon

What kind of home plugs do you have? Some are faster than others. Your li all wiring can apparently also affect it. They prefer being plugged straight into the socket rather than into an multi-way adaptor.

The Homeplugs are quite old now, they are Comtrend Powergid 9020.

At the router end they are plugged into a multiway adapter. At the Raspberry Pi end it is plugged straight into the wall, I then have a network switch before plugging the cable into the Pi. Other devices plugged into the switch are not active when the Pi is in use.

I have tried plugging the router end straight into the wall and removing the switch at the Pi end and it has improved things a bit it not still pauses in playback occasionally. Is there anything else I can do?

I think I have 2 options…

Drill holes in the wall and run an ethernet cable between router and Pi
Reencode all the videos at a lesser quality

Any other ideas?

Thanks

If that was over SCP, that’s not bad… There is a lot of encryption overhead there. I’d try using iperf to verify that your throughput is insufficient before drilling a hole in your wall and waking up neighbours on a Sunday morning tomorrow.

Powerline adapters have surprisingly improved (although their performance is still subject to the house wiring).

Sam

Thanks Sam.

I tried iperf, I couldnt install it on my NAS but installed it on my windows PC which is connected by ethernet to the router. I ran ‘iperf3 -s’ on my PC and ‘iperf3 -c 192.168.0.100’ in my Pi and this is what I got on the Pi:

Connecting to host 192.168.0.100, port 5201
[ 4] local 192.168.0.101 port 53198 connected to 192.168.0.100 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 1.86 MBytes 15.6 Mbits/sec 0 148 KBytes
[ 4] 1.00-2.00 sec 1.68 MBytes 14.1 Mbits/sec 0 218 KBytes
[ 4] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec 2 1.41 KBytes
[ 4] 3.00-4.00 sec 0.00 Bytes 0.00 bits/sec 0 1.41 KBytes
[ 4] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 1 1.41 KBytes
[ 4] 5.00-6.00 sec 696 KBytes 5.70 Mbits/sec 0 218 KBytes
[ 4] 6.00-7.00 sec 1.02 MBytes 8.59 Mbits/sec 0 218 KBytes
[ 4] 7.00-8.00 sec 1.40 MBytes 11.7 Mbits/sec 0 218 KBytes
[ 4] 8.00-9.00 sec 636 KBytes 5.21 Mbits/sec 1 1.41 KBytes
[ 4] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec 1 1.41 KBytes


[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 7.26 MBytes 6.09 Mbits/sec 5 sender
[ 4] 0.00-10.00 sec 6.96 MBytes 5.84 Mbits/sec receiver

iperf Done.

Those numbers mean nothing to me, do you think my throughput is insufficient?

Thanks,Simon

He is right, but I don’t know if is a OSMC software problem o an third party library problem.

I have a June version (kernel 3.x) with “apt-get upgrade” done (but not dist-upgrade) and in the last weeks I had the same problem.

I tryed today to do a clean instalation of this version, without update, and the problem dissapeared.

I updated this instalation with apt-get upgrade, that updated these packages:

apt apt-utils armv7-connman-osmc armv7-eventlircd-osmc armv7-libnfs-osmc armv7-libshairplay-osmc armv7-remote-osmc armv7-splash-osmc
base-files base-files-osmc bind9-host dbus diskmount-osmc libapt-inst1.5 libapt-pkg4.12 libbind9-90 libc-bin libc6 libdbus-1-3 libdns100
libexpat1 libfreetype6 libgnutls-deb0-28 libgssapi-krb5-2 libgudev-1.0-0 libicu52 libisc95 libisccc90 libisccfg90 libk5crypto3 libkrb5-3
libkrb5support0 libldap-2.4-2 liblwres90 libmysqlclient18 libpam-systemd libsasl2-2 libsasl2-modules-db libsystemd0 libudev1 locales
mediacenter-addon-osmc mediacenter-skin-osmc multiarch-support mysql-common ntp perftune-osmc python-apt python-apt-common
rbp-bootloader-osmc rbp-userland-osmc rbp2-libcec-osmc rpcbind ssh-app-osmc systemd systemd-sysv tzdata udev wireless-firmware-osmc

Rebooted the system and the problem returned!

PD: I have a Raspberry Pi 2 and is not a networking problem. As I said, it works without problem before update.

You need to be using **dist-**upgrade

I can’t do a dist-upgrade because it updates the kernel and it breaks the TV tunner.

I’m not updating the SO, only some packages: apt-get(8) - Linux man page

Do not do an upgrade instead of a dist-upgrade, this will cause you problems when we change the dependencies of our packages as upgrade (as opposed to dist-upgrade) will not install new package dependencies. This will lead to a failed or partially failed upgrade that may even prevent your system booting.

If you must hold back the kernel you should hold the kernel meta package like so:

sudo apt-mark hold rbp2-kernel-osmc

This assumes Raspberry Pi 2. You can reverse this hold by using ‘unhold’. This will prevent any further kernel updates but you will be able to dist-upgrade the rest of the system correctly.

While we do not officially support holding back the kernel like this, on the Pi 1 or Pi 2 you will probably be ok, and this is much preferable to trying to do upgrade instead of dist-upgrade. (Of course you would not receive any bug fixes that the new kernel might offer if you disable kernel updates)

Holding the kernel should not be done on a Vero.

On the Pi 4.x and Kodi 15 are actually pretty tightly coupled, especially with VCSM. Even more so on Vero (fractional modes and refclock)

Have we got some cross-posting going on here as the last few posts dont seem to follow this thread.

Has anyone got any opinions on my iperf results I put in post 9? Is there another type of powerline adapters that will be quicker?

Thanks,
Simon

Hello!

I have same stutter problem here too, movie is lagging like every 4 seconds or something like that. I think it came when i changed the “adjust display refresh rate to match videos” option on. Im not too sure, but i think when i watched movies default settings that were “sync playback to display” it didnt exist. So the problems with me were when my tv was 24p mode. But i didnt investigate it too much because i changed back to openelec pretty fast because everything works there fine. But in theory I surely do like OSMC concept more, so I hope you guys can solve the problem. I have raspberry pi2 and Panasonic VT30 plasma TV.

Really? What problem do we need to solve?

Then it sounds like your issue was a mis-configuration on your part? I have no idea what you hope to accomplish with your post here. It provides absolutely ZERO useful debug info, namely, logs demonstrating the issue. So, seemingly a troll post…

Have you tested by just using an ethernet cable stretching from the router to the Pi to confirm the homeplugs are an issue?

Well, to me it seems there is problem, because same options with openelec it works fine with .mp4 files and with OSMC it doesnt. Sure it would be great to give you some logs and stuff and I when i can arrange some time I definately give you something more than words ASAP. And yeah, i play files from my USB storage and its connected to raspberry pi itself. yesyes i know not helping right now, but just saying.

I tryed with an updated system (clean install with the last version) and it works fine.

I will wait until november update and make a clean install and configuration of the system, and I will do a migration to this version (now I’m in a june version)