-
Notifications
You must be signed in to change notification settings - Fork 1
/
Compiling FFmpeg - OSX.txt
172 lines (135 loc) · 5.1 KB
/
Compiling FFmpeg - OSX.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
****************************************
Compiling FFmpeg On Mac Os X ***********
****************************************
0. Helpfull Resources ******************
https://www.youtube.com/watch?v=-tRh1ThNxoc
https://www.rickmakes.com/compiling-ffmpeg-on-mac-with-apple-silicon-requires-macports/
https://stackoverflow.com/questions/65113600/why-is-ffmpeg-linking-with-too-many-libraries
JUCE Forum
1. Prequisites
Get XCode: AppStore
2. install macports
Goto https://guide.macports.org/, download and install. Which way (pkg, git, etc.) does not matter.
3. install other libraries (codecs, etc.)
sudo port -N install libass libfdk-aac lame libopus libtheora libogg libvorbis libbluray dav1d libmodplug libmodplug librsvg speex x265 XviD libsdl2 gnutls soxr openjpeg
# x264 in GPL only
#sudo port -N install x264
#sudo port -N uninstall x264
discarded: x264
added:
this will take a while.
4. install FFmpeg **********************
Download source code of ffmpeg (bzip2), if not in this project (/ffmpeg/ffmpeg-5.1.2.tar.bz2).
FFmpeg-Version: 5.1.2 "Riemann", http://ffmpeg.org/download.html#get-sources
Copy file to desired directory.
Goto console, then:
# extract source code
tar jxvf ffmpeg-5.1.2.tar.bz2
# go to unpacked directory
cd ffmpeg-5.1.2
# reset everything, when ever you want to reset your configuration, run this
make clean
# configure , this is the most important part. FFmpeg is configured so it has the following features:
# - output shared libraries
# - specific rpath and install_name are set for the resulting libraries
# - FFmpeg is LGPLv3 compliant
# - Support for Apple Things
# - only file protocol
# - no programs, no documentation, no filters, no static builds
# - arm as architecture, use "--arch=x86_64" for intel, don't forget adjust the prefix!
#
# Run one of the following commands:
###################################################################################
#### OSX, arm, "normal" configuration: all decoders, all demuxers, all parsers ####
###################################################################################
./configure --prefix='../../osx_arm' \
--install-name-dir='@executable_path/../libs' \
--extra-cflags=-mmacosx-version-min=10.10 \
--extra-ldflags=-Wl,-rpath,'@executable_path/../libs' \
--cc=/usr/bin/clang \
--disable-filters \
--disable-programs \
--disable-doc \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages \
--enable-version3 \
--disable-static \
--enable-shared \
--enable-avdevice \
--enable-avcodec \
--enable-avformat \
--enable-swresample \
--enable-swscale \
--enable-avfilter \
--disable-libjack \
--disable-libopencore-amrnb \
--disable-libopencore-amrwb \
--disable-libxcb \
--disable-libxcb-shm \
--disable-libxcb-xfixes \
--disable-indev=jack \
--disable-outdev=xv \
--enable-audiotoolbox \
--enable-videotoolbox \
--disable-securetransport \
--enable-pthreads \
--disable-protocols \
--enable-protocol='file'
######################################################################################
#### OSX, x86_64, "normal" configuration: all decoders, all demuxers, all parsers ####
######################################################################################
./configure --prefix='../../osx_x86_64' \
--arch=x86_64 \
--install-name-dir='@executable_path/../libs' \
--extra-cflags=-mmacosx-version-min=10.10 \
--extra-ldflags=-Wl,-rpath,'@executable_path/../libs' \
--cc='clang -arch x86_64' \
--disable-filters \
--disable-programs \
--disable-doc \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages \
--enable-version3 \
--disable-static \
--enable-shared \
--enable-avdevice \
--enable-avcodec \
--enable-avformat \
--enable-swresample \
--enable-swscale \
--enable-avfilter \
--disable-libjack \
--disable-libopencore-amrnb \
--disable-libopencore-amrwb \
--disable-libxcb \
--disable-libxcb-shm \
--disable-libxcb-xfixes \
--disable-indev=jack \
--disable-outdev=xv \
--enable-audiotoolbox \
--enable-videotoolbox \
--disable-securetransport \
--enable-pthreads \
--disable-protocols \
--enable-protocol='file'
discarded: --disable-muxers --disable-decoders --enable-decoder='h264' --disable-demuxers --enable-demuxer='h264,mov' --disable-parsers --enable-parser='aac,h264,mpeg4video,mpegaudio,mpegvideo'
Look for this in configure's output: "License: LGPL version 3 or later"
This means we are save...i guess.
If you see "License: nonfree and unredistributable" or something else, reconfigure
Then run "make -j 12" (faster on M1) or just "make" (normal speed).
This starts compilation.
Then run "make install"
This will copy the necessary files to the given location (--prefix='../../osx_arm')')
If you get a message like this:
install: /opt/local/share/man/man1/ffmpeg.1: Permission denied
make: *** [install-man] Error 71
You can ignore this. Probably man pages were not installed, which is not a problem. If you want them, run
sudo make install
If you get a message like this:
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.
Then install yasm: sudo port -N yasm
copy include directory from unzipped soruce code folder to '../../osx_arm' (the directory where also the libs are)