Video Decoding Performance
This page records a number of possible ways to playback or stream video from you RPi.
Contents
MPlayer performance
This test requires you have Mplayer installed and an SSH connection Enable_SSH and some kind display connected ideally by HDMI.
sudo apt-get install mplayer
Test Process
- SSH into tthe RPi, two connections is optimal.
- Execute the MPlayer command given below with the required
fps
- Use the second SSH terminal to write the output of
top
to a file - Record the mean CPU% for a range of
fps
mplayer -fps 1 tv:// -tv driver=v4l2:device=/dev/video0:width=320:height=240
top -n 20 -b | grep mplayer > 1fps.txt
Data Analysis
the file written by the top
typically looks like
2295 pi 20 0 65892 15m 6812 S 0.0 8.4 0:01.26 mplayer 2295 pi 20 0 65892 15m 6812 S 3.9 8.4 0:01.38 mplayer 2295 pi 20 0 65892 15m 6812 S 3.9 8.4 0:01.50 mplayer ... etc
Some awk
get the average using
$ cat ave.awk #!/usr/bin/awk -f # Calculate average, syntax: avg.awk field-number file BEGIN { field = ARGV[1]; ARGV[1] = "" } { sum += $field } END { print sum / NR }
Average CPU is found using
$ ./ave.awk 9 1fps.txt $ 3.51
Results
Linux raspberrypi 3.2.27+ #66 PREEMPT Fri Aug 24 23:52:42 BST 2012 armv6l GNU/Linux
fps | CPU(%) @320x240 | CPU(%) @640x480 |
---|---|---|
01 | 2.665 | 12.13 |
02 | 4.88 | 19.985 |
05 | 11.90 | 51.735 |
10 | 23.425 | 95.62* |
15 | 35.85 | 95.39*** |
20 | 47.78 | 95.565* |
25 | 60.86 | 96.83* |
30 | 72.05 | 95.065* |
*this is the CPU maxed out, the actually achieved frame rate is probably between 5-10Hz.
Hardware Acceleration
From Aug 2012, the RaspberryPi foundation sucessfully negotiated licences for MPEG2 and VC-1 for use in the RPi. This required a firmware upgrade and the user to purchase the license for a small fee RPi Shop .
THe following table is the same tests repeated with both codec licenses registered in /boot/config.txt
fps | CPU(%) @320x240 | CPU(%) @640x480 |
---|---|---|
01 | ||
02 | ||
05 | ||
10 | ||
15 | ||
20 | ||
25 | ||
30 |