build(ios): enable h264_videotoolbox HW encoder #32
Workflow file for this run
This file contains hidden or 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
| name: ios build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - '*' | |
| # Homebase fork: this produces the SHIPPED iOS xcframework, so it | |
| # gates PRs (the "iOS" that actually matters). The broader multi-OS | |
| # ios-build-scripts.yml is dispatch-only. | |
| pull_request: | |
| jobs: | |
| build-ios-main-on-macos: | |
| name: ios main | |
| runs-on: macos-15 | |
| strategy: | |
| matrix: | |
| xcode: [ '16.3' ] | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: prerequisites | |
| run: brew install autoconf automake libtool pkg-config curl git doxygen nasm cmake gcc gperf texinfo yasm bison autogen wget gettext meson ninja ragel groff gtk-doc libtasn1 --overwrite | |
| - name: set up xcode | |
| run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh | |
| - name: run the build script | |
| # B3 (size trim): minimal external-library set, matching the | |
| # Android build. chat-kmp needs only libx264 (SW H.264 encode) + | |
| # zlib (PNG/gzip/FFmpeg internals) + native built-in decoders/ | |
| # muxers. Dropped from the prior command: | |
| # --enable-openssl : TLS unused (chat-kmp feeds local files) | |
| # --enable-zimg : high-quality scale unused (-vf scale uses | |
| # libswscale, always built) | |
| # --disable-lib-* : no-ops now (no --full, nothing to disable) | |
| # iOS already used explicit --enable flags (no --full), so the | |
| # --full disable-hang that bit Android never applied here. | |
| # --enable-ios-videotoolbox: h264_videotoolbox HW encoder — 3-10x | |
| # faster than libx264 on device, near-zero CPU/battery. | |
| run: PATH="/usr/local/opt/bison/bin:$PATH" XML_CATALOG_FILES="/usr/local/etc/xml/catalog" ./ios.sh --xcframework --disable-arm64e --enable-gpl --enable-ios-zlib --enable-x264 --enable-ios-videotoolbox | |
| - name: package zip | |
| working-directory: ./prebuilt/bundle-apple-xcframework-ios/ | |
| run: zip -r ffmpegkit-bundled.xcframework.zip * | |
| - name: Upload xcframework as workflow artifact | |
| uses: actions/upload-artifact@v7 | |
| if: ${{ always() }} | |
| with: | |
| name: ffmpegkit-bundled-xcframework | |
| path: prebuilt/bundle-apple-xcframework-ios/ffmpegkit-bundled.xcframework.zip | |
| if-no-files-found: warn | |
| retention-days: 30 | |
| - name: Upload Release Asset (.integrity) | |
| id: upload-release-asset-integrity | |
| uses: ncipollo/release-action@v1 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| allowUpdates: true | |
| artifacts: "prebuilt/bundle-apple-xcframework-ios/ffmpegkit-bundled.xcframework.zip" | |
| omitBodyDuringUpdate: true | |
| omitNameDuringUpdate: true | |
| prerelease: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: print build logs | |
| if: ${{ always() }} | |
| run: cat build.log | |
| - name: print ffbuild logs | |
| if: ${{ failure() }} | |
| run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' | |