FFmpegKit is a collection of tools to use FFmpeg in iOS, macOS, tvOS, xrOS, visionOS applications.
dependencies: [
.package(url: "https://github.com/kingslay/FFmpegKit.git", .branch("main"))
]FFmpegKit uses the GPL license.
Additionally, there is a paid version that adopts the LGPL license (contact us).
- Scripts to build FFmpeg、MPV native libraries
- Run ffmpeg ffprobe in code
swift package BuildFFmpeg -h
swift package --disable-sandbox BuildFFmpeg
swift run ffplay
swift run ffmpegCmd
swift run ffprobeCmd
var arguments = ["ffmpeg", "-i", "file1.mp4", "-c:v", "mpeg4", "file2.mp4"]
var argv = arguments.map {
UnsafeMutablePointer(mutating: ($0 as NSString).utf8String)
}
ffmpeg_execute(Int32(arguments.count), &argv)
arguments = ["ffprobe", "-h"]
argv = arguments.map {
UnsafeMutablePointer(mutating: ($0 as NSString).utf8String)
}
ffprobe_execute(Int32(arguments.count), &argv)