在iOS上使用ffmpeg播放视频

国外靠谱的有这几个:
一、Mooncatventures group https://github.com/mooncatventures-group

二、KxMoviePlayer (use OpenGLES, Core Audio) https://github.com/kolyvan/kxmovie

三、FFmpeg for ios (with OpenGLES, AudioQueue) https://github.com/flyhawk007/FFmpeg-for-iOS.git

四、iFrameExtractor https://github.com/lajos/iFrameExtractor.git

固然还有ffmpeg自带的ffplay,若是想学习ffplay能够参考ffmpeg tutorial http://dranger.com/ffmpeg/  中文版链接:http://download.csdn.net/detail/dayudian/4600783(这个好多地方都有,能够本身搜索)

SDL:如今SDL1.3已有iOS版本,能够直接编译.a文件。
下载地址:SDL 1.3 is ready for a massive bug hunt!
http://www.libsdl.org/tmp/SDL-1.3.zip
or
http://www.libsdl.org/tmp/SDL-1.3.tar.gz

音频:使用audiocore播放音频只能播放iOS支持的音频格式,使用SDL播放音频没有限制。html

 

移值FFMPEG到iPhone或Mac OS/Xios

 

有关FFMPEG的详细说明能够参考网上相关文档;在这里咱们只讲述FFMPEG移到iPhone或Mac OS/X的过程及相关注意事项。git

 

FFMPEG功能至关强大,在完整的FFMPEG包中就包含了ffserver, ffplay, ffmpeg, avcodec, avdevice, avformat, avutil, swscale等;其中ffserver, ffplay, ffmpeg为应该程序,对与咱们这些从事软件开发的人来讲基本上没什么用;而avcodec为加解码库、avformat为格式库,avutil则为基础库(但日常咱们不多用到), swscale则为图象处理库;因此咱们所要的就是移值avcodec, avformat, avutil, swscale这四个库。github

 

移值到Mac OS/X下过程:web

 

1、   配置app

 

./configure --prefix=/Developer/usr --cc=/Developer/usr/bin/gcc-4.0 --enable-gpl --enable-shared --disable-ipv6 --enable-swscale --enable-zlib --enable-bzlib --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-vhook工具

 

2、   编译学习

 

makethis

 

3、   安装url

 

make install

 

说明:上面的/Developer/usr为目标目录,若是你的Xcode为默认安装,则这样安装后既能够在Xcode中编译及调式你的代码了;

 

移值到Mac OS/X下的模拟iPhone平台下过程:

 

1、   配置

 

./configure --prefix=/Developer/usr --disable-debug --cc=/Developer/usr/bin/i686-apple-darwin9-gcc-4.0.1 --enable-gpl --enable-static --disable-shared --disable-ipv6 --enable-swscale --enable-zlib --enable-bzlib --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-vhook --enable-pthreads

 

2、   编译

 

make

 

3、   安装

 

make install

 

说明:上面的/Developer/usr为目标目录,若是你的Xcode为默认安装,则这样安装后既能够在Xcode中编译及在模拟器下调式你的代码了;

 

移值到iPhone平台下过程:

 

1、   配置

 

./configure --enable-cross-compile --cross-prefix=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 --prefix=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr --extra-cflags="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk" --extra-ldflags="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk -Wl,-syslibroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk" --arch=armv6 --enable-armv6 --enable-gpl --enable-shared --disable-ipv6 --enable-swscale --enable-zlib --enable-bzlib --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-vhook

 

2、   编译

 

make

 

3、   安装

 

make install

 

说明:上面的/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/为目标目录,若是你的Xcode为默认安装,则这样安装后既能够在Xcode中编译及在模拟器下调式你的代码了。

 

相关说明:

 

    在ffmpeg中若是使用静态库则会出现一些链接错;因此在安装ffmpeg库时请选中动态库。

 

OK,到如今咱们就你已经知道了如何把ffmpeg移到到iPhone下并把ffmpeg库和Xcode结合起来了吧;固然若是你的Xcode工具非默认安装,请更上相关目录选项.

 

http://www.cocoachina.com/bbs/simple/?t75338.html

相关文章
相关标签/搜索