crtmpserver readme翻译 如何编译并使用C++ RTMP Server

来源:互联网 发布:淘宝定制付定金和尾款 编辑:程序博客网 时间:2024/06/05 01:13
声明:本人四级未过,翻译难免有不标准、有省略的地方见谅,还有的是按照自己的话讲的
readme来源:crtmpserver-385
这个到781一直都未更新过,还是这个readme
有的可能失效,以实际为准

Instructions how to compile and use C++ RTMP Server (a.k.a crtmpserver)
如何编译并使用C++ RTMP Server

Requirements:
要求:
* GCC and other C++ tools
* SVN 下载源码时用,使用其它方式就不一定要
* libdl, libssl, libcrypto
(make sure you have the "devel" packages of libdl, ssl and crypto installed prior to compiling)
请确信 libdl, ssl and crypto的版本能够支持编译

In order to get the source code, issue the following command:
获取源码请使用以下命令(需SVN,也可用其它方式获取)
svn co --username anonymous https://svn.rtmpd.com/crtmpserver/trunk crtmpserver
When it asks for password, hit Enter key
当询问密码时,直接回车(压根就没设密码)


编译
Compile the package. Do the following steps:
按照以下步骤进行编译
cd crtmpserver/builders/cmake
cmake .

(this step will create all the Makefile's that are required. If some package is missing, the cmake will complain)
这一步将会创建所要求的makefile文件(可以通过修改跳过一些不必要的包,如test)

make

The compilation procedure should be finished within few minutes.
编译需要花费一些时间

After you compiled the package, it's time to test it. Run the following command:
当你编译好后。试着测试,使用如下命令

./crtmpserver/crtmpserver crtmpserver/crtmpserver.lua

If everything goes well, you'll get on your console a table with IP's, ports, protocols, and application names
如果运行良好,你将会看到一张表,包含IP,prot,protocol,以及application names等信息
If you see this table, then crtmpserver is working.
如果你看到了这张表,crtmpserver就已经在工作了


测试(过时)
Lets test it the server. Follow these simple steps:
让我们测试一下这服务。按照以下简单的步骤走:(需要有网站服务器)

* Download a simple FLV or MP4 file. You can dowload a sample file from here:
下载一个简单的flv或者MP4文件,你可以从这儿下一个简单的文件
http://www.mediacollege.com/adobe/flash/video/tutorial/example-flv.html
* Place the file you downloaded into the crtmpserver/media folder
将你下的文件放到crtmpserver/media文件夹中
* Download an FLV player. For this example, we'll use JW Player. Get it here:
下载一个flv播放器。在这个例子中,我们将会使用JW播放器,从这儿得到它
http://www.longtailvideo.com/players/jw-flv-player
* Extract the JW Player to a directory which is accessible through your web server
你的网页服务器上创建一个目录,将JW播放器放到里面
* Go to the extracted directory and create an HTML file which will include the player and play the file. Here's an example:
到目录中创建一个html文件,它将包含播放器并且播放文件。这儿是个例子

<html>
<body>
<script type='text/javascript' src='swfobject.js'></script>

<div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
var so = new SWFObject('player.swf','mpl','640','360','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file','file-download');
so.addVariable('streamer','rtmp://127.0.0.1/flvplayback/');
so.write('mediaspace');
</script>
</body>
</html>

* Change the 127.0.0.1 to either the IP of your crtmpserver or simply use a hostname of your machine
将127.0.0.1改为你crtmpserver的IP或者是使用你的主机名
* Replace file-download with the actual filename of your sample you download. Remeber to omit the .flv if it's an FLV file
file-download替换为你下载的文件名。记住,如果是flv文件要以flv结尾
* Open a web browser and point it to to the web server IP/Hostname and the directory you installed the player
打开一个网页浏览器,进入到你安装播放器的目录
(example: http://127.0.0.1/player)
* You should see a player. Click the play button and the video should be played.
你应该看到一个播放器,点击播放,视频将会被播放
If you see the video, then everything works well.
如果你看到了视频,那么一切工作正常

安装
Installing crtmpserver:
安装crtmpserver
* Go to the directory crtmpserver/cmake
进入到目录crtmpserver/cmake
* Run the following command: cmake -DCRTMPSERVER_INSTALL_PREFIX=<path> (for example /usr/local/crtmpserver)
运行命令: cmake -DCRTMPSERVER_INSTALL_PREFIX=<路径> (例如 /usr/local/crtmpserver)
* After previous command done start build project with command: make
预处理好后使用make命令进行工程建立
* After build comlete run command: make install
编译完毕之后运行命令: make install
* After install you has installed crtmpserver in <path>(in our case /usr/local/crtmpserver)
安装之后,你应该已经将crtmpserver安装在指定目录(这例子中 /usr/local/crtmpserver
* Now you can start crtmpserver with command:
现在你可以启动crtmpserver使用以下命令
sudo <path>/sbin/crtmpserver --uid=<UID> <path>/etc/crtmpserver.lua
in our case:
在我们的例子中
sudo /usr/local/crtmpserver/sbin/crtmpserver --uid=<UID> /usr/local/crtmpserver/etc/crtmpserver.lua

Also look into builders/packing directory. There are several OS specific builders.
builders/packing目录中还有其它编译方式,有机子系统特有的建立方式
* in directory "debian" builder for Debian, also can be used for Ubuntu and other distributions based on debian
目录debian建立后给debian使用,也能够被Ubuntu以及其它基于debian的系统使用
* in directory "freebsd" builder(port) for FreeBSD
目录freebsd建立后给freebsd使用

其它
crtmpserver settings
crtmpserver设置
* All crtmpserver settings are located in a detailed file calle: crtmpserver.lua
所有的crtmpserver设置都在crtmpserver.lua文件中进行

Support/Help:
支持/帮助
If you're lookingo for assistance with crtmpserver, feel free to join us at:
如果你需要帮助,欢迎加入我们在以下地址:
http://groups.google.com/group/c-rtmp-server

Credits:
成员
* crtmpserver written by: Gavriloaie Eugen-Andrei
* Documentation (this file): Hetz Ben Hamo, Andriy Beregovenko
* TinyXML: Lee Thomason
* lua: Roberto Ierusalimschy, Waldemar Celes, Luiz Henrique de Figueiredo
* Performance: Vlad Galu
* Protocols: Mircea Danila Dumitrescu

原创粉丝点击