-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update pi-util/BUILD.txt to better reflect reality
- Loading branch information
1 parent
346d790
commit 2097651
Showing
1 changed file
with
47 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,59 @@ | ||
Building Pi FFmpeg | ||
================== | ||
|
||
Configuration: | ||
============= | ||
Current only building on a Pi is supported. | ||
This builds ffmpeg the way I've tested it | ||
|
||
These instructions work for cross compiles from Ubuntu 16.04 & Ubuntu | ||
18.04. I would expect most other linux environments to work but I haven't | ||
tried them. | ||
Get all dependencies - the current package dependencies are good enough | ||
|
||
pi-util/conf_pi2.sh | ||
$ sudo apt-get build-dep ffmpeg | ||
|
||
contains suitable options to build the code for Pi2/3. It expects to find | ||
git clones of | ||
Configure using the pi-util/conf_native.sh script | ||
------------------------------------------------- | ||
|
||
https://github.com/raspberrypi/tools | ||
https://github.com/raspberrypi/firmware | ||
This sets the normal release options and creates an ouutput dir to build into | ||
The directory name will depend on system and options but will be under out/ | ||
|
||
in the parent of the FFmpeg directory. I recommend using --depth 1 to avoid a | ||
lot of history you don't want. | ||
There are a few choices here | ||
--mmal build including the legacy mmal-based decoders and zero-copy code | ||
this requires appropriate libraries which currently will exist for | ||
armv7 but not arm64 | ||
--noshared | ||
Build a static image rather than a shared library one. Static is | ||
easier for testing as there is no need to worry about library | ||
paths being confused and therefore running the wrong code, Shared | ||
is what is needed, in most cases, when building for use by other | ||
programs. | ||
|
||
If you have a copy of qasm.py in ../local/bin then the .qasm sources will be | ||
rebuilt. Otherwise the prebuilt .c & .h files will be used. | ||
Likewise ../local/bin/vasmvidcore_std will enable VPU code rebuild | ||
So for a static build | ||
--------------------- | ||
|
||
pi-util/conf_p1.sh should configure for Pi1. Beware that as of this time | ||
H265 QPU acceleration is broken on Pi1 and so it is disabled. | ||
$ pi-util/conf_native.sh --noshared | ||
|
||
$ make -j8 -C out/<wherever the script said it was building to> | ||
|
||
You can now run ffmpeg directly from where it was built | ||
|
||
For a shared build | ||
------------------ | ||
|
||
$ pi-util/conf_native.sh | ||
|
||
You will normally want an install target if shared. Note that the script has | ||
set this up to be generated in out/<builddir>/install, you don't have to worry | ||
about overwriting your system libs. | ||
|
||
$ make -j8 -C out/<builddir> install | ||
|
||
You can now set LD_LIBRARY_PATH appropriately and run ffmpeg from where it was | ||
built or install the image on the system - you have to be careful to get rid | ||
of all other ffmpeg libs or confusion may result. There is a little script | ||
that wipes all other versions - obviously use with care! | ||
|
||
$ sudo pi-util/clean_usr_libs.sh | ||
|
||
Then simply copying from the install to /usr works | ||
|
||
$ sudo cp -r out/<builddir>/install/* /usr | ||
|
||
|