-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build ffmpeg from scratch: from 165MB to 5MB
- Loading branch information
1 parent
0b3adf5
commit c1304dd
Showing
7 changed files
with
57 additions
and
13 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 |
---|---|---|
|
@@ -8,3 +8,4 @@ DerivedData/ | |
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc | ||
builds | ||
scripts/ffmpeg |
Binary file not shown.
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# Define the necessary flags for ARM64 architecture | ||
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) | ||
export MACOSX_DEPLOYMENT_TARGET=$(xcrun --sdk macosx --show-sdk-platform-version) | ||
export CFLAGS="-arch arm64 -isysroot $SDKROOT" | ||
export LDFLAGS="-arch arm64 -isysroot $SDKROOT" | ||
export CC="clang -arch arm64" | ||
|
||
# Clone the FFmpeg repository | ||
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg | ||
cd ffmpeg | ||
|
||
# Configure the build for ARM64 with VideoToolbox support | ||
./configure \ | ||
--prefix=/usr/local \ | ||
--enable-static \ | ||
--disable-shared \ | ||
--disable-everything \ | ||
--disable-xlib \ | ||
--enable-encoder=hevc_videotoolbox,h264_videotoolbox \ | ||
--enable-muxer=mp4 \ | ||
--enable-demuxer=image2pipe \ | ||
--enable-decoder=png \ | ||
--enable-parser=png \ | ||
--enable-protocol=file,pipe,fd \ | ||
--enable-indev=lavfi \ | ||
--enable-filter=scale \ | ||
--enable-bsf=hevc_mp4toannexb \ | ||
--target-os=darwin \ | ||
--arch=arm64 | ||
|
||
# Compile and install | ||
make clean | ||
make && sudo make install |