# FFmpeg in Loft
Loft includes FFmpeg 7.1 (upstream tag n7.1), licensed under the GNU Lesser General Public License, version 2.1 or later. It is used only to rewrite media containers, never to decode or encode: the build is configured --disable-gpl --disable-nonfree, with decoders and encoders disabled.
It is built from unmodified upstream source. The one packaging change is that the public headers inside the framework have #include "libav…" rewritten to #include <CFFmpeg/libav…> so that they resolve inside an Apple framework.
## Source and build script
- ffmpeg-7.1.tar.xz — the complete corresponding
source, mirrored here rather than only linked upstream.
- build-ffmpeg.sh — the script that builds it, exactly
as used for the released version.
## Written offer
Loft includes FFmpeg as a separate dynamic library, CFFmpeg.framework, which the app loads from its Frameworks folder. You may replace it with a modified version of FFmpeg built with the published script. On iPhone and iPad, installing an app with a replaced framework requires re-signing it with your own developer certificate.
As section 6 of the GNU Lesser General Public License version 2.1 provides, we will give anyone who received Loft the complete corresponding FFmpeg source code and the script that builds it, charging nothing beyond the cost of physically providing them. This offer is valid for at least three years from the date you received that version of Loft.
Write to loft@abishevs.dev.
You may also modify Loft for your own use and reverse engineer it to debug such modifications, as section 6 of the LGPL requires.
## Using a modified FFmpeg
- Modify the FFmpeg source, keeping the interface Loft uses. List it with
nm -u <Loft binary> | grep ' _av'.
- Run
build-ffmpeg.sh. It needs Xcode, and producesCFFmpeg.xcframework. - On a Mac, replace
Loft.app/Contents/Frameworks/CFFmpeg.frameworkwith your build and
re-sign the app: codesign --force --deep --sign <your identity> Loft.app.
- On iPhone or iPad, replace
Payload/Loft.app/Frameworks/CFFmpeg.frameworkinside the
app package and re-sign it with your own Apple developer certificate. iOS does not run apps that are not signed.