Android 關於編譯ijkplayer下的so經驗分享

來源:互聯網
上載者:User

標籤:compile   androi   .so   .sh   roi   開始   bsp   匯入   blank   

  • 前言:公司最近需要做直播方面的技術調研,所以需要去研究播放器相關的技術;剛好本人github上收藏了ijkplayer,之前一直沒有研究過,現在剛好clone下來研究研究。

我先在Windows安裝cygwin編譯,各種報錯,各種坑,果斷放棄。然後使用VMware安裝的Ubuntu 16.04,一次性完成。哈哈

那麼進入正題!

編譯環境 
Ubuntu 16.04 
NDKr11b 
Android SDK 24 
Lantern(FQ工具,建議安裝,: https://github.com/getlantern/lantern)

編譯前準備 
1.安裝Git 命令:$ sudo apt-get install git

2.安裝yasm 命令:$ sudo apt-get install yasm

3.配置環境變數 
命令:$sudo gedit ~./bashrc 
添加以下兩個環境變數 
export ANDROID_SDK= sdk path 
export ANDROID_NDK= ndk path

開始編譯 
1.下載項目到本地 
git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-android 
cd ijkplayer-android 
git checkout -B latest k0.5.1

2.執行初始化操作 
./init-android.sh

3.編譯ffmpeg 
cd android/contrib 
./compile-ffmpeg.sh clean 
./compile-ffmpeg.sh all

4.開始編譯so 
cd .. 
./compile-ijk.sh all

完成 
如果正確編譯的話,會分別在ijkplayer-arm64、ijkplayer-armv5、ijkplayer-armv7a、ijkplayer-x86、ijkplayer-x86_64這些項目的src/main/libs/對應的名稱 目錄下分別產生libijkffmpeg.so、libijkplayer.so、libijksdl.so這三個so檔案

編譯成功後將目錄下android/ijkplayer項目匯入Android Studio即可運行

友情提示 
可能出現的問題大部分都是因為環境變數導致,建議仔細檢查環境變數 
注意:Windows環境下編譯會出現很多問題,強烈建議使用Linux環境進行編譯

Android 關於編譯ijkplayer下的so經驗分享

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.