Low FPS when playing (H264 - MPEG-4 AVC)

Hello,

I have some performance issue with my rasplex and was wondering if somebody had a suggestion how to resolve.
When playing some files I see that my frame rate is arround 5-8 fps.

Hope that somebody had a similar issue and found a good solution =).

Thank you in advance,

Christian
 
 
[MediaServer]
Plex Version 0.9.8.18
(with plenty of CPU power)
(Connected to Gigabit switch)
 
[Raspi Model B]
rasplex Version: 0.3.1
Connected to Gigabit Switch 
pi1:~ # vcgencmd codec_enabled MPG2
MPG2=enabled
pi1:~ # vcgencmd codec_enabled WVC1
WVC1=enabled
 
 
[Video info]
Codec: H264 - MPEG-4 AVC (part 10) (H264)
Resolution: 720x576
Frame rate: 25
Decoded format: Planar 4:2:0 YUV
 
[Audio Info]
Type: Audio
Codec: MPEG Audio layer 1/2/3 (mpga)
Bitrate: 192 kb/s
 
while playing back a movie, i've recorded the following network stats.
Looks to me that the low FPS is not related to the network speed of the PI.
pi1:~ # ifconfig eth0| grep 'RX'  && sleep 10 && ifconfig eth0 | grep RX
          RX packets:164858 errors:0 dropped:187 overruns:0 frame:0
          RX bytes:237064077 (226.0 MiB)  TX bytes:7360669 (7.0 MiB)
          RX packets:165386 errors:0 dropped:188 overruns:0 frame:0
          RX bytes:237819788 (226.8 MiB)  TX bytes:7383698 (7.0 MiB)

-
top output: 
Mem: 282900K used, 25900K free, 0K shrd, 29076K buff, 96592K cached
CPU: 16.1% usr 10.1% sys  3.5% nic 69.9% idle  0.0% io  0.0% irq  0.2% sirq
Load average: 0.56 0.54 0.58 1/98 1290
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
 1102     1 root     S     510m169.1   0 27.7 /usr/lib/plexhometheater/plexhometheater --standalone -fs --lircdev /var/run/lirc/lircd
 

I started playing around with RasPlex yesterday (tho long-time Plex user), and immediately encountered the same issue - 5 to 8fps playback, with 50-100% CPU utilisation (after caching has reached ~50MBytes).  doesn't seem to matter whether it's SD/DVD, 720p or 1080p source media, nor whether I set the LCD monitor to 1080 (native, normally), 1440 or 720 resolution.  all media i'm referring to here is h264 (sometimes .m4v, sometimes .mkv) with stateo, AC3 or DTS.

RPi modelB, 512MB, connected to a wired GigE switch.  HDMI to an LCD monitor. 

Installed on a Sandisk 8GB C6/20MB/s SD card.

RasPlex 0.3.1 & 0.9.9.18, same result.

Anyone got any ideas what's going on?

Is your Raspberry Pi overclocked? If it is try to undo it.


Gesendet von meinem Nexus 4 mit Tapatalk

on 0.3.1, no, I checked the config file and it wasn’t overclocked (presumably the default config?).


I didn’t check on 0.9.9.18, but I assumed it to be the same.


(and low fps is experienced on both).

Hi,

does the video really stutter or does it run smooth and only the fps-information shows 8fps ?

I have the same experience when running the Raspberry with a Dell LCD monitor (1680x1050) . The video is smooth but it show 6-8 fps.

Attached to my Panasonic Plasma (1080p) it shows correct values ~24 fps and runs smooth.

So I guess the fps-calculation is faulty ?!

Regards

Kivas

Hi Kivas,

my video runs smooth 99.9% of the time, on 0.3.1 & 0.9.9.18.

interesting result you have there.  i just checked (v0.9.9.18) on our Panasonic plasma TV (2013 50" model) too.

no, same result on the TV as for the desktop LCD monitor (both 1080p HDMI), 5-8fps, no matter what the source media resolution, just varying CPU loads (~50% for SD, ~70% for 720p, ~90% for 1080p).

in fact running Rasplex side by side with a Mac Mini running Plex, it's difficult to tell the differences (besides the difference in the monitor/TV quality).  although on the Plex UI, the fades from one screen to another are often quite rough, what I'd expect with a 5-10fps output.

on an unrelated matter:

the responsiveness of the Plex UI navigation is pretty bad - waiting 1-5 seconds for a response to up/down/left/right/enter/esc input borders on unusable.  but maybe that's my C6/20MB/s SD Card?

Hi,

if video runs smooth I would not care about the fps-information - I really have doubts that this information is reliable. If your eyes tell you that it is fine.....don´t worry about fps. :D

The slow UI navigation was also a point why I´ve was not satisfied with Rasplex.

But since I´m running the Rasplex overclocked and using a USB stick it´s much better. Navigation is very smooth of course some menus in the UI take longer for initial load, but that´s ok.  That has increased the WAF :rolleyes:  esp. because the Panasonic Plasma (TX-50GT50E) remote can be used to control the Rasplex. It´s almost a perfect media player now - hope that new version will be even faster.

Regards

Kivas

I dunno - on the Mac Mini the output fps hovers closely around the value it should, but the RPi is way off.  It would be nice to at least know why, even if this is considered "normal behaviour" on Rasplex/RPi.  I haven't done A/B testing with fast moving media yet, either.

It would be helpful if a Rasplex insider could pop their head in here & point us in the right direction... :)

So any RPi OS can be installed on a USB stick & boot from it, not just an SD card?  I noticed elsewhere a recommendation to use a USB3 stick, even tho the RPi is only USB2 - is that really worthwhile? (I understand a USB3 stick is much more likely to run the USB2 i/f at saturation, unlike many USB2 sticks, I'm guessing this is why?)

So are you still using 0.3.1?  0.9.9.18 seems much better, has the newer Plex client version, does all the meta-data pre-caching on first run, tho it's locked up within a few minutes of playback about 50% of the time I've played with it so far...

I don´t know if booting from USB is supported. I guess not. The "trick" that Rasplex does is to start booting from SD card as usual but then continue loading from USB stick.

So when Rasplex is fully loaded the SD card is not used anymore (for caching etc). That is done from the USB stick - which is normally faster than SD - providing that u have a fast USB stick.

most people use a USB3 stick, because a good USB3 stick is faster on a USB2 port than a native USB2 stick.

I´m using a Sandisk Extreme USB3.

Yes still using 0.3.1. it´s very stable and actually I want to use my media player to watch media and not to be annoyed about it :D

So any RPi OS can be installed on a USB stick & boot from it, not just an SD card?

 
The boot always has to be done from a FAT32 partition on an SDcard, because that's what the firmware bios needs.
But that boot partition includes configuration files that determine how the boot will proceed (and other things).

One of those files is the "cmdline.txt" file which for RasPlex normally contains the single text line:
boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 quiet growstorage

And for boot from a USB3 stick I have changed that line to:
boot=/dev/sda1 disk=/dev/sda2 ssh quiet oprofile.timer=1

Here "sda" refers to the first detected USB storage drive, while the "1" and "2" digits added to the string refer to the 1st and 2nd partition of that drive. I usually expand the 2nd partition to include all the free space 'behind' it, for which I use the free edition of "Paragon Partition Manager" (since Windows can't handle Ext4 partitions natively).

I'm not sure if all RPi distros can be handled in exactly the same way, but I am sure that it can be done by variations of it.
 

I noticed elsewhere a recommendation to use a USB3 stick, even tho the RPi is only USB2 - is that really worthwhile? (I understand a USB3 stick is much more likely to run the USB2 i/f at saturation, unlike many USB2 sticks, I'm guessing this is why?)

 
Your guess is correct. Normal USB2 sticks will never even come close to the saturation limit. In fact the interface itself probably has a higher limit than the RPi hardware can service, but a good USB3 stick will raise the speed as high as it can go in an RPi, even with overclocking. So their use with the RPi is definitely worthwhile.
 

0.9.9.18 seems much better, has the newer Plex client version, does all the meta-data pre-caching on first run, tho it's locked up within a few minutes of playback about 50% of the time I've played with it so far...

I've used RP-9.9.18 myself ever since its release, and I have very few problems with it.

(eg: There is a known bug which can crash the RPi if in the preplay screen for one show episode you attempt to step directly to the next episode)

I did have some initial problems during the pre-caching, which can take a VERY long time to complete for a large PMS media library.

But once that caching completed, and I additionally browsed through the entire lists for each section once (a different kind of caching), all my problems disappeared.

I've now also installed the alternate skins "Amber" and "Night", for an even more enjoyable RasPlex experience. :)

For those who favor speed over eye-candy those skins offer several viewmodes that waste less CPU power, allowing more responsive library browsing.

And for those who want the eye-candy regardless of costs, these skins offer more of it than the default skin can do.

Another nice feature is that both those skins now contain a 'Reboot' command in addition to the 'Shutdown' command for their configurable 'Quit' menus

NB: The current Amber and Night versions only work properly with the current PHT versions, so for these you should use an RP-9.9.x version of RasPlex.

BTW: Today I plan to start testing the latest RP-9.9.19, which was released earlier this morning.

Best regards: dlanor

https://forums.plex.tv/topic/96779-rasplex-9919-fix-preplay-huge-perf-improvements/

Do you have to copy this cnd line to both usb and sd card?? Also I assume you delete the org line !


And for boot from a USB3 stick I have changed that line to:

boot=/dev/sda1 disk=/dev/sda2 ssh quiet oprofile.timer=1


Here “sda” refers to the first detected USB storage drive, while the “1” and “2” digits added to the string refer to the 1st and 2nd partition of that drive. I usually expand the 2nd partition to include all the free space ‘behind’ it, for which I use the free edition of “Paragon Partition Manager” (since Windows can’t handle Ext4 partitions natively).

Do you have to copy this cnd line to both usb and sd card??

Some people claim that it only matters on the SD card, since that's what's used during the initial part of the boot procedure.
But I believe that the file may be accessed in other circumstances as well, and for those cases it's most likely the one on the USB drive which will be used.

(Some people have reported loss of some functionality with the changed file only on SD card.)
 

Also I assume you delete the org line !

Yes. In my RasPlex setups the "cmdline.txt" file contains only that single line which I specified.
Among other things that line assigns partitions of the USB drive for use both for the remainder of the boot and for data 'disk' usage.
The original line assigns partitions of the SD card for those purposes, so that line should be removed.

Best regards: dlanor

Dont bother too much with fps displayed in the UI as it will display the UI renderrate display that we intentionally limited to max of 15 fps for perf reasons.

The playback renderrate is something different that is not displayed on the UI. Priority is given to playback and UI refresh rate is lowered so that playback keeps smooth.

Sorry forgot to mention do I need to extend partitions on both sd card and usb or just usb? Cheers for your help jon

Sorry forgot to mention do I need to extend partitions on both sd card and usb or just usb? Cheers for your help jon

The second partition of the SD card should never be used for anything when booting a USB3 setup such as I described.

So for these cases it's only necessary to extend the second partition on the USB3 drive.

The need for extending that partition varies with the size of your library, but I always recommend doing it.

For this purpose I always use the freeware edition of the "Paragon Partition Manager".

Best regards: dlanor

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.