Difference between revisions of "Video Decoding Performance"
m (→Hardware Acceleration) |
m (→Hardware Acceleration) |
||
Line 89: | Line 89: | ||
[http://thedigitallifestyle.com/w/index.php/2012/08/29/what-do-the-mpeg-2-and-vc-1-decoder-options-get-you-on-the-raspberry-pi/ | what-do-the-mpeg-2-and-vc-1-decoder-options-get-you-on-the-raspberry-pi/] | [http://thedigitallifestyle.com/w/index.php/2012/08/29/what-do-the-mpeg-2-and-vc-1-decoder-options-get-you-on-the-raspberry-pi/ | what-do-the-mpeg-2-and-vc-1-decoder-options-get-you-on-the-raspberry-pi/] | ||
+ | |||
+ | [http://www.raspberrypi.org/archives/tag/mpeg-2 http://www.raspberrypi.org/archives/tag/mpeg-2] | ||
+ | |||
+ | [http://www.engadget.com/2012/08/26/raspberry-pi-mpeg-2-vc-1-licenses-cec-h264/ http://www.engadget.com/2012/08/26/raspberry-pi-mpeg-2-vc-1-licenses-cec-h264/] |
Latest revision as of 16:47, 29 August 2012
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 .
Hardware acceleration does not affect video capture, only video playback.
| what-do-the-mpeg-2-and-vc-1-decoder-options-get-you-on-the-raspberry-pi/
http://www.raspberrypi.org/archives/tag/mpeg-2
http://www.engadget.com/2012/08/26/raspberry-pi-mpeg-2-vc-1-licenses-cec-h264/