Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
replace wavpack with dav1d
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed Jan 30, 2021
1 parent 0cc4e89 commit 2fceb5f
Show file tree
Hide file tree
Showing 17 changed files with 184 additions and 120 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FFmpeg kit for applications. Supports Android, iOS, tvOS.
- FFmpeg `v4.4-dev` releases
- 29 external libraries

`chromaprint`, `fontconfig`, `freetype`, `fribidi`, `gmp`, `gnutls`, `kvazaar`, `lame`, `libaom`, `libass`, `libiconv`, `libilbc`, `libtheora`, `libvorbis`, `libvpx`, `libwebp`, `libxml2`, `opencore-amr`, `openh264`, `opus`, `sdl`, `shine`, `snappy`, `soxr`, `speex`, `tesseract`, `twolame`, `vo-amrwbenc`, `wavpack`
`chromaprint`, `fontconfig`, `freetype`, `fribidi`, `gmp`, `gnutls`, `kvazaar`, `lame`, `libaom`, `libass`, `libiconv`, `libilbc`, `libtheora`, `libvorbis`, `libvpx`, `libwebp`, `libxml2`, `opencore-amr`, `openh264`, `opus`, `sdl`, `shine`, `snappy`, `soxr`, `speex`, `tesseract`, `twolame`, `vo-amrwbenc`, `dav1d`

- 5 external libraries with GPL license

Expand All @@ -23,7 +23,7 @@ FFmpeg kit for applications. Supports Android, iOS, tvOS.
- Exposes both FFmpeg library and FFmpegKit wrapper library capabilities
- Includes cross-compile instructions for 48 open-source libraries

`chromaprint`, `expat`, `ffmpeg`, `fontconfig`, `freetype`, `fribidi`, `giflib`, `gmp`, `gnutls`, `harfbuzz`, `kvazaar`, `lame`, `leptonica`, `libaom`, `libass`, `libiconv`, `libilbc`, `libjpeg`, `libjpeg-turbo`, `libogg`, `libpng`, `libsamplerate`, `libsndfile`, `libtheora`, `libuuid`, `libvorbis`, `libvpx`, `libwebp`, `libxml2`, `nettle`, `opencore-amr`, `openh264`, `opus`, `rubberband`, `sdl`, `shine`, `snappy`, `soxr`, `speex`, `tesseract`, `tiff`, `twolame`, `vid.stab`, `vo-amrwbenc`, `wavpack`, `x264`, `x265`, `xvidcore`
`chromaprint`, `expat`, `ffmpeg`, `fontconfig`, `freetype`, `fribidi`, `giflib`, `gmp`, `gnutls`, `harfbuzz`, `kvazaar`, `lame`, `leptonica`, `libaom`, `libass`, `libiconv`, `libilbc`, `libjpeg`, `libjpeg-turbo`, `libogg`, `libpng`, `libsamplerate`, `libsndfile`, `libtheora`, `libuuid`, `libvorbis`, `libvpx`, `libwebp`, `libxml2`, `nettle`, `opencore-amr`, `openh264`, `opus`, `rubberband`, `sdl`, `shine`, `snappy`, `soxr`, `speex`, `tesseract`, `tiff`, `twolame`, `vid.stab`, `vo-amrwbenc`, `dav1d`, `x264`, `x265`, `xvidcore`

- Licensed under LGPL 3.0, can be customized to support GPL v3.0

Expand Down Expand Up @@ -85,10 +85,10 @@ Please remember that some parts of `FFmpeg` are licensed under the `GPL` and onl
<td align="center"><sup>vid.stab</sup><br><sup>x264</sup><br><sup>x265</sup><br><sup>xvidcore</sup></td>
<td align="center"><sup>gmp</sup><br><sup>gnutls</sup></td>
<td align="center"><sup>gmp</sup><br><sup>gnutls</sup><br><sup>vid.stab</sup><br><sup>x264</sup><br><sup>x265</sup><br><sup>xvidcore</sup></td>
<td align="center"><sup>lame</sup><br><sup>libilbc</sup><br><sup>libvorbis</sup><br><sup>opencore-amr</sup><br><sup>opus</sup><br><sup>shine</sup><br><sup>soxr</sup><br><sup>speex</sup><br><sup>twolame</sup><br><sup>vo-amrwbenc</sup><br><sup>wavpack</sup></td>
<td align="center"><sup>lame</sup><br><sup>libilbc</sup><br><sup>libvorbis</sup><br><sup>opencore-amr</sup><br><sup>opus</sup><br><sup>shine</sup><br><sup>soxr</sup><br><sup>speex</sup><br><sup>twolame</sup><br><sup>vo-amrwbenc</sup><br><sup>dav1d</sup></td>
<td align="center"><sup>fontconfig</sup><br><sup>freetype</sup><br><sup>fribidi</sup><br><sup>kvazaar</sup><br><sup>libaom</sup><br><sup>libass</sup><br><sup>libiconv</sup><br><sup>libtheora</sup><br><sup>libvpx</sup><br><sup>libwebp</sup><br><sup>snappy</sup></td>
<td align="center"><sup>fontconfig</sup><br><sup>freetype</sup><br><sup>fribidi</sup><br><sup>gmp</sup><br><sup>gnutls</sup><br><sup>kvazaar</sup><br><sup>lame</sup><br><sup>libaom</sup><br><sup>libass</sup><br><sup>libiconv</sup><br><sup>libilbc</sup><br><sup>libtheora</sup><br><sup>libvorbis</sup><br><sup>libvpx</sup><br><sup>libwebp</sup><br><sup>libxml2</sup><br><sup>opencore-amr</sup><br><sup>opus</sup><br><sup>shine</sup><br><sup>snappy</sup><br><sup>soxr</sup><br><sup>speex</sup><br><sup>twolame</sup><br><sup>vo-amrwbenc</sup><br><sup>wavpack</sup></td>
<td align="center"><sup>fontconfig</sup><br><sup>freetype</sup><br><sup>fribidi</sup><br><sup>gmp</sup><br><sup>gnutls</sup><br><sup>kvazaar</sup><br><sup>lame</sup><br><sup>libaom</sup><br><sup>libass</sup><br><sup>libiconv</sup><br><sup>libilbc</sup><br><sup>libtheora</sup><br><sup>libvorbis</sup><br><sup>libvpx</sup><br><sup>libwebp</sup><br><sup>libxml2</sup><br><sup>opencore-amr</sup><br><sup>opus</sup><br><sup>shine</sup><br><sup>snappy</sup><br><sup>soxr</sup><br><sup>speex</sup><br><sup>twolame</sup><br><sup>vid.stab</sup><br><sup>vo-amrwbenc</sup><br><sup>wavpack</sup><br><sup>x264</sup><br><sup>x265</sup><br><sup>xvidcore</sup></td>
<td align="center"><sup>fontconfig</sup><br><sup>freetype</sup><br><sup>fribidi</sup><br><sup>gmp</sup><br><sup>gnutls</sup><br><sup>kvazaar</sup><br><sup>lame</sup><br><sup>libaom</sup><br><sup>libass</sup><br><sup>libiconv</sup><br><sup>libilbc</sup><br><sup>libtheora</sup><br><sup>libvorbis</sup><br><sup>libvpx</sup><br><sup>libwebp</sup><br><sup>libxml2</sup><br><sup>opencore-amr</sup><br><sup>opus</sup><br><sup>shine</sup><br><sup>snappy</sup><br><sup>soxr</sup><br><sup>speex</sup><br><sup>twolame</sup><br><sup>vo-amrwbenc</sup><br><sup>dav1d</sup></td>
<td align="center"><sup>fontconfig</sup><br><sup>freetype</sup><br><sup>fribidi</sup><br><sup>gmp</sup><br><sup>gnutls</sup><br><sup>kvazaar</sup><br><sup>lame</sup><br><sup>libaom</sup><br><sup>libass</sup><br><sup>libiconv</sup><br><sup>libilbc</sup><br><sup>libtheora</sup><br><sup>libvorbis</sup><br><sup>libvpx</sup><br><sup>libwebp</sup><br><sup>libxml2</sup><br><sup>opencore-amr</sup><br><sup>opus</sup><br><sup>shine</sup><br><sup>snappy</sup><br><sup>soxr</sup><br><sup>speex</sup><br><sup>twolame</sup><br><sup>vid.stab</sup><br><sup>vo-amrwbenc</sup><br><sup>dav1d</sup><br><sup>x264</sup><br><sup>x265</sup><br><sup>xvidcore</sup></td>
</tr>
<tr>
<td align="center"><sup>android system libraries</sup></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Packages {

static {
supportedExternalLibraries = new ArrayList<>();
supportedExternalLibraries.add("dav1d");
supportedExternalLibraries.add("fontconfig");
supportedExternalLibraries.add("freetype");
supportedExternalLibraries.add("fribidi");
Expand Down Expand Up @@ -59,7 +60,6 @@ class Packages {
supportedExternalLibraries.add("speex");
supportedExternalLibraries.add("tesseract");
supportedExternalLibraries.add("twolame");
supportedExternalLibraries.add("wavpack");
supportedExternalLibraries.add("x264");
supportedExternalLibraries.add("x265");
supportedExternalLibraries.add("xvid");
Expand Down Expand Up @@ -129,7 +129,8 @@ static String getPackageName() {
}

if (fullGpl) {
if (externalLibraryList.contains("fontconfig") &&
if (externalLibraryList.contains("dav1d") &&
externalLibraryList.contains("fontconfig") &&
externalLibraryList.contains("freetype") &&
externalLibraryList.contains("fribidi") &&
externalLibraryList.contains("gmp") &&
Expand All @@ -152,7 +153,6 @@ static String getPackageName() {
externalLibraryList.contains("soxr") &&
externalLibraryList.contains("speex") &&
externalLibraryList.contains("twolame") &&
externalLibraryList.contains("wavpack") &&
externalLibraryList.contains("x264") &&
externalLibraryList.contains("x265") &&
externalLibraryList.contains("xvid")) {
Expand All @@ -163,7 +163,8 @@ static String getPackageName() {
}

if (full) {
if (externalLibraryList.contains("fontconfig") &&
if (externalLibraryList.contains("dav1d") &&
externalLibraryList.contains("fontconfig") &&
externalLibraryList.contains("freetype") &&
externalLibraryList.contains("fribidi") &&
externalLibraryList.contains("gmp") &&
Expand All @@ -184,16 +185,16 @@ static String getPackageName() {
externalLibraryList.contains("snappy") &&
externalLibraryList.contains("soxr") &&
externalLibraryList.contains("speex") &&
externalLibraryList.contains("twolame") &&
externalLibraryList.contains("wavpack")) {
externalLibraryList.contains("twolame")) {
return "full";
} else {
return "custom";
}
}

if (video) {
if (externalLibraryList.contains("fontconfig") &&
if (externalLibraryList.contains("dav1d") &&
externalLibraryList.contains("fontconfig") &&
externalLibraryList.contains("freetype") &&
externalLibraryList.contains("fribidi") &&
externalLibraryList.contains("kvazaar") &&
Expand All @@ -218,8 +219,7 @@ static String getPackageName() {
externalLibraryList.contains("shine") &&
externalLibraryList.contains("soxr") &&
externalLibraryList.contains("speex") &&
externalLibraryList.contains("twolame") &&
externalLibraryList.contains("wavpack")) {
externalLibraryList.contains("twolame")) {
return "audio";
} else {
return "custom";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public void getExternalLibraries() {

final List<String> supportedExternalLibraries = new ArrayList<>();
supportedExternalLibraries.add("chromaprint");
supportedExternalLibraries.add("dav1d");
supportedExternalLibraries.add("fontconfig");
supportedExternalLibraries.add("freetype");
supportedExternalLibraries.add("fribidi");
Expand All @@ -118,7 +119,6 @@ public void getExternalLibraries() {
supportedExternalLibraries.add("speex");
supportedExternalLibraries.add("tesseract");
supportedExternalLibraries.add("twolame");
supportedExternalLibraries.add("wavpack");
supportedExternalLibraries.add("x264");
supportedExternalLibraries.add("x265");
supportedExternalLibraries.add("xvidcore");
Expand Down
4 changes: 2 additions & 2 deletions apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ After that this script should be used to create an umbrella xcframework.\n"
echo -e "Libraries:"
echo -e " --full\t\t\tbuilds umbrella xcframeworks all non-GPL external libraries"
echo -e " --enable-chromaprint\t\tbuild umbrella xcframework for chromaprint [no]"
echo -e " --enable-dav1d\t\tbuild umbrella xcframework for dav1d [no]"
echo -e " --enable-fontconfig\t\tbuild umbrella xcframework for fontconfig [no]"
echo -e " --enable-freetype\t\tbuild umbrella xcframework for freetype [no]"
echo -e " --enable-fribidi\t\tbuild umbrella xcframework for fribidi [no]"
Expand All @@ -70,8 +71,7 @@ After that this script should be used to create an umbrella xcframework.\n"
echo -e " --enable-speex\t\tbuild umbrella xcframework for speex [no]"
echo -e " --enable-tesseract\t\tbuild umbrella xcframework for tesseract [no]"
echo -e " --enable-twolame\t\tbuild umbrella xcframework for twolame [no]"
echo -e " --enable-vo-amrwbenc\t\tbuild umbrella xcframework for vo-amrwbenc [no]"
echo -e " --enable-wavpack\t\tbuild umbrella xcframework for wavpack [no]\n"
echo -e " --enable-vo-amrwbenc\t\tbuild umbrella xcframework for vo-amrwbenc [no]\n"

echo -e "GPL libraries:"
echo -e " --enable-libvidstab\t\tbuild umbrella xcframework for libvidstab [no]"
Expand Down
18 changes: 9 additions & 9 deletions apple/src/FFmpegKitConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ @implementation FFmpegKitConfig

+ (void)initialize {
supportedExternalLibraries = [[NSMutableArray alloc] init];
[supportedExternalLibraries addObject:@"dav1d"];
[supportedExternalLibraries addObject:@"fontconfig"];
[supportedExternalLibraries addObject:@"freetype"];
[supportedExternalLibraries addObject:@"fribidi"];
Expand Down Expand Up @@ -452,7 +453,6 @@ + (void)initialize {
[supportedExternalLibraries addObject:@"speex"];
[supportedExternalLibraries addObject:@"tesseract"];
[supportedExternalLibraries addObject:@"twolame"];
[supportedExternalLibraries addObject:@"wavpack"];
[supportedExternalLibraries addObject:@"x264"];
[supportedExternalLibraries addObject:@"x265"];
[supportedExternalLibraries addObject:@"xvid"];
Expand Down Expand Up @@ -755,7 +755,8 @@ + (NSString*)getPackageName {
}

if (fullGpl) {
if ([enabledLibraryArray containsObject:@"fontconfig"] &&
if ([enabledLibraryArray containsObject:@"dav1d"] &&
[enabledLibraryArray containsObject:@"fontconfig"] &&
[enabledLibraryArray containsObject:@"freetype"] &&
[enabledLibraryArray containsObject:@"fribidi"] &&
[enabledLibraryArray containsObject:@"gmp"] &&
Expand All @@ -779,7 +780,6 @@ + (NSString*)getPackageName {
[enabledLibraryArray containsObject:@"soxr"] &&
[enabledLibraryArray containsObject:@"speex"] &&
[enabledLibraryArray containsObject:@"twolame"] &&
[enabledLibraryArray containsObject:@"wavpack"] &&
[enabledLibraryArray containsObject:@"x264"] &&
[enabledLibraryArray containsObject:@"x265"] &&
[enabledLibraryArray containsObject:@"xvid"]) {
Expand All @@ -790,7 +790,8 @@ + (NSString*)getPackageName {
}

if (full) {
if ([enabledLibraryArray containsObject:@"fontconfig"] &&
if ([enabledLibraryArray containsObject:@"dav1d"] &&
[enabledLibraryArray containsObject:@"fontconfig"] &&
[enabledLibraryArray containsObject:@"freetype"] &&
[enabledLibraryArray containsObject:@"fribidi"] &&
[enabledLibraryArray containsObject:@"gmp"] &&
Expand All @@ -812,16 +813,16 @@ + (NSString*)getPackageName {
[enabledLibraryArray containsObject:@"snappy"] &&
[enabledLibraryArray containsObject:@"soxr"] &&
[enabledLibraryArray containsObject:@"speex"] &&
[enabledLibraryArray containsObject:@"twolame"] &&
[enabledLibraryArray containsObject:@"wavpack"]) {
[enabledLibraryArray containsObject:@"twolame"]) {
return @"full";
} else {
return @"custom";
}
}

if (video) {
if ([enabledLibraryArray containsObject:@"fontconfig"] &&
if ([enabledLibraryArray containsObject:@"dav1d"] &&
[enabledLibraryArray containsObject:@"fontconfig"] &&
[enabledLibraryArray containsObject:@"freetype"] &&
[enabledLibraryArray containsObject:@"fribidi"] &&
[enabledLibraryArray containsObject:@"kvazaar"] &&
Expand All @@ -847,8 +848,7 @@ + (NSString*)getPackageName {
[enabledLibraryArray containsObject:@"shine"] &&
[enabledLibraryArray containsObject:@"soxr"] &&
[enabledLibraryArray containsObject:@"speex"] &&
[enabledLibraryArray containsObject:@"twolame"] &&
[enabledLibraryArray containsObject:@"wavpack"]) {
[enabledLibraryArray containsObject:@"twolame"]) {
return @"audio";
} else {
return @"custom";
Expand Down
27 changes: 27 additions & 0 deletions scripts/android/dav1d.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# SET BUILD FLAGS
CROSS_FILE="${BASEDIR}"/src/"${LIB_NAME}"/package/crossfiles/$ARCH-$FFMPEG_KIT_BUILD_TYPE.meson

create_mason_cross_file "$CROSS_FILE" || return 1

# ALWAYS CLEAN THE PREVIOUS BUILD
rm -rf "${BUILD_DIR}" || return 1

meson "${BUILD_DIR}" \
--cross-file="$CROSS_FILE" \
-Db_lto=true \
-Db_ndebug=false \
-Denable_asm=false \
-Denable_tools=false \
-Denable_examples=false \
-Denable_tests=false || return 1

cd "${BUILD_DIR}" || return 1

ninja -j$(get_cpu_count) || return 1

ninja install || return 1

# MANUALLY COPY PKG-CONFIG FILES
cp "${BUILD_DIR}"/meson-private/dav1d.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1
10 changes: 5 additions & 5 deletions scripts/android/ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ for library in {1..58}; do
exit 1
fi
;;
dav1d)
CFLAGS+=" $(pkg-config --cflags dav1d 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static dav1d 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libdav1d"
;;
fontconfig)
CFLAGS+=" $(pkg-config --cflags fontconfig 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static fontconfig 2>>"${BASEDIR}"/build.log)"
Expand Down Expand Up @@ -241,11 +246,6 @@ for library in {1..58}; do
LDFLAGS+=" $(pkg-config --libs --static vo-amrwbenc 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libvo-amrwbenc"
;;
wavpack)
CFLAGS+=" $(pkg-config --cflags wavpack 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static wavpack 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libwavpack"
;;
x264)
CFLAGS+=" $(pkg-config --cflags x264 2>>"${BASEDIR}"/build.log)"
LDFLAGS+=" $(pkg-config --libs --static x264 2>>"${BASEDIR}"/build.log)"
Expand Down
28 changes: 0 additions & 28 deletions scripts/android/wavpack.sh

This file was deleted.

27 changes: 27 additions & 0 deletions scripts/apple/dav1d.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# SET BUILD FLAGS
CROSS_FILE="${BASEDIR}"/src/"${LIB_NAME}"/package/crossfiles/$ARCH-$FFMPEG_KIT_BUILD_TYPE.meson

create_mason_cross_file "$CROSS_FILE" || return 1

# ALWAYS CLEAN THE PREVIOUS BUILD
rm -rf "${BUILD_DIR}" || return 1

meson "${BUILD_DIR}" \
--cross-file="$CROSS_FILE" \
-Db_lto=false \
-Db_ndebug=false \
-Denable_asm=false \
-Denable_tools=false \
-Denable_examples=false \
-Denable_tests=false || return 1

cd "${BUILD_DIR}" || return 1

ninja -j$(get_cpu_count) || return 1

ninja install || return 1

# MANUALLY COPY PKG-CONFIG FILES
cp "${BUILD_DIR}"/meson-private/dav1d.pc "${INSTALL_PKG_CONFIG_DIR}" || return 1
10 changes: 5 additions & 5 deletions scripts/apple/ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ for library in {1..58}; do
FFMPEG_LDFLAGS+=" $(pkg-config --libs --static libchromaprint 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-chromaprint"
;;
dav1d)
FFMPEG_CFLAGS+=" $(pkg-config --cflags dav1d 2>>"${BASEDIR}"/build.log)"
FFMPEG_LDFLAGS+=" $(pkg-config --libs --static dav1d 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libdav1d"
;;
fontconfig)
FFMPEG_CFLAGS+=" $(pkg-config --cflags fontconfig 2>>"${BASEDIR}"/build.log)"
FFMPEG_LDFLAGS+=" $(pkg-config --libs --static fontconfig 2>>"${BASEDIR}"/build.log)"
Expand Down Expand Up @@ -264,11 +269,6 @@ for library in {1..58}; do
FFMPEG_LDFLAGS+=" $(pkg-config --libs --static vo-amrwbenc 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libvo-amrwbenc"
;;
wavpack)
FFMPEG_CFLAGS+=" $(pkg-config --cflags wavpack 2>>"${BASEDIR}"/build.log)"
FFMPEG_LDFLAGS+=" $(pkg-config --libs --static wavpack 2>>"${BASEDIR}"/build.log)"
CONFIGURE_POSTFIX+=" --enable-libwavpack"
;;
x264)
FFMPEG_CFLAGS+=" $(pkg-config --cflags x264 2>>"${BASEDIR}"/build.log)"
FFMPEG_LDFLAGS+=" $(pkg-config --libs --static x264 2>>"${BASEDIR}"/build.log)"
Expand Down
Loading

0 comments on commit 2fceb5f

Please sign in to comment.