Skip to content

Commit

Permalink
[ffmpeg] Add iconv, fdk-aac, mp3lame, opus, soxr, theora support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Jul 28, 2020
1 parent 8f5de7d commit fbc0237
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 60 deletions.
5 changes: 4 additions & 1 deletion ports/ffmpeg/0007-fix-lib-naming.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ diff --git a/configure b/configure
index d6c4388..75b96c3 100644
--- a/configure
+++ b/configure
@@ -4378,6 +4378,7 @@ msvc_common_flags(){
@@ -4378,6 +4378,10 @@ msvc_common_flags(){
-march=*) ;;
-lz) echo zlib.lib ;;
+ -lzd) echo zlibd.lib ;;
-lx264) echo libx264.lib ;;
+ -lx265) echo libx265.lib ;;
+ -lmp3lame) echo libmp3lame.lib ;;
+ -liconv) echo libiconv.lib ;;
-lstdc++) ;;
-l*) echo ${flag#-l}.lib ;;
-LARGEADDRESSAWARE) echo $flag ;;
78 changes: 51 additions & 27 deletions ports/ffmpeg/CONTROL
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,73 @@ Description: ffplay appplication support in ffmpeg
Feature: ffprobe
Description: ffprobe appplication support in ffmpeg

Feature: openssl
Build-Depends: openssl, ffmpeg[nonfree]
Description: openssl support in ffmpeg
Feature: avresample
Description: Libav audio resampling library support in ffmpeg

Feature: lzma
Build-Depends: liblzma
Description: lzma support in ffmpeg
Feature: nonfree
Description: allow nonfree and unredistributable libraries

Feature: gpl
Description: allow GPL licensed libraries

Feature: version3
Description: upgrade (L)GPL to version 3

Feature: avisynthplus
Build-Depends: avisynthplus, ffmpeg[gpl]
Description: avisynthplus support in ffmpeg

Feature: bzip2
Build-Depends: bzip2
Description: bzip2 support in ffmpeg

Feature: vpx
Build-Depends: libvpx
Description: WebM VP8/VP9 support in ffmpeg
Feature: iconv
Build-Depends: libiconv
Description: iconv support in ffmpeg

Feature: x264
Build-Depends: x264, ffmpeg[gpl]
Description: x264 support in ffmpeg
Feature: fdk-aac
Build-Depends: fdk-aac, ffmpeg[nonfree]
Description: AAC de/encoding via libfdk-aac support in ffmpeg

Feature: lzma
Build-Depends: liblzma
Description: lzma support in ffmpeg

Feature: mp3lame
Build-Depends: mp3lame
Description: MP3 encoding via libmp3lame support in ffmpeg

Feature: nvcodec
Build-Depends: ffnvcodec, cuda
Description: Hardware accelerated codecs

Feature: opencl
Build-Depends: opencl
Description: opencl support in ffmpeg
Description: OpenCL processing support in ffmpeg

Feature: nonfree
Description: allow nonfree and unredistributable libraries
Feature: openssl
Build-Depends: openssl, ffmpeg[nonfree]
Description: openssl support in ffmpeg

Feature: gpl
Description: allow GPL licensed libraries
Feature: opus
Build-Depends: opus
Description: Opus de/encoding via libopus support in ffmpeg

Feature: version3
Description: upgrade (L)GPL to version 3
Feature: soxr
Build-Depends: soxr
Description: libsoxr resampling support in ffmpeg

Feature: avresample
Description: Libav audio resampling library support in ffmpeg
Feature: theora
Build-Depends: libtheora
Description: Theora encoding via libtheora support in ffmpeg

Feature: nvcodec
Build-Depends: ffnvcodec, cuda
Description: Hardware accelerated codecs
Feature: vpx
Build-Depends: libvpx
Description: VP8 and VP9 de/encoding via libvpx support in ffmpeg

Feature: avisynthplus
Build-Depends: avisynthplus, ffmpeg[gpl]
Description: avisynthplus support in ffmpeg
Feature: x264
Build-Depends: x264, ffmpeg[gpl]
Description: H.264 encoding via x264 support in ffmpeg

Feature: zlib
Build-Depends: zlib
Expand Down
100 changes: 68 additions & 32 deletions ports/ffmpeg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ if(VCPKG_TARGET_IS_WINDOWS)
set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh)

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make pkg-config)
else()
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make pkg-config)
endif()

set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
Expand Down Expand Up @@ -70,12 +70,6 @@ if("version3" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-version3")
endif()

if("openssl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-openssl")
else()
set(OPTIONS "${OPTIONS} --disable-openssl")
endif()

if("ffmpeg" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-ffmpeg")
else()
Expand All @@ -94,22 +88,34 @@ else()
set(OPTIONS "${OPTIONS} --disable-ffprobe")
endif()

if("vpx" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libvpx")
if("avresample" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avresample")
endif()

if("avisynthplus" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avisynth")
else()
set(OPTIONS "${OPTIONS} --disable-libvpx")
set(OPTIONS "${OPTIONS} --disable-avisynth")
endif()

if("x264" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libx264")
set (ENABLE_BZIP2 OFF)
if("bzip2" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-bzlib")
set (ENABLE_BZIP2 ON) #necessary for configuring FFMPEG CMake Module
else()
set(OPTIONS "${OPTIONS} --disable-libx264")
set(OPTIONS "${OPTIONS} --disable-bzlib")
endif()

if("opencl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-opencl")
if("iconv" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-iconv")
else()
set(OPTIONS "${OPTIONS} --disable-opencl")
set(OPTIONS "${OPTIONS} --disable-iconv")
endif()

if("fdk-aac" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libfdk-aac")
else()
set(OPTIONS "${OPTIONS} --disable-libfdk-aac")
endif()

set (ENABLE_LZMA OFF)
Expand All @@ -120,32 +126,58 @@ else()
set(OPTIONS "${OPTIONS} --disable-lzma")
endif()

set (ENABLE_BZIP2 OFF)
if("bzip2" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-bzlib")
set (ENABLE_BZIP2 ON) #necessary for configuring FFMPEG CMake Module
if("mp3lame" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libmp3lame")
else()
set(OPTIONS "${OPTIONS} --disable-bzlib")
set(OPTIONS "${OPTIONS} --disable-libmp3lame")
endif()

if("avresample" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avresample")
if("nvcodec" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-cuvid --disable-libnpp")
else()
set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp")
endif()

if (VCPKG_TARGET_IS_OSX)
set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX
if("opencl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-opencl")
else()
set(OPTIONS "${OPTIONS} --disable-opencl")
endif()

if("nvcodec" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-cuvid --disable-libnpp")
if("openssl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-openssl")
else()
set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp")
set(OPTIONS "${OPTIONS} --disable-openssl")
endif()

if("avisynthplus" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avisynth")
if("opus" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libopus")
else()
set(OPTIONS "${OPTIONS} --disable-avisynth")
set(OPTIONS "${OPTIONS} --disable-libopus")
endif()

if("soxr" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libsoxr")
else()
set(OPTIONS "${OPTIONS} --disable-libsoxr")
endif()

if("theora" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libtheora")
else()
set(OPTIONS "${OPTIONS} --disable-libtheora")
endif()

if("vpx" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libvpx")
else()
set(OPTIONS "${OPTIONS} --disable-libvpx")
endif()

if("x264" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libx264")
else()
set(OPTIONS "${OPTIONS} --disable-libx264")
endif()

if("zlib" IN_LIST FEATURES)
Expand All @@ -154,6 +186,10 @@ else()
set(OPTIONS "${OPTIONS} --disable-zlib")
endif()

if (VCPKG_TARGET_IS_OSX)
set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX
endif()

set(OPTIONS_CROSS "")

if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
Expand Down

0 comments on commit fbc0237

Please sign in to comment.