日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

【Android RTMP】RTMP 直播推流服务器搭建 ( Ubuntu 18.04.4 虚拟机 )

發布時間:2025/6/17 Ubuntu 57 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Android RTMP】RTMP 直播推流服务器搭建 ( Ubuntu 18.04.4 虚拟机 ) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文章目錄

  • 安卓直播推流專欄博客總結
  • 一、 Android RTMP 直播推流簡介
  • 二、 Nginx、RTMP Module 編譯環境源碼準備
  • 三、 pcre、OpenSSL、zlib 函數庫安裝
  • 四、 編譯安裝 Nginx
  • 五、 配置 RTMP
  • 六、 修改 Nginx 和 RTMP Module 權限
  • 七、 虛擬機網絡配置
  • 八、 啟動 Nginx 服務器





安卓直播推流專欄博客總結



Android RTMP 直播推流技術專欄 :


0 . 資源和源碼地址 :

  • 資源下載地址 : 資源下載地址 , 服務器搭建 , x264 , faac , RTMPDump , 源碼及交叉編譯庫 , 本專欄 Android 直播推流源碼 ;
  • GitHub 源碼地址 : han1202012 / RTMP_Pusher

1. 搭建 RTMP 服務器 : 下面的博客中講解了如何在 VMWare 虛擬機中搭建 RTMP 直播推流服務器 ;

  • 【Android RTMP】RTMP 直播推流服務器搭建 ( Ubuntu 18.04.4 虛擬機 )

2. 準備視頻編碼的 x264 編碼器開源庫 , 和 RTMP 數據包封裝開源庫 :

  • 【Android RTMP】RTMPDumb 源碼導入 Android Studio ( 交叉編譯 | 配置 CMakeList.txt 構建腳本 )

  • 【Android RTMP】Android Studio 集成 x264 開源庫 ( Ubuntu 交叉編譯 | Android Studio 導入函數庫 )

3. 講解 RTMP 數據包封裝格式 :

  • 【Android RTMP】RTMP 數據格式 ( FLV 視頻格式分析 | 文件頭 Header 分析 | 標簽 Tag 分析 | 視頻標簽 Tag 數據分析 )

  • 【Android RTMP】RTMP 數據格式 ( FLV 視頻格式分析 | AVC 序列頭格式解析 )

4. 圖像數據采集 : 從 Camera 攝像頭中采集 NV21 格式的圖像數據 , 并預覽該數據 ;

  • 【Android RTMP】Android Camera 視頻數據采集預覽 ( 視頻采集相關概念 | 攝像頭預覽參數設置 | 攝像頭預覽數據回調接口 )

  • 【Android RTMP】Android Camera 視頻數據采集預覽 ( NV21 圖像格式 | I420 圖像格式 | NV21 與 I420 格式對比 | NV21 轉 I420 算法 )

  • 【Android RTMP】Android Camera 視頻數據采集預覽 ( 圖像傳感器方向設置 | Camera 使用流程 | 動態權限申請 )

5. NV21 格式的圖像數據編碼成 H.264 格式的視頻數據 :

  • 【Android RTMP】x264 編碼器初始化及設置 ( 獲取 x264 編碼參數 | 編碼規格 | 碼率 | 幀率 | B幀個數 | 關鍵幀間隔 | 關鍵幀解碼數據 SPS PPS )

  • 【Android RTMP】x264 圖像數據編碼 ( Camera 圖像數據采集 | NV21 圖像數據傳到 Native 處理 | JNI 傳輸字節數組 | 局部引用變量處理 | 線程互斥 )

  • 【Android RTMP】x264 圖像數據編碼 ( NV21 格式中的 YUV 數據排列 | Y 灰度數據拷貝 | U 色彩值數據拷貝 | V 飽和度數據拷貝 | 圖像編碼操作 )

6. 將 H.264 格式的視頻數據封裝到 RTMP 數據包中 :

  • 【Android RTMP】RTMPDump 封裝 RTMPPacket 數據包 ( 封裝 SPS / PPS 數據包 )

  • 【Android RTMP】RTMPDump 封裝 RTMPPacket 數據包 ( 關鍵幀數據格式 | 非關鍵幀數據格式 | x264 編碼后的數據處理 | 封裝 H.264 視頻數據幀 )

  • 【Android RTMP】RTMPDump 推流過程 ( 獨立線程推流 | 創建推流器 | 初始化操作 | 設置推流地址 | 啟用寫出 | 連接 RTMP 服務器 | 發送 RTMP 數據包 )

7. 階段總結 : 阿里云服務器中搭建 RTMP 服務器 , 并使用電腦軟件推流和觀看直播內容 ;

  • 【Android RTMP】RTMP 直播推流 ( 阿里云服務器購買 | 遠程服務器控制 | 搭建 RTMP 服務器 | 服務器配置 | 推流軟件配置 | 直播軟件配置 | 推流直播效果展示 )

  • 【Android RTMP】RTMP 直播推流階段總結 ( 服務器端搭建 | Android 手機端編碼推流 | 電腦端觀看直播 | 服務器狀態查看 )

8. 處理 Camera 圖像傳感器導致的 NV21 格式圖像旋轉問題 :

  • 【Android RTMP】NV21 圖像旋轉處理 ( 問題描述 | 圖像順時針旋轉 90 度方案 | YUV 圖像旋轉細節 | 手機屏幕旋轉方向 )

  • 【Android RTMP】NV21 圖像旋轉處理 ( 圖像旋轉算法 | 后置攝像頭順時針旋轉 90 度 | 前置攝像頭順時針旋轉 90 度 )

9. 下面這篇博客比較重要 , 里面有一個快速搭建 RTMP 服務器的腳本 , 強烈建議使用 ;

  • 【Android RTMP】NV21 圖像旋轉處理 ( 快速搭建 RTMP 服務器 Shell 腳本 | 創建 RTMP 服務器鏡像 | 瀏覽器觀看直播 | 前置 / 后置攝像頭圖像旋轉效果展示 )

10. 編碼 AAC 音頻數據的開源庫 FAAC 交叉編譯與 Android Studio 環境搭建 :

  • 【Android RTMP】音頻數據采集編碼 ( 音頻數據采集編碼 | AAC 高級音頻編碼 | FAAC 編碼器 | Ubuntu 交叉編譯 FAAC 編碼器 )

  • 【Android RTMP】音頻數據采集編碼 ( FAAC 頭文件與靜態庫拷貝到 AS | CMakeList.txt 配置 FAAC | AudioRecord 音頻采樣 PCM 格式 )

11. 解析 AAC 音頻格式 :

  • 【Android RTMP】音頻數據采集編碼 ( AAC 音頻格式解析 | FLV 音頻數據標簽解析 | AAC 音頻數據標簽頭 | 音頻解碼配置信息 )

12 . 將麥克風采集的 PCM 音頻采樣編碼成 AAC 格式音頻 , 并封裝到 RTMP 包中 , 推流到客戶端 :

  • 【Android RTMP】音頻數據采集編碼 ( FAAC 音頻編碼參數設置 | FAAC 編碼器創建 | 獲取編碼器參數 | 設置 AAC 編碼規格 | 設置編碼器輸入輸出參數 )

  • 【Android RTMP】音頻數據采集編碼 ( FAAC 編碼器編碼 AAC 音頻解碼信息 | 封裝 RTMP 音頻數據頭 | 設置 AAC 音頻數據類型 | 封裝 RTMP 數據包 )

  • 【Android RTMP】音頻數據采集編碼 ( FAAC 編碼器編碼 AAC 音頻采樣數據 | 封裝 RTMP 音頻數據頭 | 設置 AAC 音頻數據類型 | 封裝 RTMP 數據包 )








一、 Android RTMP 直播推流簡介



Android 端直播推流原理 :


① 數據采集 : 使用 Camera 相機采集圖像數據 , 使用 AudioRecord 采集聲音 ;

② 數據編碼 : 將圖像和聲音分別進行編碼 , 視頻使用 H.264 格式進行編碼 , 音頻使用 AAC 格式進行編碼 ;

③ 數據打包 : 將 H.264 格式的視頻數據 , 和 AAC 格式的音頻數據 , 打包為 RTMP 格式的數據包 ;

④ 數據發送 : 將上述 RTMP 數據包發送到流媒體服務器 ;





二、 Nginx、RTMP Module 編譯環境源碼準備



需要在 Linux 服務器中搭建 NGINX RTMP 服務器 , 下面是搭建 NGINX RTMP 流媒體服務器環境及源碼準備 ;



1 . 下載 nginx 源碼 : 到 NGINX 服務器下載地址 下載 nginx 源碼 , 也可以點擊此處 , 直接 下載源碼 ;


2 . 下載 nginx rtmp 服務器應用 : arut/nginx-rtmp-module , 不要直接下載測試或者不穩定版本 , 下載其發布版本 , 點擊 Releases 查看 發布版本 , 這里選擇 v1.2.1 發布版本 進行下載 ;


3 . 編譯環境準備 : 下載完畢后 , 在 Ubuntu 的 root 用戶目錄下 , 創建 rtmp 目錄 , 將兩個包拷貝到 rtmp 目錄中 , nginx 服務器與 nginx-rtmp-module 在該目錄下進行編譯安裝 ;


4 . 解壓源碼 :


① 解壓 nginx 源碼 : tar xvf nginx-1.15.3.tar.gz ;

② 解壓 nginx-rtmp-module 源碼 : tar xvf nginx-rtmp-module-1.2.1.tar.gz ;





三、 pcre、OpenSSL、zlib 函數庫安裝



1 . 查看編譯配置 : ./configure --help 可以查看編譯配置選項 ;

root@octopus:~/rtmp# cd nginx-1.15.3 root@octopus:~/rtmp/nginx-1.15.3# ls auto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src root@octopus:~/rtmp/nginx-1.15.3# ./configure --help--help print this message--prefix=PATH set installation prefix... --add-module=PATH enable external module...--with-debug enable debug loggingroot@octopus:~/rtmp/nginx-1.15.3#



2 . 使用到的編譯配置 :


① – prefix=PATH : 代碼編譯后的安裝目錄 ;

② – add-module=PATH : 啟用外部模塊 , 就是啟用 RTMP 模塊 ;



3 . 編譯配置 : 執行 ./configure --prefix=./bin --add-module=…/nginx-rtmp-module-1.2.1 命令 , 配置編譯選項 ;


① --prefix=./bin 配置 : 將編譯結果 , 安裝到當前目錄下的 bin 目錄 ;

② --add-module=…/nginx-rtmp-module-1.2.1 配置 : 啟用外部的 RTMP 直播推流模塊 ;



4 . 配置失敗 : the HTTP rewrite module requires the PCRE library , 下面安裝 PCRE 庫 ;

root@octopus:~/rtmp/nginx-1.15.3# ./configure --prefix=./bin --add-module=../nginx-rtmp-module-1.2.1 checking for OS+ Linux 5.3.0-28-generic x86_64 checking for C compiler ... found+ using GNU C compiler+ gcc version: 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) ... 省略1萬行configuring additional modules adding module in ../nginx-rtmp-module-1.2.1+ ngx_rtmp_module was configured checking for PCRE library ... not found checking for PCRE library in /usr/local/ ... not found checking for PCRE library in /usr/include/pcre/ ... not found checking for PCRE library in /usr/pkg/ ... not found checking for PCRE library in /opt/local/ ... not found./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.root@octopus:~/rtmp/nginx-1.15.3#

5 . 更新 apt-get 源 : 源 存儲在 /etc/apt/sources.list 文件中 ;


① 備份源 :

mv /etc/apt/sources.list /etc/apt/sourses.list.backup

② 添加源 : 創建 /etc/apt/sources.list 文件 , 并將下面的內容拷貝到其中 ; 這是 163 網易提供的源 ;

deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

③ 更新源 :

sudo apt-get update

6 . 安裝 pcre : 執行 sudo apt-get install libpcre3 libpcre3-dev 命令 , 安裝成功 ;

root@octopus:~/rtmp/nginx-1.15.3# sudo apt-get install libpcre3 libpcre3-dev

7 . 再次執行編譯配置選項 : 執行 ./configure --prefix=./bin --add-module=…/nginx-rtmp-module-1.2.1 命令 , 報錯 SSL modules require the OpenSSL library , 繼續安裝 OpenSSL 庫 ;

root@octopus:~/rtmp/nginx-1.15.3# ./configure --prefix=./bin --add-module=../nginx-rtmp-module-1.2.1 checking for OS+ Linux 5.3.0-28-generic x86_64 checking for C compiler ... found+ using GNU C compiler+ gcc version: 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) ... 省略1萬行configuring additional modules adding module in ../nginx-rtmp-module-1.2.1+ ngx_rtmp_module was configured checking for PCRE library ... found checking for PCRE JIT support ... found checking for OpenSSL library ... not found checking for OpenSSL library in /usr/local/ ... not found checking for OpenSSL library in /usr/pkg/ ... not found checking for OpenSSL library in /opt/local/ ... not found./configure: error: SSL modules require the OpenSSL library. You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-openssl=<path> option.root@octopus:~/rtmp/nginx-1.15.3#

8 . 安裝 OpenSSL 庫 :

sudo apt-get install openssl libssl-dev

9 . 繼續嘗試配置 : 報錯 the HTTP gzip module requires the zlib library , 缺少 zlib 庫 , 繼續安裝 zlib 庫 ;

root@octopus:~/rtmp/nginx-1.15.3# ./configure --prefix=./bin --add-module=../nginx-rtmp-module-1.2.1 checking for OS+ Linux 5.3.0-28-generic x86_64 checking for C compiler ... found+ using GNU C compiler+ gcc version: 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) ... 省略configuring additional modules adding module in ../nginx-rtmp-module-1.2.1+ ngx_rtmp_module was configured checking for PCRE library ... found checking for PCRE JIT support ... found checking for OpenSSL library ... found checking for zlib library ... not found./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib=<path> option.

10 . 安裝 zlib 庫 : sudo apt-get install zlib1g-dev ;

sudo apt-get install zlib1g-dev

11 . 繼續嘗試配置 : 這會成功了 , 可以開始編譯了 ;

root@octopus:~/rtmp/nginx-1.15.3# ./configure --prefix=./bin --add-module=../nginx-rtmp-module-1.2.1 checking for OS+ Linux 5.3.0-28-generic x86_64 checking for C compiler ... found+ using GNU C compiler+ gcc version: 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) checking for gcc -pipe switch ... found checking for -Wl,-E switch ... found... 省略configuring additional modules adding module in ../nginx-rtmp-module-1.2.1+ ngx_rtmp_module was configured checking for PCRE library ... found checking for PCRE JIT support ... found checking for OpenSSL library ... found checking for zlib library ... found creating objs/MakefileConfiguration summary+ using system PCRE library+ using system OpenSSL library+ using system zlib librarynginx path prefix: "./bin"nginx binary file: "./bin/sbin/nginx"nginx modules path: "./bin/modules"nginx configuration prefix: "./bin/conf"nginx configuration file: "./bin/conf/nginx.conf"nginx pid file: "./bin/logs/nginx.pid"nginx error log file: "./bin/logs/error.log"nginx http access log file: "./bin/logs/access.log"nginx http client request body temporary files: "client_body_temp"nginx http proxy temporary files: "proxy_temp"nginx http fastcgi temporary files: "fastcgi_temp"nginx http uwsgi temporary files: "uwsgi_temp"nginx http scgi temporary files: "scgi_temp"root@octopus:~/rtmp/nginx-1.15.3#

12 . 總結 : 這里總結下上面的坑 , 巨坑 , 百度了半小時 ;


① 需要安裝的庫 : pcre、OpenSSL、zlib ;

② 相應的安裝命令 :

sudo apt-get install libpcre3 libpcre3-dev sudo apt-get install openssl libssl-dev sudo apt-get install zlib1g-dev



四、 編譯安裝 Nginx



1 . 生成的 Makefile 文件 : 上面執行完 ./configure --prefix=./bin --add-module=…/nginx-rtmp-module-1.2.1 命令后 , 會生成 Makefile 文件 ;



2 . 編譯安裝 : 執行 make install 進行編譯安裝 , 執行完畢后 , 生成 bin 目錄 , 編譯生成的文件都安裝在這里 ;



3 . 查看 bin 目錄 : bin 目錄下生成了 444 個文件 ;


① conf : 服務器配置腳本目錄 , 有很多配置腳本 ;

② html : HTTP 網頁放在這里 ;

③ logs : 存放日志 ;

④ sbin : 可執行文件 ;





五、 配置 RTMP



1 . 配置 conf/nginx.conf 腳本 : Nginx 服務器默認是沒有 RTMP 功能的 , 需要手動配置 , 這里就需要在 conf/nginx.conf 腳本中進行配置 ;



2 . Nginx RTMP 配置示例 : 在 nginx-rtmp-module-1.2.1/test 目錄下 , 有一個 nginx.conf 配置文件 , 該配置文件提供了 Nginx 服務器中的 RTMP 配置方法 , 僅做參考 ;

worker_processes 1;error_log logs/error.log debug;events {worker_connections 1024; }rtmp {server {listen 1935;application myapp {live on;#record keyframes;#record_path /tmp;#record_max_size 128K;#record_interval 30s;#record_suffix .this.is.flv;#on_publish http://localhost:8080/publish;#on_play http://localhost:8080/play;#on_record_done http://localhost:8080/record_done;}} }http {server {listen 8080;location /stat {rtmp_stat all;rtmp_stat_stylesheet stat.xsl;}location /stat.xsl {root /path/to/nginx-rtmp-module/;}location /control {rtmp_control all;}#location /publish {# return 201;#}#location /play {# return 202;#}#location /record_done {# return 203;#}location /rtmp-publisher {root /path/to/nginx-rtmp-module/test;}location / {root /path/to/nginx-rtmp-module/test/www;}} }

3 . RTMP 配置模塊 : 下面是專門配置 RTMP 的模塊 ;


① server : 表示服務器 ;

② listen 1935 : 表示其監聽 1935 端口號 , HTTP 協議默認端口是 80, RTMP 協議的默認端口是 1935 ;

③ application myapp : 對應 RTMP 地址中的應用 , 如下所示 ;

④ live on : 啟動直播 ;

⑤ drop_idle_publisher 5s : 閑置 5 秒以上的連接會被丟棄 ;

⑥ RTMP 地址示例 : rtmp://192.168.1.15:1935/myapp ;

//RTMP 地址格式 rtmp://IP地址:端口號/應用名稱

⑦ RTMP 配置示例 :

rtmp {server {listen 1935;application myapp {live on;drop_idle_publisher 5s;#record keyframes;#record_path /tmp;#record_max_size 128K;#record_interval 30s;#record_suffix .this.is.flv;#on_publish http://localhost:8080/publish;#on_play http://localhost:8080/play;#on_record_done http://localhost:8080/record_done;}} }

4 . HTTP 模塊配置 : 需要修改 333 個位置 , /path/to/nginx-rtmp-module/ 替換為真實的 nginx-rtmp-module 目錄 , 即 /root/rtmp/nginx-rtmp-module-1.2.1/

http {server {listen 8080;location /stat {rtmp_stat all;rtmp_stat_stylesheet stat.xsl;}location /stat.xsl {#root /path/to/nginx-rtmp-module/;root /root/rtmp/nginx-rtmp-module-1.2.1/;}location /control {rtmp_control all;}#location /publish {# return 201;#}#location /play {# return 202;#}#location /record_done {# return 203;#}location /rtmp-publisher {#root /path/to/nginx-rtmp-module/test;root /root/rtmp/nginx-rtmp-module-1.2.1/test;}location / {#root /path/to/nginx-rtmp-module/test/www;root /root/rtmp/nginx-rtmp-module-1.2.1/test/www;}} }

5 . 端口檢查 : 該 Nginx RTMP 服務器啟動后 , 需要使用 8080 和 1935 兩個端口 , 確保這兩個端口可以使用 ;

lsof -i:8080 lsof -i:1935

6 . 最終配置文件 : user root; 是必須的 , 如果在 root 用戶下啟動 Nginx , 必須配置該選項 ; 非 root 用戶啟動 Nginx 服務器 , 配置 user nobody;

user root; worker_processes 1;error_log logs/error.log debug;events {worker_connections 1024; }rtmp {server {listen 1935;application myapp {live on;}} }http {server {listen 8080;location /stat {rtmp_stat all;rtmp_stat_stylesheet stat.xsl;}location /stat.xsl {root /root/rtmp/nginx-rtmp-module-1.2.1/;}location /control {rtmp_control all;}location /rtmp-publisher {root /root/rtmp/nginx-rtmp-module-1.2.1/test;}location / {root /root/rtmp/nginx-rtmp-module-1.2.1/test/www;}} }



六、 修改 Nginx 和 RTMP Module 權限



啟動時出現 403 錯誤 , 懷疑是文件權限不足 , 這里將 nginx-1.15.3 和 nginx-rtmp-module-1.2.1 賦予所有的權限 ;

root@octopus:~/rtmp# chmod -R 777 nginx-1.15.3 root@octopus:~/rtmp# chmod -R 777 nginx-rtmp-module-1.2.1



七、 虛擬機網絡配置



配置虛擬機網絡 : 使用 橋接模式 , 這樣虛擬機相當于局域網中的一個服務器 , 局域網內的手機可以與該服務器 ( 虛擬機 ) 通信 ;





八、 啟動 Nginx 服務器



1 . Nginx 服務器路徑 : /root/rtmp/nginx-1.15.3/bin/sbin/nginx



2 . 啟動 Nginx 服務器 : 需要在 nginx-1.15.3 目錄下啟動 , 因為要查找 logs/error.log 日志文件 , 只有在該目錄下 , 才能按照 logs/error.log 路徑查找到該錯誤日志文件 ;

root@octopus:~/rtmp/nginx-1.15.3# bin/ conf/ html/ logs/ sbin/ root@octopus:~/rtmp/nginx-1.15.3# bin/sbin/nginx root@octopus:~/rtmp/nginx-1.15.3#

3 . 啟動失敗示例 : 在 nginx-1.15.3/bin 目錄下啟動 , 報錯信息 ;

root@octopus:~/rtmp/nginx-1.15.3/bin# ./sbin/nginx nginx: [alert] could not open error log file: open() "./bin/logs/error.log" failed (2: No such file or directory) 2020/06/08 23:22:02 [emerg] 79171#0: open() "./bin/conf/nginx.conf" failed (2: No such file or directory) root@octopus:~/rtmp/nginx-1.15.3/bin#

4 . 啟動后查看端口號 :


lsof -i:1935 命令 , 查看當前 1935 端口的應用 ;

lsof -i:8080 命令 , 查看當前 8080 端口命令 ;

root@octopus:~/rtmp/nginx-1.15.3# /root/rtmp/nginx-1.15.3/bin/sbin/nginx root@octopus:~/rtmp/nginx-1.15.3# lsof -i:1935 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nginx 86054 root 6u IPv4 277762 0t0 TCP *:1935 (LISTEN) nginx 86055 root 6u IPv4 277762 0t0 TCP *:1935 (LISTEN) root@octopus:~/rtmp/nginx-1.15.3# lsof -i:8080 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nginx 86054 root 7u IPv4 277763 0t0 TCP *:http-alt (LISTEN) nginx 86055 root 7u IPv4 277763 0t0 TCP *:http-alt (LISTEN) root@octopus:~/rtmp/nginx-1.15.3#

5 . 瀏覽器訪問 RTMP 服務器端 : 在瀏覽器端訪問 虛擬機中的 RTMP 服務器 , 地址是 http://192.168.1.15:8080/ ;

總結

以上是生活随笔為你收集整理的【Android RTMP】RTMP 直播推流服务器搭建 ( Ubuntu 18.04.4 虚拟机 )的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。