LinuxLinks.com
Newbies What Next ? News Forums Calendar

Search





News Sections
Home
General News (3973/0)
Reviews (628/0)
Press Releases (464/0)
Distributions (187/0)
Software (867/0)
Hardware (522/0)
Security (192/0)
Tutorials (345/0)
Off Topic (181/0)


User Functions
Username:

Password:

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


Events
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 https://github.com/ttk592/omxplayer
$ 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
6 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
Programming
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
Sunday 05/18
  • 6 Invaluable Free Ada Books (0)

  • Thursday 05/15
  • 4 Best Free Pascal Books (0)

  • Saturday 05/10
  • 5 Best Free Erlang Books (0)

  • Sunday 05/04
  • The 9 Best Free Fortran Books (0)

  • Thursday 05/01
  • 5 Best Free Node.js Introductory Books (0)

  • Sunday 04/27
  • Tools to Empower Librarians (0)

  • Saturday 04/19
  • Create Vector Graphics with Open Source Software (0)
  • Manage your Business with a Complete Software Solution (0)

  • Sunday 04/06
  • Free to Play Linux Games on Steam (0)
  • Increasing Lab Efficiency with an Open Source LIMS (0)


  • Vote

    What do you find MOST attractive about Open Source software?

    Amount of customization
    Security
    Freedom provided
    Speed of development
    Quality
    Multiple versions
    Cost
    Potential to contribute
    Ability to modify code
    Results
    4777 votes | 2 comments

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