Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate and use FFmpeg library in iOS with Xcode?

Tags:

ios

swift

ffmpeg

I wanted to use FFMpeg library for video processing activities, from 2 days I m working on compiling and integrating this library with Xcode 8 and Swift. I tried following links but with no success. Can anyone please help me how to achieve this?

FFMPEG integration on iphone/ ipad project

https://github.com/chrisballinger/FFmpeg-iOS

http://witcheryne.iteye.com/blog/1734706

How to Build FFMpeg as iOS Framework

https://github.com/ElfSundae/FFmpeg-iOS-build

https://github.com/kolyvan/kxmovie

like image 206
Akshaykumar Maldhure Avatar asked May 16 '17 08:05

Akshaykumar Maldhure


1 Answers

I've tried mobile-ffmpeg, and it works (swift 4.2 - Xcode 10.1)
installation is very easy by cocoapods pod 'mobile-ffmpeg-full-gpl', '~> 4.2'
you can use different binaries if you don't need all features, for example: pod 'mobile-ffmpeg-min', '~> 4.2' link

for using in swift you should add ProjectName-Bridging-Header.h to your project and then import the library in that: #import <mobileffmpeg/MobileFFmpeg.h>

you can run a command like this in swift (converting mkv to mp4):

MobileFFmpeg.execute("-i video.mkv -codec copy video.mp4")
like image 101
Amir Khorsandi Avatar answered Oct 22 '22 08:10

Amir Khorsandi