Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Building an FFmpeg static binary for ARMv7
23-04-2016, 13:25 (This post was last modified: 05-11-2020 23:21 by simoncn.)
Post: #1
[Tutorial] Building an FFmpeg static binary for ARMv7
Edit: updated this tutorial for FFmpeg 4.1.

This tutorial describes the steps needed to build a static binary for FFmpeg that can run on an 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 16.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.3 source archive from this link to your ff directory

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

7) Download the file crtfastmath.c from this link to your ff directory. You will probably need to right-click on the link and select "Save as".

8) 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

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

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

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

12) When the build has completed successfully (about 30 minutes), you will find the static binary as a file named ffmpeg in the directory ffmpeg/ffmpeg-4.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:

The build log is written to the file makeff.log in your ff directory. If the ./makeff.sh command doesn't complete successfully, check this file for error messages.

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 the ./makeff.sh command.

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 the ./makeff.sh command.

If you have any problems or questions, please post them here.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[Tutorial] Building an FFmpeg static binary for ARMv7 - simoncn - 23-04-2016 13:25

Forum Jump:


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