Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 67 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,87 @@
// swift-tools-version:5.2
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "SwiftFFmpeg",
platforms: [.iOS(.v9), .macOS(.v10_10), .tvOS(.v10)],
products: [
.library(
name: "SwiftFFmpeg",
targets: ["SwiftFFmpeg"]
)
],
targets: [
.systemLibrary(
name: "CFFmpeg",
pkgConfig: "libavformat"
),
.target(
name: "SwiftFFmpeg",
dependencies: ["CFFmpeg"]
),
.target(
name: "CFFmpeg",
dependencies: [
"libavcodec",
"libavdevice",
"libavfilter",
"libavformat",
"libavutil",
"libswresample",
"libswscale",
],
linkerSettings: [
.linkedLibrary("z"),
.linkedLibrary("bz2"),
.linkedLibrary("iconv"),
.linkedLibrary("lzma"),
.linkedFramework("Security"),
.linkedFramework("CoreMedia"),
.linkedFramework("CoreVideo"),
.linkedFramework("AudioToolbox"),
.linkedFramework("VideoToolbox"),
.linkedFramework("OpenGL"),
.linkedFramework("CoreImage"),
.linkedFramework("AppKit"),
]
),
.binaryTarget(
name: "libavcodec",
url: "https://github.com/sunlubo/SwiftFFmpeg/blob/master/xcframework/libavcodec.zip?raw=true",
checksum: "97f406b33946c1ab941af7dd02991e5cc3703779bb018de8ff265eb7a6d236fa"
),
.binaryTarget(
name: "libavdevice",
url:
"https://github.com/sunlubo/SwiftFFmpeg/blob/master/xcframework/libavdevice.zip?raw=true",
checksum: "87738dff91380bd23de288e8702f0aa5511d80895c0974daba13dc117bdd599c"
),
.binaryTarget(
name: "libavfilter",
url:
"https://github.com/sunlubo/SwiftFFmpeg/blob/master/xcframework/libavfilter.zip?raw=true",
checksum: "cb9b72b3cd923c9b065041cf6a87e164264f16eb282ea338b15bdae6dd5a3d15"
),
.binaryTarget(
name: "libavformat",
url:
"https://github.com/sunlubo/SwiftFFmpeg/blob/master/xcframework/libavformat.zip?raw=true",
checksum: "9def922d249207ed7be7aebdab7bbd2ff3bc41187dcb0bd77c8e216630407e00"
),
.binaryTarget(
name: "libavutil",
url: "https://github.com/sunlubo/SwiftFFmpeg/blob/master/xcframework/libavutil.zip?raw=true",
checksum: "3ca05b51466e4fec332b5c1c607b228a67f4eb7a89e09944d19550474214f4e2"
),
.binaryTarget(
name: "libswresample",
url:
"https://github.com/sunlubo/SwiftFFmpeg/blob/master/xcframework/libswresample.zip?raw=true",
checksum: "76aa9805c67a040a729eee4599162a982f4bbd2609e7c92b7a3c589159259a7a"
),
.binaryTarget(
name: "libswscale",
url: "https://github.com/sunlubo/SwiftFFmpeg/blob/master/xcframework/libswscale.zip?raw=true",
checksum: "b5e47c27f44c6818cc11a41fe43535e7bdb25d171a0b5c4984b52b303c7e53b1"
),
.target(
name: "SwiftFFmpegExamples",
dependencies: ["SwiftFFmpeg"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 0 additions & 37 deletions Sources/CFFmpeg/module.modulemap

This file was deleted.

7 changes: 7 additions & 0 deletions Sources/CFFmpeg/src/empty.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// empty.c
// CFFmpeg
//
// Created by sunlubo on 2020/8/6.
// Copyright © 2019-2020 sunlubo. All rights reserved.
//
5 changes: 2 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FFMPEG_VERSION=4.3.1
FFMPEG_SOURCE_DIR=FFmpeg-n$FFMPEG_VERSION
FFMPEG_LIBS="libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale"
FFMPEG_LIBS="libavcodec libavdevice libavfilter libavformat libavutil libswresample libswscale"
PREFIX=`pwd`/output
ARCH="x86_64"

Expand All @@ -20,12 +20,11 @@ cd $FFMPEG_SOURCE_DIR

./configure \
--prefix=$PREFIX \
--enable-gpl \
--enable-version3 \
--disable-programs \
--disable-doc \
--arch=$ARCH \
--extra-cflags="-arch $ARCH -march=native -fno-stack-check" \
--extra-cflags="-fno-stack-check" \
--disable-debug || exit 1

make clean
Expand Down
Binary file modified xcframework/libavcodec.zip
Binary file not shown.
Binary file modified xcframework/libavdevice.zip
Binary file not shown.
Binary file modified xcframework/libavfilter.zip
Binary file not shown.
Binary file modified xcframework/libavformat.zip
Binary file not shown.
Binary file modified xcframework/libavutil.zip
Binary file not shown.
Binary file removed xcframework/libpostproc.zip
Binary file not shown.
Binary file modified xcframework/libswresample.zip
Binary file not shown.
Binary file modified xcframework/libswscale.zip
Binary file not shown.