Ubuntu 10.04下架設流媒體服務器

Ubuntu 10.04下架設流媒體服務器

我的建議:使用DarwinStreamingSrvr5.5.5,由於DarwinStreamingSrvr6.0.3安裝過程當中有不少問題須要解決!html

目前主流的流媒體服務器有微軟的windows media server、RealNetworks的Helix server和蘋果公司的Darwin Streaming Server. 微軟的windows media server只能在windows 2000 server和windows 2003 server下使用,不在考慮之列。RealNetworks的Helix server是一款跨平臺的軟件,功能也很強大,但並不是免費軟件,只能cut掉了。蘋果公司的Darwin Streaming Server是一款跨平臺的開源流媒體服務器軟件,由蘋果公司出品,其品質不用懷疑了,並且還免費。因此在架設流媒體服務器時就選擇了Darwin Streaming Server.linux

Darwin Streaming Server使用標準的實時傳輸協議/實時流媒體協議 (RTP/RTSP),經過互聯網實時傳送媒體。Darwin Streaming Server 也能提供對傳送 H.26四、MPEG-4 和 3GPP 文件的固有支持——所以,你能夠在 Mac 和 Linux、Windows 上的任何與標準兼容的媒體播放器上執行你的內容,固然還包括手機和接收盒等各類兼容標準的設備。不只如此,它還容許你使用 Icecast 兼容協議,經過 HTTP 傳送標準的 MP3 文件到 MP3 客戶端。web

1、軟件安裝macos

首先上http://dss.macosforge.org/下載源代碼,當前最新版本爲6.0.3,但我選擇了5.5.5版本,由於這個版本提供了針對 linux的安裝腳本。下載了DarwinStreamingSrvr5.5.5-Linux.tar.gz文件後,解壓縮,而後運行以下命令安裝:windows

~/tmp/DarwinStreamingSrvrlinux-Linux$ chmod +x Install
~/tmp/DarwinStreamingSrvrlinux-Linux$ sudo ./Install
[sudo] password for kh:瀏覽器

Installing Darwin Streaming Server安全

Checking for and Killing currently running Darwin Streaming Server
Warning: bad ps syntax, perhaps a bogus ‘-’? See http://procps.sf.net/faq.html
Warning: bad ps syntax, perhaps a bogus ‘-’? See http://procps.sf.net/faq.html
Removing previous versions of Darwin Streaming Server服務器

Backing up previous config filesui

Inserting path to perl into scripts..spa

Creating unprivileged user to run the server = 「qtss」.
copying DarwinStreamingServer to /usr/local/sbin/DarwinStreamingServer
copying PlaylistBroadcaster to /usr/local/bin/PlaylistBroadcaster
copying MP3Broadcaster to /usr/local/bin/MP3Broadcaster
copying qtpasswd to /usr/local/bin/qtpasswd
creating /usr/local/sbin/StreamingServerModules directory
copying createuserstreamingdir to /usr/local/bin/createuserstreamingdir
creating /etc/streaming directory
Generating a new prefs file at /etc/streaming/streamingserver.xml
INFO: Module Loaded…QTSSRefMovieModule [dynamic]
INFO: Module Loaded…QTSSHomeDirectoryModule [dynamic]
INFO: Module Loaded…QTSSFileModule [static]
INFO: Module Loaded…QTSSReflectorModule [static]
INFO: Module Loaded…QTSSRelayModule [static]
INFO: Module Loaded…QTSSAccessLogModule [static]
INFO: Module Loaded…QTSSFlowControlModule [static]
INFO: Module Loaded…QTSSPosixFileSysModule [static]
INFO: Module Loaded…QTSSAdminModule [static]
INFO: Module Loaded…QTSSMP3StreamingModule [static]
INFO: Module Loaded…QTSSAccessModule [static]
WARNING: No users file found at /etc/streaming/qtusers.
WARNING: No groups file found at /etc/streaming/qtgroups.
chown: invalid user: `qtss’

copying relayconfig.xml-Sample to /etc/streaming/relayconfig.xml-Sample

copying qtusers to /etc/streaming/qtusers
chown: invalid user: `qtss’

copying qtgroups to /etc/streaming/qtgroups
chown: invalid user: `qtss’
copying readme.txt to /var/streaming/readme.txt
copying 3rdPartyAcknowledgements.rtf to /var/streaming/3rdPartyAcknowledgements.rtf
creating /usr/local/movies directory
creating /var/streaming/playlists directory
copying sample_100kbit.mov into /usr/local/movies/sample_100kbit.mov
copying sample_300kbit.mov into /usr/local/movies/sample_300kbit.mov
copying sample_100kbit.mp4 into /usr/local/movies/sample_100kbit.mp4
copying sample_300kbit.mp4 into /usr/local/movies/sample_300kbit.mp4
copying sample.mp3 into /usr/local/movies/sample.mp3
copying sample_50kbit.3gp into /usr/local/movies/sample_50kbit.3gp
copying sample_h264_100kbit.mp4 into /usr/local/movies/sample_h264_100kbit.mp4
copying sample_h264_300kbit.mp4 into /usr/local/movies/sample_h264_300kbit.mp4
copying sample_h264_1mbit.mp4 into /usr/local/movies/sample_h264_1mbit.mp4
copying StreamingLoadTool to /usr/local/bin/StreamingLoadTool
copying streamingloadtool.conf to /etc/streaming/streamingloadtool.conf
copying streamingadminserver.pl into /usr/local/sbin/streamingadminserver.pl
copying Admin HTML to /var/streaming/AdminHtml directory
chown: invalid user: `qtss’
chown: invalid user: `qtss’
chown: invalid user: `qtss’

Launching streamingadminserver.pl
Cannot switch to group qtss

Installation Complete

Darwin Streaming Server Setup

In order to administer the Darwin Streaming Server you must create an administrator user [Note: The administrator user name cannot contain spaces, or single or double quote characters, and cannot be more than 255 characters long].
Please enter a new administrator user name: keensword007

You must also enter a password for the administrator user [Note: The administrator password cannot contain spaces, or quotes, either single or double, and cannot be more than 80 characters long].
Please enter a new administrator Password:
Re-enter the new administrator password:
Adding userName keensword007
chown: invalid user: `qtss’
Setup Complete!

從提示信息上看,應該是qtss用戶未能建立形成的,查看了一下Install腳本,發現建立用戶的腳本是這樣的:

if [ $INSTALL_OS = "Linux" ]; then
/usr/sbin/useradd -M qtss > /dev/null 2>&1
else
/usr/sbin/useradd qtss > /dev/null 2>&1
fi
可是useradd並無-M的命令行參數,應該爲-m,將-M修改爲-m後,再執行Install腳本,安裝成功。此時服務已經啓動,可使用以下命令肯定服務是否已經啓動:

~/tmp/DarwinStreamingSrvrlinux-Linux$ ps aux | grep Darwin

root     10963  0.0  0.0   4368   456 ?        Ss   21:23   0:00 /usr/local/sbin/DarwinStreamingServer
qtss     10964  0.0  0.0  38032  2456 ?        Sl   21:23   0:00 /usr/local/sbin/DarwinStreamingServer
1000     11003  0.0  0.0   3004   760 pts/1    R+   21:24   0:00 grep Darwin

若是但願機器啓動後自動運行流媒體服務器,輸入以下命令:

~/tmp/DarwinStreamingSrvrlinux-Linux$ cd /etc/rc3.d

/etc/rc3.d$ sudo ln -s /usr/local/sbin/streamingadminserver.pl s20streamingserver

。若是要手動啓動服務,運行streamingadminserver.pl程序。

2、配置

Darwin Streaming Server採用了web管理模式,能夠在本機的瀏覽器中輸入:http://127.0.0.1:1220 。而後輸入在安裝流媒體服務器時設置的用戶名稱和密碼。

第一次登陸時,接着會出現設置嚮導。首先是一個如圖所示的MP3 廣播密碼設置對話框,在其「New Password」和「Re-enter New Password」輸入本身想設置的密碼。而後點擊「Next」按鈕繼續。

爲了保證數據傳輸的安全須要您能夠在這裏鉤選「Secure Administration(SSL)」(安全管理),前提是您已經有了可用的SSL 證書。通常能夠不選,如圖 所示。直接點擊「Next」按鈕繼續。

接下來要設置的是媒體文件的存放主目錄, 其默認的目錄爲「如圖所示。這個目錄要記住,在服務器中之後添加媒體文件時就要加在這個目錄中。設置完畢點擊「Next」按鈕繼續。

最後設置默認傳輸端口,若是設置了「Streaming on Port 80」則此服務器的訪問能夠突破防火牆,但若是您在此服務器上同時建有Apache 等佔用80 端口的服務。則建議您不要設置此端口。這裏若是您沒有什麼特殊要求的話,使用缺省配置便可,如圖9 所示。直接點擊「Finish」按鈕。

自此流媒體服務器的設置就告一段落,若是您要做進一步的設置,能夠經過此管理頁面,在其左側點擊相應的選項,進行設置。也能夠經過此對前面所作的設置進行更改。

3、在線播放

流媒體服務器部署完畢後,咱們就可使用本身喜歡的播放器在線播放了。例如,在本機上打開Movie Player, 在地址欄輸入:

rtsp://127.0.0.1/sample_100kbit.mp4

就能夠看到一段QuickTime演示視頻。

相關文章
相關標籤/搜索