Newbies What Next ? News Forums Calendar


News Sections
General News (3987/0)
Reviews (636/0)
Press Releases (465/0)
Distributions (197/0)
Software (906/1)
Hardware (537/0)
Security (192/0)
Tutorials (356/0)
Off Topic (181/0)

User Functions


Don't have an account yet? Sign up as a New User

There are no upcoming events

Multimedia on the Raspberry Pi with omxplayer - Page 2

Multimedia on the Raspberry Pi with omxplayer - Page 2

Installing omxplayer & more

omxplayer is a command-line multimedia player for the Raspberry Pi, which runs under both the console and X Windows. omxplayer has not been packaged for Raspbian, so we have to compile the application. Before doing so, we need to install a few libraries. Fortunately, the process is pretty simple. At the shell, we type at the ($) prompt:

$ apt-get install libpcre3-dev libavfilter-dev libavformat-dev libavcodec-dev libswscale-dev
$ git clone
$ cd omxplayer
$ make
$ sudo chmod a+rw /dev/vchiq

The only other thing to do is to copy the generated executables (omxplayer and omxplayer.bin) to /usr/bin/ or another directory in the PATH. PATH is an environmental variable that tells the shell which directories to search for executable files.

omxplayer is a long way behind our favorite Linux video players, particularly in terms of functionality. Typing omxplayer at the shell lists the limited options that are available; the output is shown in the screenshot below:

Raspberry Pi - omxplayer

Whilst there are keyboard shortcuts available to navigate a video in playback, these controls are very limited. Further, when the application is running, either on the console or in X Windows, there is no built-in option to clear the display. This is an issue when a video file has an aspect ratio that does not match the display device. An inelegant solution on the console is to run omxplayer with the following command:

setterm -blank force && omxplayer filename

Unfortunately, the console display remains hidden after omxplayer exits. To get output back, we need to type setterm -blank poke. An alternative is to turn off the cursor blinking (when logged in as the root user), and pipe the text messages generated by omxplayer to /dev/null, as follows:

$ echo 0 > /sys/class/graphics/fbcon/cursor_blink
$ clear ; omxplayer file 1>/dev/null 2>/dev/null

The fact that omxplayer is the only external video player that uses the Raspberry Pi's GPU hardware acceleration makes it indispensable. This is because the low powered Broadcom CPU on the Raspberry Pi simply cannot cope with playing video files. Not surprising when the CPU benchmarks we ran in this article highlighted the limitations of the CPU.

We next need to make some multmedia files available to the Raspberry Pi. The obvious way is to copy a multmedia file over ethernet to the SD card. We had previously resized the partition to use the full capacity of the SD card, so we had space to store multmedia files. These files are centrally stored on a Buffalo NAS drive which does not have stellar performance. Using a Core i7 machine with gigabit ethernet, transferring a 477MB file from the NAS drive to the Core i7 machine took 16 seconds, which is about 30MB/sec. Copying the same file from the NAS drive to the Raspberry Pi took a whopping 117 seconds, which is a mere transfer rate of 4MB/sec. To investigate the slow transfer rate, the top utility comes in handy. The output of top is below showing a file transfer in progress.

Raspberry Pi - Transfer file from NAS drive

Raspberry Pi - Transfer file from NAS drive

From the two screenshots, we can see that the I/O wait percentage is 23.2% and 97.7%. The I/O wait measurement is the canary for an input/output bottleneck. I/O wait is the percentage of time the processor is waiting on the SD card. The SD card we are using has pretty good specs (it is a Class 10 card). In the first screenshot we can see that the cp and cifsd processes are consuming about 30% of the CPU, in the second screenshot, the processor is idle, waiting on the SD card.

With the slow transfer rate, we found it convenient to stream multimedia direct from the NAS device.

Next Page: In Operation & Summary

Read ahead

1. Introduction
2. Installing omxplayer & more
3. In Operation & Summary

Last Updated Sunday, June 17 2012 @ 01:23 PM EDT

We have written a range of guides highlighting excellent free books for popular programming languages. Check out the following guides: C, C++, C#, Java, JavaScript, CoffeeScript, HTML, Python, Ruby, Perl, Haskell, PHP, Lisp, R, Prolog, Scala, Scheme, Forth, SQL, Node.js (new), Fortran (new), Erlang (new), Pascal (new), and Ada (new).

Group Tests
All Group Tests

Top Free Software
5 Office Suites
7 Document Processors
6 Lean Desktops
6 Desktop Search
9 Project Management
9 Groupware Apps
14 File Managers
10 Databases
21 Backup Tools
21 DVD Tools
21 Window Managers
21 Productivity Tools
9 Terminal Emulators
21 Financial Tools
21 Text Editors
21 Video Emulators
21 Home Emulators
42 Graphics Apps
6 CAD Apps
42 Scientific Apps
10 Web Browsers
42 Email Apps
12 Instant Messaging
10 IRC Clients
7 Twitter Clients
12 News Aggregators
11 VoIP Apps
11 Remote Display Apps
42 Best Games
42 More Games
21 More Games
21 Notable Games (1)
21 Notable Games (2)
21 Notable Games (3)
8 ASCII Games
9 Educational Games
42 Audio Apps
42 Video Apps
6 Screencasting Apps
80 Security Apps
9 System Monitoring
6 Family History Apps
11 PDF Tools
6 Music Servers
6 Collection Managers
7 Calculator Apps
8 Geometry Apps
Free Console Apps
14 Multimedia
8 Compilers
9 IDEs
9 Debuggers
7 Revision Control Apps
6 Doc Generators
'Free' Proprietary
21 Closed-Source Apps
Top Commercial Apps
42 Games
Free Web Software
21 Web CMS
14 Wiki Engines
8 Blog Apps
6 eCommerce Apps
5 Human Resource Apps
10 ERP
10 CRM
6 Data Warehouse Apps
8 Business Intelligence
6 Point-of-Sale

All Group Tests

Other Articles
Migrating from Windows
Back up your data
Distribution Guide
Distro Portal Pages
20 Free Linux Books
Running Linux Under Windows

Older Stories
Friday 03/06
  • Raspberry Pi 2 review (0)

  • Sunday 02/22
  • Chess in a Few Bytes (0)
  • Learn the Art of Computer Programming With These Great Free Beginner Books (2)
  • CD Audio Grabbers (0)

  • Monday 01/19
  • fitlet is a tiny fanless PC full of openness (0)

  • Sunday 01/18
  • MintBox Mini gives Linux users a pocket-sized PC (0)
  • 6 Invaluable Assembly Books (0)

  • Wednesday 01/14
  • Why Mac users donít switch to Linux (0)
  • MIPS Creator CI20 review (0)

  • Tuesday 01/13
  • Getting a Time Without NTP (0)

  • Vote

    What Linux distribution do you run on your main computer?

    633 votes | 3 comments

    Built with GeekLog and phpBB
    Comments to the webmaster are welcome
    Copyright 2009 - All rights reserved