Building Omxplayer for Raspbian on the Raspberry Pi

This version of the omxplayer, is nearly identical to the one I published for Debian on the Raspberry Pi, except that it can be built for Raspbian. The same github repository serves to build omxplayer for both Raspbian and Debian. To configure the build for one or the other, the RASPBIAN variable must be set as described below in the Makefile.include.

This means that the primary differences between this and the default build of omxplayer still are:
  • Default output is HDMI (no need for -o hdmi)
  • Clears the screen and doesn't output anything unless there is an error
  • Makefiles have been customized  to perform a native build on the Raspberry Pi
  • There is the ability to install or uninstall using the Makefiles
  • There is the ability to make sources or make sources-clean to download or remove the firmware and ffmpeg dependencies
  • Everything installs under /usr/local
  • It is possible to install this pre-built omxplayer for Raspbian Wheezy or Debian Squeeze

Preparing to Build Omxplayer

  • First, make sure your firmware is up-to-date, as described in Keeping Your Raspberry Pi Fresh:
    • pi@raspberrypi:~$ sudo apt-get update && sudo apt-get upgrade
  • Install software needed to perform the update:
    • pi@raspberrypi:~$ sudo apt-get install ca-certificates git-core binutils libboost1...-dev libva1 libpcre3-dev
  • Download the script:
    • pi@raspberrypi:~$ sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update
  • Copy the script to /usr/local/bin:
    • pi@raspberrypi:~$ sudo cp rpi-update /usr/local/bin/rpi-update
  • Make the script executable:
    • pi@raspberrypi:~$ sudo chmod +x /usr/local/bin/rpi-update
  • To compile this successfully, use a 240/16MB RAM split between system and GPU:
    • pi@raspberrypi:~$ sudo rpi-update 240
    • pi@raspberrypi:~$ sudo reboot
Next, make sure proper ownerships are in place, go to the local src directory, and clone the git repository for my omxplayer fork:
  • pi@raspberrypi:~$ sudo chown pi:pi /usr/local/src/
  • pi@raspberrypi:src $ cd /usr/local/src
  • pi@raspberrypi:src $ git clone https://github.com/wrightrocket/omxplayer
At this point, the pre-built omxplayer could also be installed on your system if you are using Raspbian Wheezy, Debian Wheezy or Debian Squeeze. If you wish to skip compiling omxplayer, and use a pre-built version, complete the next step, and then skip to using omxplayer:
  • sudo /usr/local/src/omxplayer/install-raspbian-wheezy
or 
  • sudo /usr/local/src/omxplayer/install-debian-wheezy
The Debian Wheezy build has been tested to work on both Wheezy and Squeeze.

Building the Omxplayer

Before building, be sure to set update the Makefile.include file for the RASPBIAN variable. If building under Debian, then RASPBIAN=0 is appropriate. If building under the Raspbian OS, then update this file where RASPBIAN=1. The RASPBIAN variable determines whether hardfp or softfp is used.
  • If you are building this under Raspbian, and not Debian, then use vi, vim, nano, leafpad or some other editor to modify the RASPBIAN variable at the top of the /usr/local/src/omxplayer/Makefile.include file to set RASPBIAN=1.
Even after getting the configuration right for building, my first few attempts failed because of insufficient RAM. This is the reason a different RAM split is used during the build process than when using the player. The build sequence is:
  • Change to the directory where the source code is located
    • cd /usr/local/src/omxplayer/
  • Next, the firmware and ffmpeg sources will be downloaded. The firmware is about 427 MB and ffmpeg is about 60MB. This step took about 16 minutes on my connection.
    • make sources
  • The longest part of the process is compiling the ffmpeg libraries. Under Raspbian this step took about the same amount of time as under Debian. This step took about 131 minutes.
    • make -f Makefile.ffmpeg 
  • After the libraries are built, then they are stripped and copied to the /usr/local/src/omxplayer/ffmpeg_compiled directory. This step is very quick.
    • make -f Makefile.ffmpeg install
  • Now, omxplayer is ready to be compiled. It should only take about 6 minutes.
    • make
  • The last step of building should create a /usr/local/src/omxplayer/omxplayer-dist.tar.gz that will be used to install omxplayer and the ffmpeg libraries.
    • make dist



Finally, install omxplayer:

  • sudo make install

Using the Omxplayer

  • To use omxplayer, the system must allocate at least 64MB of RAM for the GPU. Run the script and make sure there is a 192/64 Mb of RAM split between the system and GPU. A split of 128/128 can also be used:
    • pi@raspberrypi:~$ sudo rpi-update 192
    • pi@raspberrypi:~$ sudo reboot
  • To play videos, just execute the omxplayer script
    •   omxplayer --help
    • Options :
      -h / --help print this help
      -a / --alang language audio language : e.g. ger
      -n / --aidx index audio stream index : e.g. 1
      -o / --adev device audio out device : e.g. hdmi/local
      -i / --info dump stream format and exit
      -s / --stats pts and buffer stats
      -p / --passthrough audio passthrough
      -d / --deinterlace deinterlacing
      -w / --hw hw audio decoding
      -3 / --3d switch tv into 3d mode
      -y / --hdmiclocksync adjust display refresh rate to match video
    • pi@raspberrypi:~$ omxplayer LMFAO.mp4

2

View comments

  1. I've greatly simplified building omxplayer on an RPi. Check out my commentary, instructions, and GitHub link at:
    http://prng.blogspot.com/2013/04/building-omxplayer-on-raspberry-pi.html

    ReplyDelete
  2. Hi, I followed your instruction exactly(except rpi-update, faced error so i apt-get install rpi-update and sudo rpi-update). After I do a "sudo make -f Makefile.ffmpeg" and im getting "gcc is unable to create an executable file.". Please help, thanks.

    ReplyDelete

How to get Torque Pro to work on XTRONS Android Auto car entertainment unit.

First install Torque Pro on your phone. 

I'm not sure if you have to, but you should to support it!

Find the App!

From Android Auto, go to Home.

Navigate to the Apps, and start the package installer.

Use installer to install included Torque package.

Navigate home and then Apps to find it.

Additional steps that may be needed to follow...

40 Years of My Cars

Why do this?

I started compiling a list of my cars, and I was curious what insights I might have with a statistical analysis of it. When I was nearing completion, having learned what I had wanted, I thought there might be a higher use of this. I think it is a good example of using a free compatible spreadsheet, LibreOffice Calc, doing analysis using pivot tables and charts. 

When did this happen?

This happened right after I said "good-bye" to my Mercedes E320.

Python Modules

picamera

Python Classes

PiCamera

#/usr/bin/env python3 from picamera import PiCamera from time import sleep camera = PiCamera() camera.start_preview() camera.start_recording('/home/pi/video.h264') sleep(10) camera.stop_recording() camera.stop_preview()

Simple Working Camera

Basic Video

Here's my profile: My TryHackMe Profile

Baseline creation

Vulnerability assessment

Risk assessment

Remediation

Verification

Monitoring

Preparation

Coordination with government

Coordination with security professionals

Assessment of risk

Allocation of appropriate resoures

Training

Compliance reviews

Network and Host configuration reviews

Code and API reviews

Policies and Procedures

Training

Hardening and documentation of endpoints

Physical

Virtual

Hardening and documentation of networks

Physical

Virtual

Implementation of Firewall services

Implementation of Proxy services

Implementation of EDR/IPS/IDS on endpoin

An unfinished list of websites and software to know for CyberSecurity Analyst CySA+

Sites to Know

AT&T Alien Labs (Level Blue) OpenThreat Exchange: InfraGard

InfraGard

https://www.infragard.org

InfraGard is a partnership between the Federal Bureau of Investigation (FBI) and members of the private sector for the protection of U.S.

Security Onion

While prepping for CySA+, I worked with this open source SIEM in a simulated environment. I was intrigued and wanted to give it a try. 

Tonight, I installed a Proxmox virtual machine to run the evaluation installation of Security Onion 2.4.7 from: https://securityonionsolutions.com/software. The download is nearly 12 Gb, which I downloaded to /var/lib/vz/templates/iso/ so that I could pick the ISO file to install a virtual machine.

The FlipperZero (F0) does offer an important feature which can enhance the owner's security. Instead of relying solely on a phone for a second factor of authentication, you can use the Universal Second Factor (U2F) implemented on the F0.

What is U2F?

https://en.wikipedia.org/wiki/Universal_2nd_Factor

Who Supports U2F?

Facebook, Google, YouTube, X, etc.

On Flipper

Start USB MassStorage App

To begin create a new image which is a copy of the data on your Flipper

Select the image

The image will be shared

On Linux

Open two terminal windows/tabs.

Leaving running the command dmesg --follow

Connect the Flipper Zero

Output similar to below should should be shown in your terminal running dmesg or type the dmesg command to compare.
Popular Posts
Popular Posts
  • Network Manager - nmcli  If your Linux Distribution is using Network Manager, then nmcli is a great interface to configure connections f...
  • JOOSAN NVR Admin Password Reset I purchased a 4 Camera Wireless Surveillance NVR kit from CCTV Systems on Amazon in 2016. Somehow the p...
  • Direct Rules for Firewalld Why Firewalld Direct Rules? You need more power than what's available with simply adding or removing s...
About Me - WrightRocket
About Me - WrightRocket
Blog Archive
Labels
Labels
Subscribe
Subscribe
Translate
Translate
Loading
Copyright Keith Wright. Dynamic Views theme. Powered by Blogger. Report Abuse.