如何在Xcode中集成和使用iOS中的FFmpeg库? [英] How to integrate and use FFmpeg library in iOS with Xcode?

查看:292
本文介绍了如何在Xcode中集成和使用iOS中的FFmpeg库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用FFMpeg库进行视频处理活动,从2天开始,我就致力于将该库与Xcode 8和Swift进行编译和集成.我尝试了以下链接,但没有成功.谁能帮我实现这个目标吗?

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?

在iphone/ipad项目上实现FFMPEG集成

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

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

如何将FFMpeg构建为iOS框架

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

https://github.com/kolyvan/kxmovie

推荐答案

我已经尝试过 mobile-ffmpeg ,并且可以正常工作(swift 4.2-Xcode 10.1)
cocoapods pod 'mobile-ffmpeg-full-gpl', '~> 4.2'
的安装非常简单 如果不需要所有功能,则可以使用不同的二进制文件,例如:pod 'mobile-ffmpeg-min', '~> 4.2' 链接

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

要快速使用,您应该添加 ProjectName-Bridging-Header.h然后在其中导入库:#import <mobileffmpeg/MobileFFmpeg.h>

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>

您可以迅速运行以下命令(将mkv转换为mp4):

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

MobileFFmpeg.execute("-i video.mkv -codec copy video.mp4")

这篇关于如何在Xcode中集成和使用iOS中的FFmpeg库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆