Video Decoding Performance
From SingletonMillerWiki
Revision as of 15:47, 29 August 2012 by Martin (Talk | contribs) (moved video performance analysis to a new page.)
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 | |
02 | 4.880 | |
05 | 11.900 | |
10 | 23.425 | |
15 | 35.85 | |
20 | 47.78 | |
25 | ||
30 |
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 .