baihua666 / FFmpegMain-ios

ffmpeg cmd for ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FFmpegMain-ios

change ffmpeg cmd code to interface for ios, use ffmpeg as a cmd tool. ffmpeg version 3.4 with libx264 add custom configure mp4 to gif reduce lib file size

objective-c and swift support

cmd example

let documentsDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first!
let inputFile = (documentsDirectory as NSString).appendingPathComponent("test.mp4")
let outputFile = (documentsDirectory as NSString).appendingPathComponent("test_QualityHigh.gif")
let cmdArray = ["ffmpeg", "-i", inputFile, outputFile]
FFmpegCMD.shared().cmdprocess(cmdArray) { frame in
            print("frame:\(frame)")
        }

video to gif example

func testQualityHigh() {
    let documentsDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first!
    let inputFile = (documentsDirectory as NSString).appendingPathComponent("test.mp4")
    let outputFile = (documentsDirectory as NSString).appendingPathComponent("test_QualityHigh.gif")
    FFmpegGifUtil.video(inputFile, toGif: outputFile)
}


ffmpeg build
https://github.com/kewlbear/FFmpeg-iOS-build-script

x264 build
https://github.com/kewlbear/x264-ios

About

ffmpeg cmd for ios


Languages

Language:C 96.8%Language:C++ 1.8%Language:Objective-C 0.8%Language:Ruby 0.4%Language:Shell 0.2%