Categories
- FFMpeg (5)
- Libav (1)
- Google (3)
- iBeacon (1)
- LDAP (3)
- Me (2)
- Network (11)
- OS (149)
- RTMP (4)
- SIP (1)
- Kamailio (1)
- SNMP (1)
- VMware (20)
- VCP考試 (1)
- 伺服器 網站服務 (105)
- 名詞解釋 (4)
- 專案管理 (1)
- 工具軟體 (50)
- Adobe (1)
- FMS (1)
- Cloudera (1)
- Docker (1)
- Eclipse (4)
- Intellij (2)
- OBS (2)
- Office (10)
- Excel (4)
- PowerPoint (5)
- Postman (1)
- Splunk (13)
- Virtualbox (2)
- Visual Studio (2)
- 文字編輯器 (10)
- Sublime Text 2 (6)
- Sublime Text 3 (3)
- Vim (3)
- 連線工具 (1)
- Xshell (1)
- Adobe (1)
- 程式語言 (79)
- CSS (2)
- HTML (2)
- iOS (1)
- Java (30)
- JavaScript (5)
- jQuery (4)
- jsTree (2)
- JSP (3)
- PHP (16)
- Python (7)
- Ruby (1)
- sed (1)
- Shell Script (8)
- Windows Bash Script (1)
- XML (1)
- 資料庫 (37)
- FFMpeg (5)
Category Archives: Nginx
Install Nginx with RTMP module in Ubuntu 12.04 x64 LTS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# 安裝必要套件 apt-get install build-essential libpcre3 libpcre3-dev libssl-dev # 下載 tar 安裝檔案 cd /tmp wget http://nginx.org/download/nginx-1.7.3.tar.gz wget https://github.com/arut/nginx-rtmp-module/archive/master.zip # 安裝 nginx tar -zxvf nginx-1.7.3.tar.gz unzip master.zip cd nginx-1.7.3/ ./configure --with-http_ssl_module --with-http_xslt_module --add-module=../nginx-rtmp-module-master make make install # 編輯 nginx 設定檔案 vim /usr/local/nginx/conf/nginx.conf rtmp { server { listen 1935; chunk_size 4096; application live { live on; record off; } } } # 啟動 nginx service /usr/local/nginx/sbin/nginx |
此時可使用 OBS 傳送Stremaing進行測試 OBS設定 => 廣播 模式:直播串流 串流服務:Custom 伺服器:rtmp://[nginx 伺服器ip]/live 播放路徑:test 便可以透過VLC或是Flash player以下面連結進行播放 rtmp://[nginx 伺服器ip]/live 內嵌Flash Player的網頁範例如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Video.js RTMP Example - jsFiddle demo</title> <link rel="stylesheet" type="text/css" href="http://vjs.zencdn.net/4.2/video-js.css"> <script type='text/javascript' src="http://vjs.zencdn.net/4.2/video.js"></script> <style type='text/css'> </style> </head> <body> <video id="my_video_1" class="video-js vjs-default-skin" controls autoplay="autoplay" preload="auto" width="640" height="264" data-setup='{ "techOrder": ["flash"] }'> <source src="rtmp://<?php echo $_SERVER['SERVER_ADDR'];?>/live/<?php echo $_GET['name'];?>" type='rtmp/mp4'> </video> </body> </html> |
Posted in Nginx, RTMP, Ubuntu
Leave a comment