简体   繁体   中英

How to specify image in FFmpeg command

I was able to successfully compile & import FFmpeg into my existing iOS app. However now I would like to run the following commands. Can anyone tell me, how to pass image name in FFmpeg command, I would like to form command in iOS swift.

I have an example in android:

String command = “ -i beach.jpg output.jpg“

If I mention image name “beach.jpg” , after adding it to my project, in logs,

error “No such file or directory”

Then I have created format

var resourceFolder = Bundle.main.resourcePath

var image1 = URL(fileURLWithPath: resourceFolder ?? "").appendingPathComponent("beach.jpeg").absoluteString

Not supported

let imag = UIImage(named: "beach")

Not supported

What is the correct way to achieve this?

Finally, I got the answer , we have to give path of image there.

Ex:

 let resourceFolder = Bundle.main.resourcePath

 let input = URL(fileURLWithPath: resourceFolder ?? "").appendingPathComponent("pyramid.jpg").absoluteString

let out = "/Users/appleapple/Desktop/test/output1.jpg"


let command = "-i \(image1) \(out)"

let test =  MobileFFmpeg.execute(command)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM