Caleb
Caleb

Reputation: 305

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?

Upvotes: 3

Views: 562

Answers (1)

Caleb
Caleb

Reputation: 305

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)

Upvotes: 1

Related Questions