Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Building an FFmpeg static binary for ARMv7
23-04-2016, 13:25
Post: #1
[Tutorial] Building an FFmpeg static binary for ARMv7
This tutorial describes the steps needed to build a static binary for FFmpeg that can run on any ARMv7 Linux platform (typically a NAS or a single-board computer). To perform the build, you need an Intel-based computer running Linux. The following instructions have been tested on Ubuntu 12.04 LTS x86 and Ubuntu 14.04 LTS x64.

Build instructions:

1) Create a local directory (your linaro directory) that you will use to install the linaro cross-compiler (example: /sd1/linaro)

2) Download the linaro gcc cross-compiler from this link to your linaro directory

3) With your linaro directory as the current directory, run the command:
tar xf gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux.tar.bz2

4) Create a local directory (your ff directory) for the FFmpeg build (example: /sd1/ff)

5) Download the libsoxr 0.1.2 source archive from this link to your ff directory

6) Download the FFmpeg 3.0.1 source archive from this link to your ff directory

7) Download the script file makeff.sh from this link to your ff directory and make it executable by running the command:
chmod 755 makeff.sh

8) Edit the makeff.sh script file to change the LINARO= line to match the name of your linaro directory

9) If cmake isn't already installed, run the command: sudo apt-get install cmake

10) With your ff directory as the current directory, start the build by running the command: ./makeff.sh

11) When the build has completed successfully (about 30 minutes), you will find the static binary for ARMv7 as a file named ffmpeg in the directory ffmpeg/ffmpeg-3.0.1/build underneath your ff directory

The static binary includes libsoxr and doesn't include any other additional libraries. It contains the default FFmpeg components without any nonfree or GPL code. If you want to change this, you can edit the makeff.sh file.

Problem solving:

if you are using Linux x64 and makeff.sh fails with a message about libstdc++.so.6, run the command sudo apt-get install lib32stdc++6 and then rerun makeff.sh

if you are using Linux x64 and makeff.sh fails with a message about libz.so.1, run the command sudo apt-get install lib32z1 and then rerun makeff.sh

If you have any problems or questions, please post them here.
Find all posts by this user
Quote this message in a reply
23-04-2016, 15:37 (This post was last modified: 23-04-2016 15:38 by bubbleguuum.)
Post: #2
RE: [Tutorial] Building an FFmpeg static binary for ARMv7
BubbleUPnP Server has exactly the same problematic, where it needs a recent ffmpeg compiled with most codecs, and ideally SoX and https support (which are rarely available in stock binaries).

The cool news is that the Optware-ng project provides nice ffmpeg/ffprobe binaries with all of the above for many archs, including all ARM variants and MIPSEL.

These binaries are a breeze to install:

- install Optware-ng following its install instructions
- install the ffmpeg package:
ipkg install ffmpeg
- ffmpeg is in /opt/bin, ready to use

This can be used on Raspberry Pi, Synology (it has a usable default ffmpeg but no ffprobe), QNAP, MIPSEL based routers, i686 Linux, custom devices, etc.
Find all posts by this user
Quote this message in a reply
23-04-2016, 17:22
Post: #3
RE: [Tutorial] Building an FFmpeg static binary for ARMv7
(23-04-2016 15:37)bubbleguuum Wrote:  The cool news is that the Optware-ng project provides nice ffmpeg/ffprobe binaries with all of the above for many archs, including all ARM variants and MIPSEL.

Thanks for this pointer. I gave up on Optware some time ago because almost everything in the repository was too old to be of any interest. It's good to hear that it has a new lease of life now. Smile
Find all posts by this user
Quote this message in a reply
23-04-2016, 17:39 (This post was last modified: 23-04-2016 17:40 by bubbleguuum.)
Post: #4
RE: [Tutorial] Building an FFmpeg static binary for ARMv7
(23-04-2016 17:22)simoncn Wrote:  
(23-04-2016 15:37)bubbleguuum Wrote:  The cool news is that the Optware-ng project provides nice ffmpeg/ffprobe binaries with all of the above for many archs, including all ARM variants and MIPSEL.

Thanks for this pointer. I gave up on Optware some time ago because almost everything in the repository was too old to be of any interest. It's good to hear that it has a new lease of life now. Smile

Speaking of which, Optware-ng provides up to date OpenJDK 7 and 8 packages for these archs (including MIPSEL) that seems to work well (stable). It is of course slower than Oracle's JRE, but a usable alternative when Oracle is not available. It had a few issues with crypto (TLS) that affected BubbleUPnP Server but I could workaround the major issues. Making these OpenJDK packages has not exactly been a piece of cake for alllexx88 who made them.
Find all posts by this user
Quote this message in a reply
23-04-2016, 18:35
Post: #5
RE: [Tutorial] Building an FFmpeg static binary for ARMv7
(23-04-2016 17:39)bubbleguuum Wrote:  Speaking of which, Optware-ng provides up to date OpenJDK 7 and 8 packages for these archs (including MIPSEL) that seems to work well (stable). It is of course slower than Oracle's JRE, but a usable alternative when Oracle is not available. It had a few issues with crypto (TLS) that affected BubbleUPnP Server but I could workaround the major issues. Making these OpenJDK packages has not exactly been a piece of cake for alllexx88 who made them.

This is good to know. However, I have a different opinion on whether a 5x slowdown on ARM processors when scanning the MinimServer library or doing transcoding is usable. My recommendation is therefore that all MinimServer users should use Oracle Java when runnng MinimServer on an ARM processor. I haven't noticed any performance difference on Intel processors.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)