linux 安装流媒体服务器Darwin Streaming Server

近日在做一个关于Darwin Streaming Server的项目,在网上找了一些资料,按部就班的安装,可是总会出现些错误,后来找到了一篇英文的,一路顺风!下面将其摘要出来,亲测可行:
OK, so you don’t necessarily call rtsp on Ubuntu QuickTime Streaming Server. Instead, you call it Darwin Streaming Server (DSS). But the end result is basically what you have exposed in Mac OS X Server, but running on Linux. You don’t have the same functionality in Server Admin, but it does work. And the key to what it does is use the rtsp protocol to stream supported files from the server to clients. It is a little tougher than just clicking on the start button, but too much tougher provided you follow these directions (thanks to the good folks of the DSS list that I’ve been a member of for a few years for taking such good notes, making this much simpler to write when I just have to move from Ubuntu 7 to 10.04).

To get started (most all of this is going to need sudo or su), let’s use wget to download all the files that we’re going to need (except 1):

su
wget http://static.macosforge.org/dss/downloads/DarwinStreamingSrvr6.0.3-Source.tar
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-6.0.3.patch
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-hh-20080728-1.patch

Now let’s extract the tar file:

tar -xvf DarwinStreamingSrvr6.0.3-Source.tar

Now let’s create our qtss user and group:

addgroup -system qtss
adduser -system -no-create-home -ingroup qtss qtss

We’re going to need the build-essential package from apt-get, so let’s install that before moving on:

apt-get install build-essential

The base 6.0.3 installer was only built for Mac OS X, so let’s apply the patches we used wget to pull down:

patch -p0 < dss-6.0.3.patch
patch -p0 < dss-hh-20080728-1.patch

Now let’s cd into the actual dss installer directory and then grab a patched installer file, get rid of the old Install script and then grab a new one:

cd DarwinStreamingSrvr6.0.3-Source
mv Install Install.old
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/Install

Then we’ll make the Install script executable and run the Buildit (no, not Configure) then Install scripts:

chmod +x Install
./Buildit
./Install

Finally, fire up the DSS:

/usr/local/sbin/DarwinStreamingServer

Now you should be able to go to a standard Mac OS X client and run a port scan of the rtsp port, 554 using stroke (swap the 192.168.210.254 IP here with whatever IP or hostname that you’re using):

/Applications/Utilities/Network\ Utility.app/Contents/Resources/stroke 192.168.210.254 554 554

DSS installs some sample movies into /usr/local/movies. Provided that the port is open, let’s open Safari and provide the following link to see if one of the stock sample movies will open:

rtsp://192.168.210.254/sample_h264_300kbit.mp4

Provided that you see the sample movie from Apple then you can move the sample movies elsewhere and drop your own in here. You’ve now got a fully functional DSS. The DSS will stream .mov, .mp4 and .3gp files. If you enable the QTSSHttpFileModule you can also stream mp3 files. If you go into the /etc/streaming folder you will see a number of files that look similar to what you have been working with on Mac OS X Server (assuming you’ve been working with Mac OS X Server). In here, you’ll find the qtusers and qtgroups files for managing users and groups in rtsp as well as the streamingserver.xml file, which is where the modules are loaded and unloaded. In /var/streaming you’ll also find a directory called logs, which is interestingly enough where the logs reside and another directory called playlists, which is where you will drop playlists in the event that you decide to make your own radio station. My music tastes are bad enough where I’ve never really considered this, but feel free to get all WKRP in Cincinnati if you so choose, I promise not to judge (or maybe just a little)…

You’ll also end up likely looking to embed these rtsp streams (that seems to be what everyone does). If so, get to know the XML structure:

<?xml version=”1.0″?>
<?quicktime type=”application/x-quicktime-media-link”?>
<embed src="/blog/”rtsp://192.168.210.254/sample_h264_300kbit.mp4"″ autoplay=”true” />

Ultimately, building and using QuickTime Streaming on Mac OS X Server is far superior in a number of ways to doing so in Linux. For starters, the steps here are all done by clicking on a Start button in Mac OS X Server. But even further than that, updates are even more rare to DSS. If you’re in the rack density game, a number of Mac mini servers in the right sized rack might just get you more bang for your square inch!
http://krypted.com/mac-os-x-server/quicktime-streaming-server-on-ubuntu-10/

另参考:
http://doutdex.wordpress.com/2008/03/12/install-instalar-darwin-streaming-server-555-dss-in-ubuntu/
QTSS服务器是当今三大流媒体服务器之一,其开源的版本是darwin streaming server。作为三大主要流式媒体应用中唯一一个开放源代码的产品,DSS让开发人员能够研究流媒体最底层的技术,大幅度提高设计水平。事实上,当前国内外许多公司正是在DSS的基础上开发了自己的流式媒体相关产品。但是DSS源码量比较大,简单统计一下5.5版本总共大约13万行代码,虽然DSS源码组织结构很好,但是入门的门槛还是比较高。 为降低入门门槛,首先要做的就是把DSS源码简化,下面简单介绍一下我对5.5版本裁剪优化的过程。 从网上下载到5.5版的源码,整个压缩包有20多兆,解开压缩包,里面有很多测试用的多媒体文件,实际代码小很多。 用VC6打开WinNTSupport子目录下的工程文件StreamingServer.dsw。选FileView标签页展开 StreamingServer files模块前面的加号,可以看到主程序依赖四个模块分别是 CommonUtilitiesLib APICommonCode APIStubLib SafeInternalStdLib QTFileLib,再点开这几个模块前面的加号,可以看到整个工程就只依赖这几个模块。把不用的其他模块统统的删掉,好畅快淋漓哦。庞大的DSS现在只剩下6个大模块了。 分大模块点开所有的文件,鼠标光标自动在每个文件的顶端,所有文件都按两下回车,再一起保存,为的是把工程需要的文件做个时间标记,所有修改时间不是当前的文件都是没有实际使用的文件。 哈哈,有很好的办法去除实际不使用的文件,在资源管理器中搜索DSS目录下的所有.h文件,把修改时间不是当前时间的文件统统删掉。同样的办法处理一遍.c文件和.cpp文件。 再在资源管理器中遍历DSS目录下的所有子目录,把即没有.h文件,有没有.c文件或.cpp文件的子目录统统删掉。 大话西游的经典台词出来了,"整个世界清净了"。 再设置StreamingServer files为Active project,编译一下。 哈哈,一次编译通过,刚才的一阵狂砍乱剁中没有删掉有用的文件。再接再励,顺便把那些即不是源码又不是VC工程文件的文件删掉,DSS现在好小巧苗条哦。 再大概统计一下源代码总共大约8.9万行,实际程序代码5.4万行。如果再删掉编译要用但最小程序不使用的如mp3,http等模块,最后可以减到4万行左右。 代码初步简化完了,就得安装程序跑跑看效果,如果上网方便可以在网上找到很多安装的教程。如果上网不方便,按照程序提示也能做好。 在VC6 IDE开发环境中点击run按钮,程序运行有提示: Darwin Streaming Server must either be started from the DOS Console using the -d command-line option, or using the Service Control Manager 看提示在命令行带-d参数再运行程序,程序有提示: Fatal Error:Could not load configuration file at c:\Program Files\Darwin Streaming Server\streamingserver.xml 很明显提示少了streamingserver.xml文件,在Darwin目录下搜streamingserver.xml文件,已经有此文件了,那就按照提示把streamingserver.xml文件拷贝到c:\Program Files\Darwin Streaming Server目录下。既然是xml文件,就用文本打开看一下了,里面好多c:\Program Files\Darwin Streaming Server\XXX 这样的路径,那就按照这些提示把相关路径都建好。 聪明的大家看到Movies子目录了,放电影的地方嘛,接着把DSS源码附带的*.3gp文件和*.mp4文件拷贝到此目录,如果担心放错目录,那就在Darwin Streaming Server目录和所有子目录中都放媒体文件。 再开VLC,用打开网络串流的方式打开 rtsp://localhost/sample_100kbit.mp4 文件。 哈哈,大功告成。 以后就是各位网友优化dss源码的事情了。祝各位网友顺顺利利地看懂源码,做出更牛牛的流媒体服务器。 来自:http://www.cnblogs.com/mcodec/articles/1735765.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值