From 20976516e8d47837bd76dc8d4a3bc5d2072aab22 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 1 Feb 2022 13:22:23 +0000 Subject: [PATCH] Update pi-util/BUILD.txt to better reflect reality --- pi-util/BUILD.txt | 64 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/pi-util/BUILD.txt b/pi-util/BUILD.txt index 7f16dff6a2f..b050971f63c 100644 --- a/pi-util/BUILD.txt +++ b/pi-util/BUILD.txt @@ -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/ + +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//install, you don't have to worry +about overwriting your system libs. + +$ make -j8 -C out/ 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//install/* /usr