现在的位置: 首页 > 综合 > 正文

流媒体服务器Darwin Streamer安装配置

2013年08月15日 ⁄ 综合 ⁄ 共 5664字 ⁄ 字号 评论关闭
     Darwin Streamer是Apple的开源RTSP服务器,采用APSL(Apple Public Source License)许可协议,可在免费商业使用。

1.下载安装

    最新的6.0.3版本只提供源码和mac os上的二进制文件,在windows上用vs无法编译通过。所以使用5.5.5版本
 解压下载的文件, 执行目录中的install.bat进行安装,安装过程中会提供输入管理员用户名和密码,也可以在安装完成后再设置。    
 还需要安装perl解析器, 下载:http://downloads.activestate.com/ActivePerl/releases/5.14.2.1402/ActivePerl-5.14.2.1402-MSWin32-x86-295342.msi
    
2.管理配置
打开cmd
设置管理员用户名及密码:
C:\Program Files\Darwin Streaming Server>perl WinPasswdAssistant.pl

Darwin Streaming Server Setup

In order to administer the Darwin Streaming Server you must create an administrator user [Note: The admin
Please enter a new administrator user name: gavin

You must also enter a password for the administrator user [Note: The administrator password cannot contai
Please enter a new administrator Password: 123456

Re-enter the new administrator password: 123456

Setup Complete!

启动用于管理服务器的web服务器

C:\Program Files\Darwin Streaming Server>perl streamingadminserver.pl
现在在浏览器中输入http://127.0.0.1:1220/,登录管理界面,远程登录时需要验证帐户
在管理界面中,General Settings页面设置视频文件存放目录,默认为C:\Program Files\Darwin Streaming Server\Movies
使用ffplay测试一下自带的示例
 ffplay rtsp://192.168.9.80/sample_300kbit.mp4
3.MP4文件的流化
测试发现,只能播放darwin自带的示例文件,自己找的*.mp4文件都不能播放。google发现,需要对MP4文件hint。关于hint,有一段英文解释:
 Hint tracks are a series of instructions in a mp4 container file that 
tell a server how to transmit packets. Hint tracks always refer 
to another track, most likely an audio or video media track.     
   This series of instructions tells the server when to send the packet,   
what type of RTP header to add, if there is any extra data in the 
packet, and how much data to send in the packet. To save on space,   
a hint can contain a pointer to the media track, instead of duplicating 
that data. 
   It will also tell what SDP to add for the track that is referenced.  
   So a file that is hinted should have a media track, and an associated 
hint track for that media track. There are some mp4 container files 
that just have hint tracks - these are called "fat hints" and are 
usually not playable locally. These are illegal in ISMA, so we won 't 
talk about them. 
     大致的意思是,hint是mp4文件中的轨道,包含了RTP传输所使用的信息,其实就是建立一个索引。网上都说用mp4box可以对mp4文件进行流化操作,下载地址 http://www.videohelp.com/tools/mp4box。mp4box的功能非常多,支持3gp、mp4、avi、mp3等多种文件格式的转换及其它操作,不过它没有转码能力,详细使用参考http://gpac.wp.institut-telecom.fr/mp4box/mp4box-documentation/。不过最后悲剧的发现,出错了:
F:\Video>mp4box -hint 3.mp4
Hinting file with Path-MTU 1450 Bytes
Cannot create hinter (Feature Not Supported)

        Error: Feature Not Supported
又找了一个名为mp4creator的工具,下载地址http://mp4creator.sourceforge.net/download/index.htm
F:\Video>mp4creator -list Gucci.mp4
Track   Type    Info
1       video   H264 Baseline@3, 24.920 secs, 2407 kbps, 800x608 @ 25.000000 fps
2       audio   MPEG-4 AAC LC, 24.938 secs, 126 kbps, 44100 Hz

F:\Video>mp4creator -hint Gucci.mp4
MP4ERROR: FindTrackIndex: Track id 0 doesn't exist
mp4creator: couldn't create hint track, no media samples

出错了!!!试试对单个轨道进行hint

F:\Video>mp4creator -hint=1 Gucci.mp4
MP4ERROR: MP4File::FindIntegerProperty: no such property - moov.trak[0].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId
MP4ERROR: MP4File::FindIntegerProperty: no such property - moov.trak[2].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId

F:\Video>mp4creator -list Gucci.mp4
Track   Type    Info
1       video   H264 Baseline@3, 24.920 secs, 2407 kbps, 800x608 @ 25.000000 fps
2       audio   MPEG-4 AAC LC, 24.938 secs, 126 kbps, 44100 Hz
3       hint    Payload H264 for track 1

虽然hint过程中,有错误提示但还是成功添加了hint轨道

F:\Video>mp4creator -hint=2 Gucci.mp4
MP4ERROR: MP4File::FindIntegerProperty: no such property - moov.trak[0].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId
MP4ERROR: MP4File::FindIntegerProperty: no such property - moov.trak[2].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId
MP4ERROR: MP4File::FindIntegerProperty: no such property - moov.trak[3].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId

F:\Video>mp4creator -list Gucci.mp4
Track   Type    Info
1       video   H264 Baseline@3, 24.920 secs, 2407 kbps, 800x608 @ 25.000000 fps
2       audio   MPEG-4 AAC LC, 24.938 secs, 126 kbps, 44100 Hz
3       hint    Payload H264 for track 1
4       hint    Payload mpeg4-generic for track 2

对音视频轨道单独进行hint才能成功,提示的错误暂时不明白是什么原因,不过用vlc2.0测试过,转换后的视频能正常播放。但是用ffplay和mplay播放时,均存在问题

mp4creator还有许多功能,自带的usage信息如下:
F:\Video>mp4creator
usage: mp4creator  <options> <mp4-file>
  Options:
  -aac-old-file-format    Use old file format with 58 bit adts headers
  -aac-profile=[2|4]      Force AAC to mpeg2 or mpeg4 profile
  -allow-avi-files        Allow avi files
  -calcH263Bitrates       Calculate and add bitrate information
  -create=<input-file>    Create track from <input-file>
    input files can be of type: .263 .aac .ac3 .amr .mp3 .divx .mp4v .m4v .cmp .xvid .chap
  -encrypt[=<track-id>]   Encrypt a track, also -E
  -extract=<track-id>     Extract a track
  -delete=<track-id>      Delete a track
  -force3GPCompliance     Force making the file 3GP compliant. This disables ISMA compliance.
  -forceH263Profile=<profile> Force using H.263 Profile <profile> (default is 0)
  -forceH263Level=<level>     Force using H.263 level <level> (default is 10)
  -H263CbrTolerance=<value>   Define H.263 CBR tolerance of [value] (default: 10%)
  -hint[=<track-id>]      Create hint track, also -H
  -interleave             Use interleaved audio payload format, also -I
  -list                   List tracks in mp4 file
  -make-isma-10-compliant Insert bifs and od tracks required for some ISMA players (also -i)
  -mpeg4-video-profile=<level> Mpeg4 video profile override
  -mtu=<size>             Maximum Payload size for RTP packets in hint track
  -optimize               Optimize mp4 file layout
  -payload=<payload>      Rtp payload type
                          (use 3119 or mpa-robust for mp3 rfc 3119 support)
  -rate=<fps>             Video frame rate, e.g. 30 or 29.97
  -qth=<height>           Set a new height for QuickTime display
  -qtw=<width>            Set a new width for QuickTime display
  -timescale=<ticks>      Time scale (ticks per second)
  -use64bits              Use for large files
  -use64bitstime          Use for 64 Bit times (not QT player compatible)
  -variable-frame-rate    Enable variable frame rate for mpeg4 video
  -verbose[=[1-5]]        Enable debug messages
  -version                Display version information

抱歉!评论已关闭.