ORTP庫移植
轉載,侵刪
1、ORTP的引入
為什麼要使用RTP:http://blog.51cto.com/ticktick/462746
RTP協議分析:http://www.xuebuyuan.com/739929.html
總結:OPTP是一個C語言寫的開源協議庫,它的本質是實現一個伺服器,可以用來在客戶端和伺服器之間相互傳輸視訊
2、OPRT庫的移植
- [ ] (1),準備原始碼
- 下載ortp原始碼:https://github.com/dmonakhov/ortp
- [ ] (2),存放到臨時工作目錄並解壓
- ortp原始碼在Windows電腦中的E:\winshare\HI3518EV200\ortp-master中
- [ ] (3), 將ortp-master放入Ubuntu的特定目錄中並解壓:
- cd ~/sambashare/
- cp /mnt/hgfs/winshare/HI3518EV200/ortp-master.zip ./
- unzip ortp-master.zip
- [ ] (4),修改原始碼:增加H.264的payload支援
- cd ortp-master/
- cd src/
- sudo vi avprofile.c
-
- 在src/avprofile.c中357行新增:
-
- rtp_profile_set_payload(profile,96,&payload_type_h264);
- [ ] (5),執行./autogen.sh,配置預設的編譯環境
- 錯誤1:./autogen.sh: line 44: libtoolize: command not found
-
- 解決:sudo aptitude install libtool*
-
- 擴充套件:GNU Libtool 可以容易的在不同的系統中建立動態連結庫。它通過一個稱為 Libtool 庫的抽象,隱藏了不同系統之間的差異,給開發人員提供了一致的的介面。
- 錯誤2:libtoolize: error: Please install GNU M4, or 'export M4=/path/to/gnu/m4'.
-
- 解決:sudo apt-get install m4
-
- 解決:sudo aptitude install m4
-
- 擴充套件:M4是一個巨集處理器,將輸入拷貝到輸出,同時將巨集展開。巨集可以是內嵌的也可以是使用者定義的。除了可以展開巨集,M4還有一些內建的函式,用來引用檔案,執行Unix命令,整數運算,文字操作,迴圈等。M4既可以作為編譯器的前端也可以單獨作為一個巨集處理器。
- 錯誤3:Automake - aclocal: command not found
-
- 解決:sudo apt-get install automake
-
- 擴充套件:主要用於建立makefile
- [ ] (6),執行./configure --prefix=/tmp/ortp --host=arm-hisiv300-linux 【--host=arm-hisiv300-linux指定了交叉編譯工具鏈,所以工具鏈一定要安裝好】,配置特定的編譯環境
-
[ ] (7),執行make && make install,編譯ORTP庫
- [ ] (8),到/tmp/ortp目錄下檢視移植好的庫和標頭檔案
- cd /tmp/ortp/
- ls 【include lib】
- ls lib/ 【有.so,.la之類的檔案】
- ls ../include/ortp/ 【有很多.h檔案】
3、OPRT庫原始碼分析
3.1 ORTP庫原始碼概覽
(1) OPTP庫裡面最關鍵的是include,src和src/test這三個資料夾,相應的資料結構和標頭檔案存放在include/ortp目錄下;src裡面實現了一些功能函式[無main];src/test是示例程式碼
(2)ORTP庫實現了RTP和RTCP協議,前者複製傳輸視訊,或者負載視訊傳輸的質量[控制,同步,協調等]
3.2 OPTP庫API使用
https://blog.csdn.net/bill611/article/details/77726429
1、ORTP的引入
為什麼要使用RTP:http://blog.51cto.com/ticktick/462746
RTP協議分析:http://www.xuebuyuan.com/739929.html
總結:OPTP是一個C語言寫的開源協議庫,它的本質是實現一個伺服器,可以用來在客戶端和伺服器之間相互傳輸視訊
2、OPRT庫的移植
- [ ] (1),準備原始碼
- 下載ortp原始碼:https://github.com/dmonakhov/ortp
- [ ] (2),存放到臨時工作目錄並解壓
- ortp原始碼在Windows電腦中的E:\winshare\HI3518EV200\ortp-master中
- [ ] (3), 將ortp-master放入Ubuntu的特定目錄中並解壓:
- cd ~/sambashare/
- cp /mnt/hgfs/winshare/HI3518EV200/ortp-master.zip ./
- unzip ortp-master.zip
- [ ] (4),修改原始碼:增加H.264的payload支援
- cd ortp-master/
- cd src/
- sudo vi avprofile.c
-
- 在src/avprofile.c中357行新增:
-
- rtp_profile_set_payload(profile,96,&payload_type_h264);
- [ ] (5),執行./autogen.sh,配置預設的編譯環境
- 錯誤1:./autogen.sh: line 44: libtoolize: command not found
-
- 解決:sudo aptitude install libtool*
-
- 擴充套件:GNU Libtool 可以容易的在不同的系統中建立動態連結庫。它通過一個稱為 Libtool 庫的抽象,隱藏了不同系統之間的差異,給開發人員提供了一致的的介面。
- 錯誤2:libtoolize: error: Please install GNU M4, or 'export M4=/path/to/gnu/m4'.
-
- 解決:sudo apt-get install m4
-
- 解決:sudo aptitude install m4
-
- 擴充套件:M4是一個巨集處理器,將輸入拷貝到輸出,同時將巨集展開。巨集可以是內嵌的也可以是使用者定義的。除了可以展開巨集,M4還有一些內建的函式,用來引用檔案,執行Unix命令,整數運算,文字操作,迴圈等。M4既可以作為編譯器的前端也可以單獨作為一個巨集處理器。
- 錯誤3:Automake - aclocal: command not found
-
- 解決:sudo apt-get install automake
-
- 擴充套件:主要用於建立makefile
- [ ] (6),執行./configure --prefix=/tmp/ortp --host=arm-hisiv300-linux 【--host=arm-hisiv300-linux指定了交叉編譯工具鏈,所以工具鏈一定要安裝好】,配置特定的編譯環境
-
[ ] (7),執行make && make install,編譯ORTP庫
- [ ] (8),到/tmp/ortp目錄下檢視移植好的庫和標頭檔案
- cd /tmp/ortp/
- ls 【include lib】
- ls lib/ 【有.so,.la之類的檔案】
- ls ../include/ortp/ 【有很多.h檔案】
3、OPRT庫原始碼分析
3.1 ORTP庫原始碼概覽
(1) OPTP庫裡面最關鍵的是include,src和src/test這三個資料夾,相應的資料結構和標頭檔案存放在include/ortp目錄下;src裡面實現了一些功能函式[無main];src/test是示例程式碼
(2)ORTP庫實現了RTP和RTCP協議,前者複製傳輸視訊,或者負載視訊傳輸的質量[控制,同步,協調等]