Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 0b2a115

Browse files
committed
add support for zimg openssl and srt, fixes #28 and #241
1 parent 38d88e0 commit 0b2a115

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+653
-267
lines changed

README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -137,25 +137,25 @@ indicates that `FFmpeg` source code is cloned from the `FFmpeg` `master` branch.
137137

138138
This table shows the differences between two variants.
139139

140-
| | Main Release | LTS Release |
141-
| :----: | :----: | :----: |
142-
| Android API Level | 24 | 16 |
143-
| Android Camera Access | Yes | - |
140+
| | Main Release | LTS Release |
141+
| :----: | :----: |:---------------------------------------------------------:|
142+
| Android API Level | 24 | 16 |
143+
| Android Camera Access | Yes | - |
144144
| Android Architectures | arm-v7a-neon<br/>arm64-v8a<br/>x86<br/>x86-64 | arm-v7a<br/>arm-v7a-neon<br/>arm64-v8a<br/>x86<br/>x86-64 |
145-
| iOS Min SDK | 12.1 | 9.3 |
146-
| iOS VideoToolbox | Yes | - |
147-
| iOS AVFoundation | Yes | - |
148-
| iOS Architectures | arm64<br/>arm64-simulator<br/>arm64-mac-catalyst<br/>x86-64<br/>x86-64-mac-catalyst | armv7<br/>arm64<br/>i386<br/>x86-64 |
149-
| iOS Bundle Format | XCFrameworks | Frameworks |
150-
| Mac Catalyst Min Version | 14.0 | - |
151-
| macOS Min SDK | 10.15 | 10.11 |
152-
| macOS AVFoundation | Yes | - |
153-
| macOS Architectures | arm64<br/>x86-64 | x86-64 |
154-
| macOS Bundle Format | XCFrameworks | Frameworks |
155-
| tvOS Min SDK | 11.0 | 9.2 |
156-
| tvOS VideoToolbox | Yes | - |
157-
| tvOS Architectures | arm64<br/>x86-64<br/>arm64-simulator | arm64<br/>x86-64 |
158-
| tvOS Bundle Format | XCFrameworks | Frameworks |
145+
| iOS Min SDK | 12.1 | 10 |
146+
| iOS VideoToolbox | Yes | - |
147+
| iOS AVFoundation | Yes | - |
148+
| iOS Architectures | arm64<br/>arm64-simulator<br/>arm64-mac-catalyst<br/>x86-64<br/>x86-64-mac-catalyst | armv7<br/>arm64<br/>i386<br/>x86-64 |
149+
| iOS Bundle Format | XCFrameworks | Frameworks |
150+
| Mac Catalyst Min Version | 14.0 | - |
151+
| macOS Min SDK | 10.15 | 10.12 |
152+
| macOS AVFoundation | Yes | - |
153+
| macOS Architectures | arm64<br/>x86-64 | x86-64 |
154+
| macOS Bundle Format | XCFrameworks | Frameworks |
155+
| tvOS Min SDK | 11.0 | 10.0 |
156+
| tvOS VideoToolbox | Yes | - |
157+
| tvOS Architectures | arm64<br/>x86-64<br/>arm64-simulator | arm64<br/>x86-64 |
158+
| tvOS Bundle Format | XCFrameworks | Frameworks |
159159

160160
### 11. Documentation
161161

android.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fi
138138

139139
# PROCESS FULL OPTION AS LAST OPTION
140140
if [[ -n ${BUILD_FULL} ]]; then
141-
for library in {0..58}; do
141+
for library in {0..61}; do
142142
if [ ${GPL_ENABLED} == "yes" ]; then
143143
enable_library "$(get_library_name $library)" 1
144144
else
@@ -214,7 +214,7 @@ for run_arch in {0..12}; do
214214
. "${BASEDIR}"/scripts/main-android.sh "${ENABLED_LIBRARIES[@]}" || exit 1
215215

216216
# CLEAR FLAGS
217-
for library in {0..58}; do
217+
for library in {0..61}; do
218218
library_name=$(get_library_name ${library})
219219
unset "$(echo "OK_${library_name}" | sed "s/\-/\_/g")"
220220
unset "$(echo "DEPENDENCY_REBUILT_${library_name}" | sed "s/\-/\_/g")"
@@ -272,7 +272,7 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then
272272
# COPY LICENSES
273273
LICENSE_BASEDIR="${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/res/raw
274274
rm -f "${LICENSE_BASEDIR}"/*.txt 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
275-
for library in {0..46}; do
275+
for library in {0..49}; do
276276
if [[ ${ENABLED_LIBRARIES[$library]} -eq 1 ]]; then
277277
ENABLED_LIBRARY=$(get_library_name ${library} | sed 's/-/_/g')
278278
LICENSE_FILE="${LICENSE_BASEDIR}/license_${ENABLED_LIBRARY}.txt"

apple.sh

+5-41
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,18 @@ After that this script should be used to create an umbrella xcframework.\n"
6363
echo -e " --enable-libxml2\t\tbuild umbrella xcframework for libxml2 [no]"
6464
echo -e " --enable-opencore-amr\t\tbuild umbrella xcframework for opencore-amr [no]"
6565
echo -e " --enable-openh264\t\tbuild umbrella xcframework for openh264 [no]"
66+
echo -e " --enable-openssl\t\tbuild umbrella xcframework for openssl [no]"
6667
echo -e " --enable-opus\t\t\tbuild umbrella xcframework for opus [no]"
6768
echo -e " --enable-sdl\t\t\tbuild umbrella xcframework for sdl [no]"
6869
echo -e " --enable-shine\t\tbuild umbrella xcframework for shine [no]"
6970
echo -e " --enable-snappy\t\tbuild umbrella xcframework for snappy [no]"
7071
echo -e " --enable-soxr\t\t\tbuild umbrella xcframework for soxr [no]"
7172
echo -e " --enable-speex\t\tbuild umbrella xcframework for speex [no]"
73+
echo -e " --enable-srt\t\t\tbuild umbrella xcframework for srt [no]"
7274
echo -e " --enable-tesseract\t\tbuild umbrella xcframework for tesseract [no]"
7375
echo -e " --enable-twolame\t\tbuild umbrella xcframework for twolame [no]"
74-
echo -e " --enable-vo-amrwbenc\t\tbuild umbrella xcframework for vo-amrwbenc [no]\n"
76+
echo -e " --enable-vo-amrwbenc\t\tbuild umbrella xcframework for vo-amrwbenc [no]"
77+
echo -e " --enable-zimg\t\t\tbuild umbrella xcframework for zimg [no]\n"
7578

7679
echo -e "GPL libraries:"
7780
echo -e " --enable-libvidstab\t\tbuild umbrella xcframework for libvidstab [no]"
@@ -244,7 +247,7 @@ done
244247

245248
# PROCESS FULL OPTION AS LAST OPTION
246249
if [[ -n ${BUILD_FULL} ]]; then
247-
for library in {0..58}; do
250+
for library in {0..61}; do
248251
if [ ${GPL_ENABLED} == "yes" ]; then
249252
set_library "$(get_library_name "$library")" 1
250253
else
@@ -309,45 +312,6 @@ if [[ -n ${TARGET_ARCHITECTURE_VARIANT_INDEX_ARRAY[0]} ]]; then
309312
# INITIALIZE TARGET FOLDERS
310313
initialize_prebuilt_umbrella_xcframework_folders
311314

312-
# BUILD XCFRAMEWORKS FOR ENABLED LIBRARIES ON ENABLED ARCHITECTURE VARIANTS
313-
for library in {0..46}; do
314-
if [[ ${ENABLED_LIBRARIES[${library}]} -eq 1 ]]; then
315-
316-
if [[ ${LIBRARY_LIBTHEORA} == "${library}" ]]; then
317-
318-
create_umbrella_xcframework "libtheora"
319-
create_umbrella_xcframework "libtheoraenc"
320-
create_umbrella_xcframework "libtheoradec"
321-
322-
elif [[ ${LIBRARY_LIBVORBIS} == "${library}" ]]; then
323-
324-
create_umbrella_xcframework "libvorbisfile"
325-
create_umbrella_xcframework "libvorbisenc"
326-
create_umbrella_xcframework "libvorbis"
327-
328-
elif [[ ${LIBRARY_LIBWEBP} == "${library}" ]]; then
329-
330-
create_umbrella_xcframework "libwebpmux"
331-
create_umbrella_xcframework "libwebpdemux"
332-
create_umbrella_xcframework "libwebp"
333-
334-
elif [[ ${LIBRARY_OPENCOREAMR} == "${library}" ]]; then
335-
336-
create_umbrella_xcframework "libopencore-amrnb"
337-
338-
elif [[ ${LIBRARY_NETTLE} == "${library}" ]]; then
339-
340-
create_umbrella_xcframework "libnettle"
341-
create_umbrella_xcframework "libhogweed"
342-
343-
else
344-
345-
create_umbrella_xcframework "$(get_static_archive_name "${library}")"
346-
347-
fi
348-
fi
349-
done
350-
351315
for FFMPEG_LIB in "${FFMPEG_LIBS[@]}"; do
352316
create_umbrella_xcframework "${FFMPEG_LIB}"
353317
done

apple/README.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@
22

33
### 1. Features
44
#### 1.1 iOS
5-
- Supports `iOS SDK 12.1+` on Main releases and `iOS SDK 9.3+` on LTS releases
5+
- Supports `iOS SDK 12.1+` on Main releases and `iOS SDK 10+` on LTS releases
66
- Includes `armv7`, `armv7s`, `arm64`, `arm64-simulator`, `arm64e`, `i386`, `x86_64`, `x86_64-mac-catalyst` and
77
`arm64-mac-catalyst` architectures
88
- Objective-C API
99
- Camera access
1010
- `ARC` enabled library
1111
- Built with `-fembed-bitcode` flag
12-
- Creates static `frameworks`, static `xcframeworks` and static `universal (fat)` libraries (.a)
12+
- Creates shared `frameworks` and `xcframeworks`
1313

1414
#### 1.2 macOS
15-
- Supports `macOS SDK 10.15+` on Main releases and `macOS SDK 10.11+` on LTS releases
15+
- Supports `macOS SDK 10.15+` on Main releases and `macOS SDK 10.12+` on LTS releases
1616
- Includes `arm64` and `x86_64` architectures
1717
- Objective-C API
1818
- Camera access
1919
- `ARC` enabled library
2020
- Built with `-fembed-bitcode` flag
21-
- Creates static `frameworks`, static `xcframeworks` and static `universal (fat)` libraries (.a)
21+
- Creates shared `frameworks` and `xcframeworks`
2222

2323
#### 1.3 tvOS
24-
- Supports `tvOS SDK 10.2+` on Main releases and `tvOS SDK 9.2+` on LTS releases
24+
- Supports `tvOS SDK 11.0+` on Main releases and `tvOS SDK 10.0+` on LTS releases
2525
- Includes `arm64`, `arm64-simulator` and `x86_64` architectures
2626
- Objective-C API
2727
- `ARC` enabled library
2828
- Built with `-fembed-bitcode` flag
29-
- Creates static `frameworks`, static `xcframeworks` and static `universal (fat)` libraries (.a)
29+
- Creates shared `frameworks` and `xcframeworks`
3030

3131
### 2. Building
3232

33-
Run `ios.sh`/`macos.sh`/`tvos.sh` at project root directory to build `ffmpeg-kit` and `ffmpeg` static libraries for a
34-
platform.
33+
Run `ios.sh`/`macos.sh`/`tvos.sh` inside the project root to build `ffmpeg-kit` and `ffmpeg` shared libraries
34+
for a platform.
3535

3636
Optionally, use `apple.sh` to combine bundles created by these three scripts in a single bundle.
3737

@@ -45,20 +45,20 @@ Please note that `FFmpegKit` project repository includes the source code of `FFm
4545

4646
##### 2.1.1 iOS
4747

48-
- **Xcode 7.3.1** or later
49-
- **iOS SDK 9.3** or later
48+
- **Xcode 8.0** or later
49+
- **iOS SDK 10** or later
5050
- **Command Line Tools**
5151

5252
##### 2.1.2 macOS
5353

54-
- **Xcode 7.3.1** or later
55-
- **macOS SDK 10.11** or later
54+
- **Xcode 8.0** or later
55+
- **macOS SDK 10.12** or later
5656
- **Command Line Tools**
5757

5858
##### 2.1.3 tvOS
5959

60-
- **Xcode 7.3.1** or later
61-
- **tvOS SDK 9.2** or later
60+
- **Xcode 8.0** or later
61+
- **tvOS SDK 10.0** or later
6262
- **Command Line Tools**
6363

6464
##### 2.1.4 Packages

ios.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ done
144144

145145
# PROCESS FULL OPTION AS LAST OPTION
146146
if [[ -n ${BUILD_FULL} ]]; then
147-
for library in {0..58}; do
147+
for library in {0..61}; do
148148
if [ ${GPL_ENABLED} == "yes" ]; then
149149
enable_library "$(get_library_name "$library")" 1
150150
else
@@ -240,7 +240,7 @@ for run_arch in {0..12}; do
240240
TARGET_ARCH_LIST+=("${FULL_ARCH}")
241241

242242
# CLEAR FLAGS
243-
for library in {0..58}; do
243+
for library in {0..61}; do
244244
library_name=$(get_library_name "${library}")
245245
unset "$(echo "OK_${library_name}" | sed "s/\-/\_/g")"
246246
unset "$(echo "DEPENDENCY_REBUILT_${library_name}" | sed "s/\-/\_/g")"

macos.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ done
139139

140140
# PROCESS FULL OPTION AS LAST OPTION
141141
if [[ -n ${BUILD_FULL} ]]; then
142-
for library in {0..58}; do
142+
for library in {0..61}; do
143143
if [ ${GPL_ENABLED} == "yes" ]; then
144144
enable_library "$(get_library_name "$library")" 1
145145
else
@@ -209,7 +209,7 @@ for run_arch in {0..12}; do
209209
TARGET_ARCH_LIST+=("${FULL_ARCH}")
210210

211211
# CLEAR FLAGS
212-
for library in {0..58}; do
212+
for library in {0..61}; do
213213
library_name=$(get_library_name "${library}")
214214
unset "$(echo "OK_${library_name}" | sed "s/\-/\_/g")"
215215
unset "$(echo "DEPENDENCY_REBUILT_${library_name}" | sed "s/\-/\_/g")"

scripts/android/ffmpeg.sh

+23-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ CONFIGURE_POSTFIX=""
7272
HIGH_PRIORITY_INCLUDES=""
7373

7474
# SET CONFIGURE OPTIONS
75-
for library in {1..58}; do
75+
for library in {1..62}; do
7676
if [[ ${!library} -eq 1 ]]; then
7777
ENABLED_LIBRARY=$(get_library_name $((library - 1)))
7878

@@ -194,6 +194,11 @@ for library in {1..58}; do
194194
LDFLAGS+=" $(pkg-config --libs --static openh264 2>>"${BASEDIR}"/build.log)"
195195
CONFIGURE_POSTFIX+=" --enable-libopenh264"
196196
;;
197+
openssl)
198+
CFLAGS+=" $(pkg-config --cflags openssl 2>>"${BASEDIR}"/build.log)"
199+
LDFLAGS+=" $(pkg-config --libs --static openssl 2>>"${BASEDIR}"/build.log)"
200+
CONFIGURE_POSTFIX+=" --enable-openssl"
201+
;;
197202
opus)
198203
CFLAGS+=" $(pkg-config --cflags opus 2>>"${BASEDIR}"/build.log)"
199204
LDFLAGS+=" $(pkg-config --libs --static opus 2>>"${BASEDIR}"/build.log)"
@@ -229,6 +234,11 @@ for library in {1..58}; do
229234
LDFLAGS+=" $(pkg-config --libs --static speex 2>>"${BASEDIR}"/build.log)"
230235
CONFIGURE_POSTFIX+=" --enable-libspeex"
231236
;;
237+
srt)
238+
CFLAGS+=" $(pkg-config --cflags srt 2>>"${BASEDIR}"/build.log)"
239+
LDFLAGS+=" $(pkg-config --libs --static srt 2>>"${BASEDIR}"/build.log)"
240+
CONFIGURE_POSTFIX+=" --enable-libsrt"
241+
;;
232242
tesseract)
233243
CFLAGS+=" $(pkg-config --cflags tesseract 2>>"${BASEDIR}"/build.log)"
234244
LDFLAGS+=" $(pkg-config --libs --static tesseract 2>>"${BASEDIR}"/build.log)"
@@ -261,6 +271,11 @@ for library in {1..58}; do
261271
LDFLAGS+=" $(pkg-config --libs --static xvidcore 2>>"${BASEDIR}"/build.log)"
262272
CONFIGURE_POSTFIX+=" --enable-libxvid --enable-gpl"
263273
;;
274+
zimg)
275+
CFLAGS+=" $(pkg-config --cflags zimg 2>>"${BASEDIR}"/build.log)"
276+
LDFLAGS+=" $(pkg-config --libs --static zimg 2>>"${BASEDIR}"/build.log)"
277+
CONFIGURE_POSTFIX+=" --enable-libzimg"
278+
;;
264279
expat)
265280
CFLAGS+=" $(pkg-config --cflags expat 2>>"${BASEDIR}"/build.log)"
266281
LDFLAGS+=" $(pkg-config --libs --static expat 2>>"${BASEDIR}"/build.log)"
@@ -302,6 +317,8 @@ for library in {1..58}; do
302317
CONFIGURE_POSTFIX+=" --disable-zlib"
303318
elif [[ ${library} -eq $((LIBRARY_ANDROID_MEDIA_CODEC + 1)) ]]; then
304319
CONFIGURE_POSTFIX+=" --disable-mediacodec"
320+
elif [[ ${library} -eq $((LIBRARY_OPENSSL + 1)) ]]; then
321+
CONFIGURE_POSTFIX+=" --disable-openssl"
305322
fi
306323
fi
307324
done
@@ -394,25 +411,27 @@ fi
394411
--enable-version3 \
395412
--arch="${TARGET_ARCH}" \
396413
--cpu="${TARGET_CPU}" \
414+
--target-os=android \
415+
${ASM_OPTIONS} \
416+
--ar="${AR}" \
397417
--cc="${CC}" \
398418
--cxx="${CXX}" \
399419
--ranlib="${RANLIB}" \
400420
--strip="${STRIP}" \
401421
--nm="${NM}" \
402422
--extra-libs="$(pkg-config --libs --static cpu-features)" \
403-
--target-os=android \
404-
${ASM_OPTIONS} \
423+
--disable-autodetect \
405424
--enable-cross-compile \
406425
--enable-pic \
407426
--enable-jni \
408427
--enable-optimizations \
409428
--enable-swscale \
410429
${BUILD_LIBRARY_OPTIONS} \
430+
--enable-pthreads \
411431
--enable-v4l2-m2m \
412432
--disable-outdev=fbdev \
413433
--disable-indev=fbdev \
414434
${SIZE_OPTIONS} \
415-
--disable-openssl \
416435
--disable-xmm-clobber-test \
417436
${DEBUG_OPTIONS} \
418437
--disable-neon-clobber-test \

scripts/android/freetype.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ make distclean 2>/dev/null 1>/dev/null
1111
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/builds/unix/configure ]] || [[ ${RECONF_freetype} -eq 1 ]]; then
1212

1313
# NOTE THAT FREETYPE DOES NOT SUPPORT AUTORECONF BUT IT COMES WITH AN autogen.sh
14-
./autogen.sh || return 1
14+
./autogen.sh || exit 1
1515
fi
1616

1717
./configure \

scripts/android/harfbuzz.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ make distclean 2>/dev/null 1>/dev/null
55

66
# REGENERATE BUILD FILES IF NECESSARY OR REQUESTED
77
if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_harfbuzz} -eq 1 ]]; then
8-
NOCONFIGURE=1 ./autogen.sh || return 1
8+
NOCONFIGURE=1 ./autogen.sh || exit 1
99
fi
1010

1111
./configure \

scripts/android/libtheora.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [[ ! -f "${BASEDIR}"/src/"${LIB_NAME}"/configure ]] || [[ ${RECONF_libtheora}
1616
# WORKAROUND NOT TO RUN CONFIGURE AT THE END OF autogen.sh
1717
${SED_INLINE} 's/$srcdir\/configure/#$srcdir\/configure/g' "${BASEDIR}"/src/"${LIB_NAME}"/autogen.sh || return 1
1818

19-
./autogen.sh || return 1
19+
./autogen.sh || exit 1
2020
fi
2121

2222
./configure \

0 commit comments

Comments
 (0)