真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

ios8.1下繼續(xù)編譯ffmpeg做完整功能的播放器-創(chuàng)新互聯(lián)

郝萌主傾心貢獻,尊重作者的勞動成果,請勿轉(zhuǎn)載。

創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供燈塔網(wǎng)站建設、燈塔做網(wǎng)站、燈塔網(wǎng)站設計、燈塔網(wǎng)站制作等企業(yè)網(wǎng)站建設、網(wǎng)頁設計與制作、燈塔企業(yè)網(wǎng)站模板建站服務,十載燈塔做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡服務。

如果文章對您有所幫助,歡迎給作者捐贈,支持郝萌主,捐贈數(shù)額隨意,重在心意^_^ 

我要捐贈: 點擊捐贈

Cocos2d-X×××:點我傳送


上篇日志里做的demo沒有音頻解碼部分,而且也沒有控制音量大小緩沖等視頻播放器功能。


在網(wǎng)上找到一個kxmovie的播放器的例子,一樣要編譯ffmpeg。但是把先前編譯好的lib放入新工程中,編譯不能通過。
結(jié)論是:先前編譯的庫這個工程用不了。

這下我十分的困惑。
上個例子中缺少音頻部分的解碼,只能作這樣的猜測。

于是想辦法按照kxmovie的readme重新編譯ffmpeg庫。
但是,尼瑪?shù)?,不僅僅是它,網(wǎng)上一堆人都說按照這個成功編譯了,純屬放屁。

我把要編譯的代碼改了一些,才能通過。

可以遠程在線播放視頻,也可以播放本地視頻,支持任何格式,支持播放器功能。

至此,編譯ffmpeg在線播放任何視頻格式的問題就此結(jié)束。


我的sdk:8.1
    Xcode6.1
    mac os x 10.9.5
改動后的代碼如下:

require "pathname"

require "fileutils"

def system_or_exit(cmd, stdout = nil)

puts "Executing #{cmd}"

cmd += " >#{stdout}" if stdout

system(cmd) or raise "******** Build failed ********"

end

## build ffmpeg

XCODE_PATH='/Applications/Xcode.app/Contents/Developer/Platforms'

#GCC_PATH='/Developer/usr/bin/gcc'

GCC_PATH='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang'

LIB_PATH='/usr/lib/system'

PLATOFRM_PATH_SIM ='/iPhoneSimulator.platform'

PLATOFRM_PATH_IOS ='/iPhoneOS.platform'

SDK_VERSION = '8.1'

SIM_SDK = 'iphonesimulator' + SDK_VERSION

IOS_SDK = 'iphoneos' + SDK_VERSION

#SDK_PATH_SIM ='/Developer/SDKs/iPhoneSimulator8.1.sdk'

#SDK_PATH_IOS='/Developer/SDKs/iPhoneOS8.1.sdk'

SDK_PATH_SIM ='/Developer/SDKs/iPhoneSimulator' + SDK_VERSION + '.sdk'

SDK_PATH_IOS='/Developer/SDKs/iPhoneOS' + SDK_VERSION + '.sdk'


FFMPEG_BUILD_ARGS_SIM = [

'--assert-level=2',

'--disable-mmx',

'--arch=i386',

'--cpu=i386',

"--extra-ldflags='-arch i386 -miphoneos-version-min=7.0'",

"--extra-cflags='-arch i386 -mfpu=neon -miphoneos-version-min=7.0'",

'--disable-asm',

]

FFMPEG_BUILD_ARGS_ARMV7 = [

'--arch=arm',

'--cpu=cortex-a8',

'--enable-pic',

"--extra-cflags='-arch armv7 -mfpu=neon -miphoneos-version-min=7.0'",

"--extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -miphoneos-version-min=7.0'",

'--enable-neon',

'--enable-optimizations',

'--disable-debug',

'--disable-armv5te',

'--disable-armv6',

'--disable-armv6t2',

'--enable-small',

'--disable-asm',

]

FFMPEG_BUILD_ARGS_ARMV7S = [

'--arch=arm',

'--cpu=cortex-a8',

'--enable-pic',

"--extra-cflags='-arch armv7s -mfpu=neon -miphoneos-version-min=7.0'",

"--extra-ldflags='-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -miphoneos-version-min=7.0'",

'--enable-neon',

'--enable-optimizations',

'--disable-debug',

'--disable-armv5te',

'--disable-armv6',

'--disable-armv6t2',

'--enable-small',

'--disable-asm',

]

FFMPEG_BUILD_ARGS = [

'--disable-ffmpeg',

'--disable-ffplay',

'--disable-ffserver',

'--disable-ffprobe',

'--disable-doc',

'--disable-bzlib',

'--target-os=darwin',

'--enable-cross-compile',

#'--enable-nonfree',

'--enable-gpl',

'--enable-version3',

'--disable-asm',

]

FFMPEG_LIBS = [

'libavcodec',

'libavformat',

'libavutil',

'libswscale',

'libswresample',

]

def mkArgs(platformPath, sdkPath, platformArgs)

#cc = '--cc=' + XCODE_PATH + platformPath + GCC_PATH

cc = '--cc=' + GCC_PATH

sysroot = '--sysroot=' + XCODE_PATH + platformPath + sdkPath

extra = '--extra-ldflags=-L' + XCODE_PATH + platformPath + sdkPath + LIB_PATH


args = FFMPEG_BUILD_ARGS + platformArgs

args << cc

args << sysroot

args << extra


args.join(' ')

end

def moveLibs(dest)

FFMPEG_LIBS.each do |x|

FileUtils.move Pathname.new("ffmpeg/#{x}/#{x}.a"), dest

end

end

def ensureDir(path)

dest = Pathname.new path

if dest.exist?

FileUtils.rm Dir.glob("#{path}/*.a")

else

dest.mkdir

end

dest

end

def buildArch(arch)

case arch

when 'i386'

args = mkArgs(PLATOFRM_PATH_SIM, SDK_PATH_SIM, FFMPEG_BUILD_ARGS_SIM)

when 'armv7'

args = mkArgs(PLATOFRM_PATH_IOS, SDK_PATH_IOS, FFMPEG_BUILD_ARGS_ARMV7)

when 'armv7s'

args = mkArgs(PLATOFRM_PATH_IOS, SDK_PATH_IOS, FFMPEG_BUILD_ARGS_ARMV7S)

else

raise "Build failed: unknown arch: #{arch}"

end

dest = ensureDir('ffmpeg/' + arch)

system_or_exit "cd ffmpeg; ./configure #{args}"

system_or_exit "cd ffmpeg; make"

moveLibs(dest)

system_or_exit "cd ffmpeg; make clean"

end

def mkLipoArgs(lib)

"-create -arch armv7 armv7/#{lib}.a -arch armv7 armv7s/#{lib}.a -arch i386 i386/#{lib}.a -output universal/#{lib}.a"

end

desc "check gas-preprocessor.pl"

task :check_gas_preprocessor do

found = false

ENV['PATH'].split(':').each do |x|

p = Pathname.new(x) + 'gas-preprocessor.pl'

if p.exist? && p.writable?

found = true

break;

end


#print p

end

unless found

raise "Build failed: first install gas-preprocessor.pl.\nSee http://stackoverflow.com/questions/5056600/how-to-install-gas-preprocessor for more info."

end

end

desc "Clean ffmpeg"

task :clean_ffmpeg do

system_or_exit "cd ffmpeg; make clean"

end

desc "Build ffmpeg i386 libs"

task :build_ffmpeg_i386 do

buildArch('i386')

end

desc "Build ffmpeg armv7 libs"

task :build_ffmpeg_armv7 do

buildArch('armv7')

end

desc "Build ffmpeg armv7s libs"

task :build_ffmpeg_armv7s do

buildArch('armv7s')

end

desc "Build ffmpeg universal libs"

task :build_ffmpeg_universal do

ensureDir('ffmpeg/universal')

FFMPEG_LIBS.each do |x|

args = mkLipoArgs(x)

system_or_exit "cd ffmpeg; lipo #{args}"

end

dest = ensureDir('libs')

FFMPEG_LIBS.each do |x|

FileUtils.move Pathname.new("ffmpeg/universal/#{x}.a"), dest

end

end

## build libkxmovie

def cleanMovieLib(config)

buildDir = Pathname.new 'tmp/build'

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration #{config} -sdk #{IOS_SDK} clean SYMROOT=#{buildDir}"

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration #{config} -sdk #{SIM_SDK} clean SYMROOT=#{buildDir}"

end

desc "Clean libkxmovie-debug"

task :clean_movie_debug do

cleanMovieLib 'Debug'

end

desc "Clean libkxmovie-release"

task :clean_movie_release do

cleanMovieLib 'Release'

end

desc "Build libkxmovie-debug"

task :build_movie_debug do

buildDir = Pathname.new 'tmp/build'

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk #{IOS_SDK} build SYMROOT=#{buildDir} -arch armv7s"

FileUtils.move Pathname.new('tmp/build/Debug-iphoneos/libkxmovie.a'), Pathname.new('tmp/build/Debug-iphoneos/libkxmovie_armv7s.a')

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk #{IOS_SDK} build SYMROOT=#{buildDir} -arch armv7"

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk #{SIM_SDK} build SYMROOT=#{buildDir}"

system_or_exit "lipo -create -arch armv7 tmp/build/Debug-iphoneos/libkxmovie.a -arch armv7 tmp/build/Debug-iphoneos/libkxmovie_armv7s.a -arch i386 tmp/build/Debug-iphonesimulator/libkxmovie.a -output tmp/build/libkxmovie.a"

end

desc "Build libkxmovie-release"

task :build_movie_release do

buildDir = Pathname.new 'tmp/build'

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Release -sdk #{IOS_SDK} build SYMROOT=#{buildDir} -arch armv7s"

FileUtils.move Pathname.new('tmp/build/Release-iphoneos/libkxmovie.a'), Pathname.new('tmp/build/Release-iphoneos/libkxmovie_armv7s.a')

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Release -sdk #{IOS_SDK} build SYMROOT=#{buildDir} -arch armv7"

system_or_exit "xcodebuild -project kxmovie.xcodeproj -target kxmovie -configuration Debug -sdk #{SIM_SDK} build SYMROOT=#{buildDir}"

system_or_exit "lipo -create -arch armv7 tmp/build/Release-iphoneos/libkxmovie.a -arch armv7 tmp/build/Release-iphoneos/libkxmovie_armv7s.a -arch i386 tmp/build/Debug-iphonesimulator/libkxmovie.a -output tmp/build/libkxmovie.a"

#FileUtils.copy Pathname.new('tmp/build/Release-iphoneos/libkxmovie.a'), buildDir

end

desc "Copy to output folder"

task :copy_movie do

dest = ensureDir 'output'

FileUtils.move Pathname.new('tmp/build/libkxmovie.a'), dest

FileUtils.copy Pathname.new('libs/libavcodec.a'), dest

FileUtils.copy Pathname.new('libs/libavformat.a'), dest

FileUtils.copy Pathname.new('libs/libavutil.a'), dest

FileUtils.copy Pathname.new('libs/libswscale.a'), dest

FileUtils.copy Pathname.new('libs/libswresample.a'), dest

FileUtils.copy Pathname.new('kxmovie/KxMovieViewController.h'), dest

FileUtils.copy Pathname.new('kxmovie/KxAudioManager.h'), dest

FileUtils.copy Pathname.new('kxmovie/KxMovieDecoder.h'), dest

FileUtils.copy_entry Pathname.new('kxmovie/kxmovie.bundle'), dest + 'kxmovie.bundle'

end

##

task :clean => [:clean_movie_debug, :clean_movie_release, :clean_ffmpeg]

task :build_ffmpeg => [:check_gas_preprocessor, :build_ffmpeg_i386, :build_ffmpeg_armv7, :build_ffmpeg_armv7s, :build_ffmpeg_universal]

#task :build_movie => [:build_movie_debug, :copy_movie]

task :build_movie => [:build_movie_release, :copy_movie]

task :build_all => [:build_ffmpeg, :build_movie]

task :default => [:build_all] 

另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。


文章題目:ios8.1下繼續(xù)編譯ffmpeg做完整功能的播放器-創(chuàng)新互聯(lián)
新聞來源:http://weahome.cn/article/deohdj.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部