@@ -18,6 +18,7 @@ CONFIGURE_OPTIONS=()
1818NONFREE_AND_GPL=false
1919LATEST=false
2020SHARED_LIBRARIES=false
21+ FREE_AND_GPL=false
2122
2223# Check for Apple Silicon
2324if [[ (" $( uname -m) " == " arm64" ) && (" $OSTYPE " == " darwin" * ) ]]; then
@@ -205,6 +206,7 @@ usage() {
205206 echo " --full-static Build a full static FFmpeg binary (eg. glibc, pthreads etc...) **only Linux**"
206207 echo " Note: Because of the NSS (Name Service Switch), glibc does not recommend static links."
207208 echo " --full-shared Build all shared libraries. Cannot be used with --full-static"
209+ echo " --enable-gpl-and-free Enable GPL but not non-free codecs. Cannot be used with --enable-gpl-and-non-free - https://ffmpeg.org/legal.html"
208210 echo " "
209211}
210212
@@ -248,6 +250,10 @@ while (($# > 0)); do
248250 if [[ " $1 " == " --full-shared" ]]; then
249251 SHARED_LIBRARIES=true
250252 fi
253+ if [[ " $1 " == " --enable-gpl-and-free" ]]; then
254+ CONFIGURE_OPTIONS+=(" --enable-gpl" )
255+ FREE_AND_GPL=true
256+ fi
251257 shift
252258 ;;
253259 * )
@@ -270,6 +276,11 @@ if [[ ($SHARED_LIBRARIES == true) && ($LDEXEFLAGS == true) ]]; then
270276 exit 1
271277fi
272278
279+ if [[ ($NONFREE_AND_GPL == true) && ($FREE_AND_GPL == true) ]]; then
280+ usage
281+ exit 1
282+ fi
283+
273284echo " Using $MJOBS make jobs simultaneously."
274285
275286if $NONFREE_AND_GPL ; then
@@ -284,6 +295,10 @@ if $SHARED_LIBRARIES; then
284295 echo " Building shared libraries."
285296fi
286297
298+ if $FREE_AND_GPL ; then
299+ echo " GPL and free codecs"
300+ fi
301+
287302mkdir -p " $PACKAGES "
288303mkdir -p " $WORKSPACE "
289304
@@ -491,7 +506,7 @@ if command_exists "cargo"; then
491506 CONFIGURE_OPTIONS+=(" --enable-librav1e" )
492507fi
493508
494- if $NONFREE_AND_GPL ; then
509+ if $NONFREE_AND_GPL || $FREE_AND_GPL ; then
495510
496511 if build " x264" " 5db6aa6" ; then
497512 download " https://code.videolan.org/videolan/x264/-/archive/5db6aa6cab1b146e07b60cc1736a01f21da01154/x264-5db6aa6cab1b146e07b60cc1736a01f21da01154.tar.gz" " x264-5db6aa6.tar.gz"
@@ -524,7 +539,7 @@ if $NONFREE_AND_GPL; then
524539 CONFIGURE_OPTIONS+=(" --enable-libx264" )
525540fi
526541
527- if $NONFREE_AND_GPL ; then
542+ if $NONFREE_AND_GPL || $FREE_AND_GPL ; then
528543 if build " x265" " 3.5" ; then
529544 download " https://github.com/videolan/x265/archive/Release_3.5.tar.gz" " x265-3.5.tar.gz" # This is actually 3.4 if looking at x265Version.txt
530545 cd build/linux || exit
@@ -606,7 +621,7 @@ if false; then
606621 CONFIGURE_OPTIONS+=(" --enable-libvpx" )
607622fi
608623
609- if $NONFREE_AND_GPL ; then
624+ if $NONFREE_AND_GPL || $FREE_AND_GPL ; then
610625 if build " xvidcore" " 1.3.7" ; then
611626 download " https://downloads.xvid.com/downloads/xvidcore-1.3.7.tar.gz"
612627 cd build/generic || exit
0 commit comments