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: RTMP
CentOS 快速安裝 Nginx with RTMP module
跟 之前裝在Ubuntu的那一篇 一樣 都是沒有設定stat的部分, 需要在另外修改 大致上跟Ubuntu的方式都相同 只是要注意的為 init script 可不可正常進行 測試的範例中是修改 nginx.conf 將 pid 那一行給取消註腳
1 |
pid logs/nginx.pid; |
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 33 34 35 36 37 38 39 40 |
#!/bin/sh yum groupinstall 'Development Tools' -y yum install pcre pcre-devel openssl-devel libxslt-devel -y cd /tmp wget http://nginx.org/download/nginx-1.7.3.tar.gz wget https://github.com/arut/nginx-rtmp-module/archive/master.zip tar -zxvf nginx-1.7.3.tar.gz yum install unzip -y 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 cp /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.bak echo " " >> /usr/local/nginx/conf/nginx.conf echo "rtmp {" >> /usr/local/nginx/conf/nginx.conf echo " server {" >> /usr/local/nginx/conf/nginx.conf echo " listen 1935;" >> /usr/local/nginx/conf/nginx.conf echo " chunk_size 4096;" >> /usr/local/nginx/conf/nginx.conf echo " " >> /usr/local/nginx/conf/nginx.conf echo " application live {" >> /usr/local/nginx/conf/nginx.conf echo " live on;" >> /usr/local/nginx/conf/nginx.conf echo " record off;" >> /usr/local/nginx/conf/nginx.conf echo " #allow publish 127.0.0.1;" >> /usr/local/nginx/conf/nginx.conf echo " #deny publish all;" >> /usr/local/nginx/conf/nginx.conf echo " #allow play 127.0.0.1;" >> /usr/local/nginx/conf/nginx.conf echo " #deny play all;" >> /usr/local/nginx/conf/nginx.conf echo " }" >> /usr/local/nginx/conf/nginx.conf echo " }" >> /usr/local/nginx/conf/nginx.conf echo "}" >> /usr/local/nginx/conf/nginx.conf # 這邊直接使用放在網站上的檔案 # 請複製 http://wiki.nginx.org/RedHatNginxInitScript 中的檔案至 nignx 中 cd /etc/init.d/ vim nginx chmod +x nginx service nginx start # service nginx start|stop|reload |
Posted in CentOS, Nginx, RTMP
Leave a comment
Nginx RTMP Module Stat
將 RTMP 模組檔案解壓縮後的 stat.xsl 複製到網頁目錄
1 2 3 |
wget https://github.com/arut/nginx-rtmp-module/archive/master.zip unzip master.zip cp nginx-rtmp-module-master/stat.xsl /usr/local/nginx/html/. |
編輯 Nginx 設定檔,加入 stat 網頁設定
1 2 3 4 5 6 7 8 |
location /stat { rtmp_stat all; rtmp_stat_stylesheet stat.xsl; } location /stat.xsl { root html; } |
重新讀取設定檔 連結網頁 http://[ip]/stat 參考 : https://github.com/arut/nginx-rtmp-module
Posted in Nginx, RTMP
Leave a comment
Flash Media Server (RTMP Server)
基本上裝完就可以跑了!!! 主要設定如下 (以下以OBS產生Streaming為例) OBS設定 => 廣播 模式:直播串流 串流服務:Custom 伺服器:rtmp://[Flash Media Server 伺服器ip]:1935/livepkgr/ 播放路徑:[變數]?adbe-live-event=liveevent 這時後便可以透過連結 rtmp://[Flash Media Server 伺服器ip]/livepkgr/[變數] 進行播放
Posted in FMS, RTMP
Leave a comment
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