Coder Social home page Coder Social logo

kingslay / ffmpegkit Goto Github PK

View Code? Open in Web Editor NEW
96.0 96.0 44.0 554.45 MB

FFmpegKit is a collection of tools to use FFmpeg mpv library in iOS, macOS, tvOS, visionOS applications.

License: GNU General Public License v3.0

Ruby 0.01% Swift 0.16% C 82.07% Objective-C 0.01% C++ 17.75%

ffmpegkit's People

Contributors

karelrooted avatar kingslay avatar skrew avatar zhengbomo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ffmpegkit's Issues

How to use custom FFMPEG 6.1 code?

Hi

We have a forked version of FFMPEG 6.1 with a couple of custom filters and functionalities. We would like to use that version with KSPlayer and FFMPEGKit. Could you point to what steps do you recommend to take to have that FFMPEG version working in this stack? Thanks in advance.

这样编译是不是可以支持KSplayer和MPV两套内核

/// build MPV
swift package --disable-sandbox BuildFFmpeg enable-libdav1d enable-openssl enable-libsrt enable-libfreetype enable-libfribidi enable-harfbuzz enable-libass enable-mpv platforms=ios

我想在播放器里面同时支持两套内核,特定情况下使用MPV播放器。这样编译是不是既提供了ksplayer的依赖支持,又引入了mpv。

Compilation fail because hogweed is missing.

Hi,

Trying to build FFmpeg or SMB with a clean homebrew installation, Xcode 15.1 on a M1 pro max cpu using:

swift package --disable-sandbox BuildFFmpeg enable-FFmpeg platforms=macos or swift package --disable-sandbox BuildFFmpeg enable-nettle enable-gnutls enable-libsmbclient platforms=macos

These 2 commands fail because of hogweed:

FFmpeg while configure:

gcc -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -target arm64-apple-macos10.15 -mmacosx-version-min=10.15 -fno-common -I/Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/thin/arm64/include -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -target arm64-apple-macos10.15 -mmacosx-version-min=10.15 -fno-common -I/Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/thin/arm64/include -c -o /tmp/ffconf.aP7ixkq2/test.o /tmp/ffconf.aP7ixkq2/test.c
gcc -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -target arm64-apple-macos10.15 -L/Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/thin/arm64/lib -lnettle -lhogweed -lc++ -o /tmp/ffconf.aP7ixkq2/test /tmp/ffconf.aP7ixkq2/test.o
ld: library 'hogweed' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When i try to build nettle, gnutls and smbclient:

/usr/bin/make -j8 install environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin:", "CC": "/usr/bin/clang", "CURRENT_ARCH": "x86_64", "CFLAGS": "-arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -target x86_64-apple-macos10.15 -mmacosx-version-min=10.15 -fno-common", "LDFLAGS": "-arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -target x86_64-apple-macos10.15", "CXX": "/usr/bin/clang++", "LC_CTYPE": "C", "PKG_CONFIG_LIBDIR": "/opt/homebrew/lib/pkgconfig:/opt/homebrew/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/14"] logFile: file:///Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/scratch/x86_64.log/
/usr/bin/lipo -create /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/thin/arm64/lib/libnettle.a /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/thin/x86_64/lib/libnettle.a -output /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/nettle.framework/nettle environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
/usr/bin/xcodebuild -create-xcframework -framework /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/nettle.framework -output /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/../Sources/nettle.xcframework environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
xcframework successfully written out to: /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/Sources/nettle.xcframework
/usr/bin/lipo -create /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/thin/arm64/lib/libhogweed.dylib /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/thin/x86_64/lib/libhogweed.dylib -output /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/hogweed.framework/hogweed environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: /Users/skrew/Sources/libs/FFmpegKit/FFmpegKit/.Script/nettle/macos/thin/arm64/lib/libhogweed.dylib (No such file or directory)

Anyone met this error: Could not resolve host: github.com when executing git clone source code command

@kingslay , stupid question but, when building with swift package BuildFFmpeg I met this error:

/usr/bin/git clone --depth 1 --branch n6.0 https://github.com/FFmpeg/FFmpeg /Users/0x67/Documents/projects/FFmpegKit/.Script/FFmpeg-n6.0 environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
Cloning into '\''/Users/0x67/Documents/projects/FFmpegKit/.Script/FFmpeg-n6.0'\''...
fatal: unable to access '\''https://github.com/FFmpeg/FFmpeg/'\'': Could not resolve host: github.com
BuildFFmpeg/main.swift:252: Fatal error: '\''try!'\'' expression unexpectedly raised an error: Error Domain=fail Code=128 "(null)"

I copied the commands and execute them in the terminal, it clones successfully.

编译过程中报错

编译libsmbclient中途报这个错误,我用的是M1芯片的MacBook
--without-ldb-lmdb implied as this host is not 64-bit
error: Error Domain=fail Code=2 "(null)"

Maybe change meson file

I don't know which version is correct but i'm using an improved version of meson file in my copy.

I think we can use your format for cflags but meson subsystem needs to be updated
https://mesonbuild.com/Reference-tables.html#subsystem-names-since-120

        var mesonSubSystem: String {
            switch self {
            case .isimulator:
                return "ios-simulator"
            case .tvsimulator:
                return "tvos-simulator"
            default:
                return rawValue
            }
        }
        let content = """
        [binaries]
        c = '/usr/bin/clang'
        cpp = '/usr/bin/clang++'
        objc = '/usr/bin/clang'
        objcpp = '/usr/bin/clang++'
        nm = '\(platform.xcrunFind(tool: "nm"))'
        ar = '\(platform.xcrunFind(tool: "ar"))'
        strip = '\(platform.xcrunFind(tool: "strip"))'
        pkgconfig = 'pkg-config'

        [properties]
        has_function_printf = true
        has_function_hfkerhisadf = false

        [host_machine]
        system = 'darwin'
        subsystem = '\(platform.mesonSubSystem)'
        kernel = 'xnu'
        cpu_family = '\(arch.cpuFamily)'
        cpu = '\(arch.targetCpu)'
        endian = 'little'

        [built-in options]
        default_library = 'static'
        buildtype = 'release'
        prefix = '\(prefix.path)'
        c_args = '\(cflagsArgs)'
        cpp_args = '\(cflagsArgs)'
        objc_args = '\(cflagsArgs)'
        objcpp_args = '\(cflagsArgs)'
        c_link_args = '\(cflagsArgs)'
        cpp_link_args = '\(cflagsArgs)'
        objc_link_args = '\(cflagsArgs)'
        objcpp_link_args = '\(cflagsArgs)'
        """

Version

Hi;)
Can you please provide new lib version, 6.1.1?

Can't Build

Hi,

It seems this repository change somehow, I can't find the previous issues we've discussed in. Anyway, I can't build. This is an M1 Pro Mac, Xcode 15.0:

➜  swift package --disable-sandbox BuildFFmpeg

error: Unknown subcommand or plugin name ‘BuildFFmpeg’
Usage: swift package <options> <subcommand>
  See 'package -help' for more information.

am I supposed to run this from the root folder? I think I tried all folders.

Compiling doesn't works (error while build libsrt)

Hi,

I try to build my own lib but without success.

It stop while compiling libsrt

Command used:

swift package BuildFFmpeg --disable-sandbox enable-libdav1d enable-openssl enable-libsrt platforms=ios

Stop after:

...
/usr/bin/lipo -create /Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/thin/arm64/lib/Libcrypto.a /Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/thin/arm64e/lib/Libcrypto.a -output /Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/Libcrypto.framework/Libcrypto environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
/usr/bin/xcodebuild -create-xcframework -framework /Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/Libcrypto.framework -framework /Users/skrew/sources/libs/FFmpegKit/Script/openssl/isimulator/Libcrypto.framework -output /Users/skrew/sources/libs/FFmpegKit/Script/../Sources/Libcrypto.xcframework environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
2023-07-18 15:22:04.264 xcodebuild[11130:7294588]  DVTFilePathFSEvents: Failed to start fs event stream.
xcframework successfully written out to: /Users/skrew/sources/libs/FFmpegKit/Sources/Libcrypto.xcframework
/usr/bin/lipo -create /Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/thin/arm64/lib/Libssl.a /Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/thin/arm64e/lib/Libssl.a -output /Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/Libssl.framework/Libssl environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
/usr/bin/xcodebuild -create-xcframework -framework /Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/Libssl.framework -framework /Users/skrew/sources/libs/FFmpegKit/Script/openssl/isimulator/Libssl.framework -output /Users/skrew/sources/libs/FFmpegKit/Script/../Sources/Libssl.xcframework environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
2023-07-18 15:22:05.966 xcodebuild[11137:7294692]  DVTFilePathFSEvents: Failed to start fs event stream.
xcframework successfully written out to: /Users/skrew/sources/libs/FFmpegKit/Sources/Libssl.xcframework
/bin/zsh -c which cmake environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
/usr/local/bin/cmake
/usr/bin/make distclean environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"] url: file:///Users/skrew/sources/libs/FFmpegKit/Script/libsrt/ios/scratch/arm64
make: *** No rule to make target `distclean'.  Stop.
/usr/bin/xcrun --sdk iphoneos --find --show-sdk-path environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk
/usr/bin/xcrun --sdk iphoneos --find --show-sdk-path environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk
/usr/bin/xcrun --sdk iphoneos --find --show-sdk-path environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk
/bin/zsh -c which cmake environment: ["PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin"]
/usr/local/bin/cmake
/usr/local/bin/cmake /Users/skrew/sources/libs/FFmpegKit/Script/libsrt-v1.5.1/CMakeLists.txt -DCMAKE_VERBOSE_MAKEFILE=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_INSTALL_PREFIX=/Users/skrew/sources/libs/FFmpegKit/Script/libsrt/ios/thin/arm64 -Wno-dev -DUSE_ENCLIB=openssl -DENABLE_STDCXX_SYNC=1 -DENABLE_CXX11=1 -DUSE_OPENSSL_PC=1 -DENABLE_DEBUG=0 -DENABLE_LOGGING=0 -DENABLE_HEAVY_LOGGING=0 -DENABLE_APPS=0 -DENABLE_SHARED=0 -DENABLE_MONOTONIC_CLOCK=1 environment: ["CXX": "/usr/bin/clang++", "CXXFLAGS": "-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -target arm64-apple-ios13.0 -mios-version-min=13.0 -fno-common", "CURRENT_ARCH": "arm64", "CFLAGS": "-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -target arm64-apple-ios13.0 -mios-version-min=13.0 -fno-common", "LDFLAGS": "-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -target arm64-apple-ios13.0", "PKG_CONFIG_PATH": "/Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/thin/arm64/lib/pkgconfig:/Users/skrew/sources/libs/FFmpegKit/Script/libdav1d/ios/thin/arm64/lib/pkgconfig:", "PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin", "LC_CTYPE": "C", "CC": "/usr/bin/clang"] url: file:///Users/skrew/sources/libs/FFmpegKit/Script/libsrt/ios/scratch/arm64
/usr/bin/make -j5 environment: ["CXX": "/usr/bin/clang++", "CXXFLAGS": "-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -target arm64-apple-ios13.0 -mios-version-min=13.0 -fno-common", "CURRENT_ARCH": "arm64", "CFLAGS": "-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -target arm64-apple-ios13.0 -mios-version-min=13.0 -fno-common", "LDFLAGS": "-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -target arm64-apple-ios13.0", "PKG_CONFIG_PATH": "/Users/skrew/sources/libs/FFmpegKit/Script/openssl/ios/thin/arm64/lib/pkgconfig:/Users/skrew/sources/libs/FFmpegKit/Script/libdav1d/ios/thin/arm64/lib/pkgconfig:", "PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin", "LC_CTYPE": "C", "CC": "/usr/bin/clang"] url: file:///Users/skrew/sources/libs/FFmpegKit/Script/libsrt/ios/scratch/arm64
make: *** No targets specified and no makefile found.  Stop.
error: Error Domain=fail Code=2 "(null)"

Unable to submit app with FFmpeg

Hi,

It seems I'm having an issue submitting my app after updating to the latest build. Any idea?

 [Application Loader Error Output]: ERROR: [ContentDelivery.Uploader] Asset validation failed (90035) Invalid Signature. Code object is not signed at all. The file at path “PlayerX.app/Frameworks/libass.framework/Libass” is not properly signed. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose “Clean All” in Xcode, delete the “build” directory in the Finder, and rebuild your release target. For more information, please consult https://developer.apple.com/support/code-signing.

Can't build libPNG

Hi,

i cannot build LibPNG using the script, any idea, neither on M1 or on Intel. Any idea ?

ld: building for 'macCatalyst', but linking in object file (Project/FFmpegKit/.Script/png/maccatalyst/scratch/arm64/CMakeFiles/png_shared.dir/arm/filter_neon.S.o) built for 'macOS'

FFmpeg build issue

Using
swift package --disable-sandbox BuildFFmpeg enable-vulkan enable-libplacebo enable-libdav1d enable-openssl enable-libsrt enable-libzvbi enable-png enable-libfreetype enable-libfribidi enable-harfbuzz enable-libass enable-FFmpeg enable-mpv platforms=tvos,tvsimulator

i have an error (libplacebo) while configuring Ffmpeg:

/Users/skrew/Sources/libs/FFmpegKit/.Script/FFmpeg-n6.1/configure --prefix=/Users/skrew/Sources/libs/FFmpegKit/.Script/FFmpeg/tvos/thin/arm64 --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-bzlib --disable-gray --disable-iconv --disable-linux-perf --disable-shared --disable-small --disable-swscale-alpha --disable-symver --disable-xlib --enable-cross-compile --enable-gpl --enable-libxml2 --enable-nonfree --enable-optimizations --enable-pic --enable-runtime-cpudetect --enable-static --enable-thumb --enable-version3 --pkg-config-flags=--static --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-avcodec --enable-avformat --enable-avutil --enable-network --enable-swresample --enable-swscale --disable-devices --disable-outdevs --disable-indevs --disable-postproc --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vdpau --disable-muxers --enable-muxer=flac --enable-muxer=dash --enable-muxer=hevc --enable-muxer=m4v --enable-muxer=matroska --enable-muxer=mov --enable-muxer=mp4 --enable-muxer=mpegts --enable-muxer=webm* --disable-encoders --enable-encoder=aac --enable-encoder=alac --enable-encoder=flac --enable-encoder=pcm* --enable-encoder=movtext --enable-encoder=mpeg4 --enable-encoder=h264_videotoolbox --enable-encoder=hevc_videotoolbox --enable-encoder=prores --enable-encoder=prores_videotoolbox --enable-protocols --disable-demuxers --enable-demuxer=aac --enable-demuxer=ac3 --enable-demuxer=aiff --enable-demuxer=amr --enable-demuxer=ape --enable-demuxer=asf --enable-demuxer=ass --enable-demuxer=av1 --enable-demuxer=avi --enable-demuxer=caf --enable-demuxer=concat --enable-demuxer=dash --enable-demuxer=data --enable-demuxer=dv --enable-demuxer=eac3 --enable-demuxer=flac --enable-demuxer=flv --enable-demuxer=h264 --enable-demuxer=hevc --enable-demuxer=hls --enable-demuxer=live_flv --enable-demuxer=loas --enable-demuxer=m4v --enable-demuxer=matroska --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=mpeg* --enable-demuxer=ogg --enable-demuxer=rm --enable-demuxer=rtsp --enable-demuxer=rtp --enable-demuxer=srt --enable-demuxer=vc1 --enable-demuxer=wav --enable-demuxer=webm_dash_manifest --enable-bsfs --disable-decoders --enable-decoder=av1 --enable-decoder=dca --enable-decoder=dxv --enable-decoder=ffv1 --enable-decoder=ffvhuff --enable-decoder=flv --enable-decoder=h263 --enable-decoder=h263i --enable-decoder=h263p --enable-decoder=h264 --enable-decoder=hap --enable-decoder=hevc --enable-decoder=huffyuv --enable-decoder=indeo5 --enable-decoder=mjpeg --enable-decoder=mjpegb --enable-decoder=mpeg* --enable-decoder=mts2 --enable-decoder=prores --enable-decoder=rv10 --enable-decoder=rv20 --enable-decoder=rv30 --enable-decoder=rv40 --enable-decoder=snow --enable-decoder=svq3 --enable-decoder=tscc --enable-decoder=txd --enable-decoder=wmv1 --enable-decoder=wmv2 --enable-decoder=wmv3 --enable-decoder=vc1 --enable-decoder=vp6 --enable-decoder=vp6a --enable-decoder=vp6f --enable-decoder=vp7 --enable-decoder=vp8 --enable-decoder=vp9 --enable-decoder=aac* --enable-decoder=ac3* --enable-decoder=adpcm* --enable-decoder=alac* --enable-decoder=amr* --enable-decoder=ape --enable-decoder=cook --enable-decoder=dca --enable-decoder=dolby_e --enable-decoder=eac3* --enable-decoder=flac --enable-decoder=mp1* --enable-decoder=mp2* --enable-decoder=mp3* --enable-decoder=opus --enable-decoder=pcm* --enable-decoder=sonic --enable-decoder=truehd --enable-decoder=tta --enable-decoder=vorbis --enable-decoder=wma* --enable-decoder=ass --enable-decoder=ccaption --enable-decoder=dvbsub --enable-decoder=dvdsub --enable-decoder=mpl2 --enable-decoder=movtext --enable-decoder=pgssub --enable-decoder=srt --enable-decoder=ssa --enable-decoder=subrip --enable-decoder=xsub --enable-decoder=webvtt --disable-filters --enable-filter=aformat --enable-filter=amix --enable-filter=anull --enable-filter=aresample --enable-filter=areverse --enable-filter=asetrate --enable-filter=atempo --enable-filter=atrim --enable-filter=bwdif --enable-filter=delogo --enable-filter=equalizer --enable-filter=estdif --enable-filter=firequalizer --enable-filter=format --enable-filter=fps --enable-filter=hflip --enable-filter=hwdownload --enable-filter=hwmap --enable-filter=hwupload --enable-filter=idet --enable-filter=lenscorrection --enable-filter=lut_filter --enable-filter=negate --enable-filter=null --enable-filter=overlay --enable-filter=palettegen --enable-filter=paletteuse --enable-filter=pan --enable-filter=rotate --enable-filter=scale --enable-filter=setpts --enable-filter=superequalizer --enable-filter=transpose --enable-filter=trim --enable-filter=vflip --enable-filter=volume --enable-filter=w3fdif --enable-filter=yadif --enable-filter=avgblur_vulkan --enable-filter=blend_vulkan --enable-filter=bwdif_vulkan --enable-filter=chromaber_vulkan --enable-filter=flip_vulkan --enable-filter=gblur_vulkan --enable-filter=hflip_vulkan --enable-filter=nlmeans_vulkan --enable-filter=overlay_vulkan --enable-filter=vflip_vulkan --enable-filter=xfade_vulkan --disable-debug --enable-stripping --arch=aarch64 --target-os=darwin --enable-neon --enable-asm --enable-videotoolbox --enable-audiotoolbox --enable-filter=yadif_videotoolbox --enable-filter=scale_vt --enable-filter=transpose_vt --disable-avdevice --disable-programs --enable-libplacebo --enable-filter=libplacebo --enable-libdav1d --enable-decoder=libdav1d --enable-openssl --enable-libsrt --enable-protocol=libsrt --enable-libzvbi --enable-decoder=libzvbi_teletext environment: ["CFLAGS": "-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS17.0.sdk -target arm64-apple-tvos13.0 -mtvos-version-min=13.0 -fno-common -I/Users/skrew/Sources/libs/FFmpegKit/.Script/vulkan-v1.2.6/Package/Release/MoltenVK/include", "CXXFLAGS": "-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS17.0.sdk -target arm64-apple-tvos13.0 -mtvos-version-min=13.0 -fno-common -I/Users/skrew/Sources/libs/FFmpegKit/.Script/vulkan-v1.2.6/Package/Release/MoltenVK/include", "CC": "/usr/bin/clang", "LDFLAGS": "-lc++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS17.0.sdk -target arm64-apple-tvos13.0", "CURRENT_ARCH": "arm64", "CXX": "/usr/bin/clang++", "LC_CTYPE": "C", "PKG_CONFIG_PATH": "/Users/skrew/Sources/libs/FFmpegKit/.Script/libplacebo/tvos/thin/arm64/lib/pkgconfig:/Users/skrew/Sources/libs/FFmpegKit/.Script/libdav1d/tvos/thin/arm64/lib/pkgconfig:/Users/skrew/Sources/libs/FFmpegKit/.Script/libfreetype/tvos/thin/arm64/lib/pkgconfig:/Users/skrew/Sources/libs/FFmpegKit/.Script/libfribidi/tvos/thin/arm64/lib/pkgconfig:/Users/skrew/Sources/libs/FFmpegKit/.Script/libass/tvos/thin/arm64/lib/pkgconfig:/Users/skrew/Sources/libs/FFmpegKit/.Script/openssl/tvos/thin/arm64/lib/pkgconfig:/Users/skrew/Sources/libs/FFmpegKit/.Script/libsrt/tvos/thin/arm64/lib/pkgconfig:/Users/skrew/Sources/libs/FFmpegKit/.Script/harfbuzz/tvos/thin/arm64/lib/pkgconfig:/Users/skrew/Sources/libs/FFmpegKit/.Script/png/tvos/thin/arm64/lib/pkgconfig:/Users/skrew/Sources/libs/FFmpegKit/.Script/libzvbi/tvos/thin/arm64/lib/pkgconfig:", "PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/local/opt/bison/bin:/usr/bin:/bin:/usr/sbin:/sbin", "CPPFLAGS": "-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS17.0.sdk -target arm64-apple-tvos13.0 -mtvos-version-min=13.0 -fno-common -I/Users/skrew/Sources/libs/FFmpegKit/.Script/vulkan-v1.2.6/Package/Release/MoltenVK/include"] logFile: file:///Users/skrew/Sources/libs/FFmpegKit/.Script/FFmpeg/tvos/scratch/arm64.log/

Error log:

ERROR: libplacebo >= 4.192.0 not found using pkg-config

Broken compile on iOS

The following commit breaks compilation for iOS devices when using CocoaPods.

3391fc3

I sent you the screenshots via email.

如何支持 nfs?

看到此库已经将编译 nfs 的脚本加进去了。但是不知道 ffmpeg 如何开启 nfs 的支持,就像 libsmbclient 的支持,ffmpeg 文档中并没有看到有 nfs 协议的支持。

为iOS编译失败

系统:macOS 14.0 23A344 arm64

main和mpv分支都试了,使用如下命令进行编译:

swift package --disable-sandbox BuildFFmpeg enable-libdav1d enable-openssl enable-libsrt enable-libfreetype enable-libfribidi enable-harfbuzz enable-libass enable-mpv platforms=ios

失败后查看 .Script/harfbuzz/ios/scratch/arm64.log日志出错信息:

FAILED: src/main
/usr/bin/clang++ -arch arm64  -o src/main src/main.p/main.cc.o -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -target arm64-apple-ios13.0 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -target arm64-apple-ios13.0 -mios-version-min=13.0 -fno-common -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -target arm64-apple-ios13.0 -mios-version-min=13.0 -fno-common -Wl,-rpath,/opt/homebrew/opt/libpng/lib -Wl,-rpath,/opt/homebrew/Cellar/brotli/1.1.0/lib src/libharfbuzz.a -lm /Users/missdeer/Shareware/FFmpegKit/.Script/libfreetype/ios/thin/arm64/lib/libfreetype.a /opt/homebrew/opt/libpng/lib/libpng16.dylib /opt/homebrew/Cellar/brotli/1.1.0/lib/libbrotlidec.dylib -L/Users/missdeer/Shareware/FFmpegKit/.Script/libfreetype/ios/thin/arm64/lib -L/opt/homebrew/opt/libpng/lib -L/opt/homebrew/Cellar/brotli/1.1.0/lib -lbz2 -lz -L/Users/missdeer/Shareware/FFmpegKit/.Script/libfreetype/ios/thin/arm64/lib -L/opt/homebrew/opt/libpng/lib -L/opt/homebrew/Cellar/brotli/1.1.0/lib -lbz2 -lz
ld: warning: -undefined error is deprecated
ld: warning: ignoring duplicate libraries: '-lbz2', '-lz'
ld: building for 'iOS', but linking in dylib (/opt/homebrew/Cellar/libpng/1.6.40/lib/libpng16.16.dylib) built for 'macOS'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

请问是哪里操作有问题吗?

关于编译 FFmpeg 的问题请教

没有研究过这一块,所以有一些问题不明白。

FFmpeg 是一个开源的音视频处理工具集,它用 c 语言写的。

各个平台(Linux/Windows/macOS/tvOS/iOS等)需要编译其源码生成支持对应平台的二进制,以及头文件。这样在项目中就可以通过调用头文件中的函数定义来调用 FFmpeg 里的具体实现。

本项目 FFmpegKit 编写了BuildFFmpeg/main.swift 这个编译规则,它是编译 FFmpeg 的脚本。比如我创建一个 tvOS 平台的项目,项目中引入了 FFmpegKit 这个库,在 Xcode 编译项目的时候,会执行 BuildFFmpeg/main.swift 来进行编译,它会识别编译的平台,如果是 tvOS 则编译出 tvOS,如果是其他平台,则编译出其他平台的产物。

所以上面一段理解有问题吗?是在项目编译时候编译 FFmpeg 么?还是已经编译好了,不用在编译?

如果是在项目编译时候编译 FFmpeg,那使用 swift package manager 导入的 FFmpegKit,哪里的规则让 Xcode 编译项目时候先执行 BuildFFmpeg/main.swift 来进行编译?是 Package.swift 这里么?那如果是用 CocoaPods 导入的 FFmpeg,那对应的编译规则是在那里?我在 podspec 中没有找到。

[Suggestion] Change dependencies to git submodule

@karelrooted has a fork where all dependencies are all git submodules.
I've tried it and it really helps a lot because we can check all latest commits for each dependency and makes it easier to apply/create custom patch.

Another things to make this more generic is to auto apply patches from folders with lib name.

  • we add patch files to lib folder
  • the script finds all patch for that lib
  • sort them by name (so we can use patterns like 0001-patch_name.patch)
  • git reset and then apply them in order on builder init

Questions about use

If possible, I'd like to get some demo code on how to use ffmpeg to generate covers, and ffprobe to get metadata about the media. Thanks for your hard work!

希望能得到一些如何获取元数据的方法的指导, 不胜感激!

Building FFmpeg

Hi,
I used to compile using this command line:

swift run BuildFFmpegPlugin enable-libdav1d enable-openssl enable-libsrt 

but now I see that it's not correct anymore. Would this be the updated command?

swift package BuildFFmpeg enable-libdav1d enable-openssl enable-libsrt

I am getting an error:

Failure!  Makefile wasn't produced.
Please read INSTALL.md and associated NOTES-* files.  You may also have to
look over your available compiler tool chain or change your configuration.

mkdir /Users/user/Developer/myapp/FFmpegKit/.Script/openssl-openssl-3.2.0/../../../../openssl-openssl-3.2.0: Operation not permitted at /Users/user/Developer/myapp/FFmpegKit/.Script/openssl-openssl-3.2.0/configure line 1916.
error: Error Domain=fail Code=1 "(null)"

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.