176 计算机与数字工程第35卷
3
喻艺丹
(武汉大学多媒体网络通信研究所武汉430071)
摘要提出一种全新的采集发布分离式视频直播服务器构建框架,以R TP、R TS P和SDP协议为基础构造协议栈,在此基础上分析了分离式视频直播服务器和采集发布服务器数据交互过程。
htc a310关键词流媒体技术视频直播服务器采集发布分离式
中图分类号TP39
1 引言
流媒体技术的发展和宽带网络的普及改变了Internet上的实时音视频信息传输模式,完整的流
媒体直播系统包括采集发布服务器、直播服务器、数据库服务器、W eb服务器和播放器,其中,采集发
布服务器完成实时音视频数据的采集、编码和包装;直播服务器完成对实时数据的分发和其他数据
处理;数据库服务器和W eb服务器完成用户认证、记费、权限管理以及各种定制的W eb应用服务。
目前市场上的流媒体直播服务器产品大都采
用集成式服务框架。由于实时视频采集过程中对
媒体数据的音视频压缩编码过程占用了大量的计
算机资源以及集成式的框架结构的不易扩展性导
致直播服务器性能降低,不能够为Internet用户提
供高质量实时音视频服务。
在开发流媒体直播服务器产品的实践中,提出
了一种全新的采集发布分离式视频直播服务器框架,将采集发布服务器从直播服务器独立出来提高
了直播服务器性能,同时能够实现一台视频采集发
布服务器向多台直播服务器发送实时流媒体数据。
2 采集发布分离式视频直播服务器
框架构建
2. 1 集成式视频直播服务器框架
传统的视频直播服务器包含了采集发布子模块,在该模块中实现对实时数据的采集、编码、封包
过程,基于该框架的直播服务器结构如图1所示。
集成式直播服务器的实时数据处理过程都在同一计算机上,由于压缩编码算法的复杂性和实时视频数据显示需要占用大量C PU、内存、句柄等计算机资源,导致直播服务器性能下降,性能指标由高到低依次表现为并发数减少、时延加大、音视频不同步、视频停顿和马赛克效应直至服务停止。
图 1 集成式视频直播服务器框架
2. 2 采集发布分离式视频直播服务器框架
由于集成式视频直播服务器架构的缺陷,需要一种全新的架构去满足日益增长的实时流媒体服务需求。在对集成式视频直播服务器架构进行详细分析后,通过将视频采集、压缩和数据封包过程从直播服务器中分离出来,基于RTP /RTCP协议为基础构建媒体数据流传输通道,基于RTSP / SD P 协议的请求/响应模式为基础构建命令流传输通道, 实现了全新的采集发布分离式视频直播服务器架构。具体架构如图2。
这种采集发布分离式的直播服务器架构可以将数据采集、编码和数据封包过程从直播服务器中独立出来,由专用的采集发布服务器完成流式数据的采集、编码和封装,直播服务器只负责接收到的包数据的分发,从架构上直接降低了直播服务器的操作复杂度,提高了直播服务器的性能; 同时这种
3 收到本文时间: 2006年5月15日
作者简介:喻艺丹,女,硕士研究生,研究方向:多媒体网络通信。
第 35卷 ( 2007)第 3期
计算机与数字工程
177
分离式的架构模式也支持单路采集发布服务器向 多台直播服务器发送数据以及单台直播服务器能 够接收多路采集发布服务器的数据流。
图 2 采集发布分离式视频直播服务器架构
3 基础协议栈构建
本框架采用 R TP 、R TSP 、SD P 等流媒体协议构 造直播服务器的基础协议栈 ,可以提高视频直播
服 务器的通用性和兼容性 。
3. 1 RTP (Real - tim e Transfer Pro toco l )
RTP 是用于 Internet 上针对多媒体数据流的一
种传输协议
[ 4 ]
。RTP 被定义为在一对一或一对多
核桃包装
的传输情况下工作 ,其目的是提供时间信息和实现
流同步 ,主要分为两大部分 : RTP 及 RTCP 。其中
RTP 负责数据的传输 , 而 RTCP 则负责对该 RTP session 的参与者提供传输质量等相关信息以达到
一定的服务质量 (QoS )控制。 RTP 的端口号必须 为偶数 ,而 RTCP 的端口号必须为该偶数号加一的 数字。RTP /RTCP 并不提供服务质量 (QoS )或传输 可靠的保证 ,只提供时间戳 、序列号等一些具有实 时特性信息的基本功能 。
3. 2 RTSP (Real - tim e Stream ing Pro toco l )
RTSP 协议定义了一对多应用程序如何有效地
通过 IP 网络传送多媒体数据
[ 5 ]
。 RTSP 在体系结
构上位于 RTP 和 RTCP 之上 , 它使用 TCP 或 RTP 完成数据传输。 RTSP 在语法上同 HTTP 非常接 近 ,都是属于纯文本的通信协议 ,其请求信息格式 为被请求者的 URL 位置及协议版本 ,接着是标题 头和实体信息 。不同于 HTTP 的单向沟通 , RTSP 的通信以客户 /服务器端双向的请求 /应答完成沟 通 。实体信息中包含“会话描述 ”信息 , 用以描述 该会话中媒体流的信息 , 目前以 SD P 为其信息 格式。
3. 3 SD P ( Session descrip tion Pro toco l )
SD P 是一种以纯文本格式描述多媒体会话
的 通信协议 [ 6 ] ,严格上来说 SD P 并不算是一种通信 协议 ,在其内涵上比较倾向于类似 H TML 的标记语 言。 SD P 可被包含在 RTSP 、HTTP 或 S M
TP 等各种
协议中。 SD P 信息可以包含各种有关 session 的描 述 :媒体类型 、传输协议 、媒体格式等信息 。
4 基于 RTP /RTSP / SD P 的视频采集
发布服务器与直播服务器的数据交互
采集发布服务器首先对从实时音视频源 (如 DV 或麦克风 )获得实时媒体数据进行相关的音视 频压缩编码 ,然后将编码后的数据送入 RTP 打包 器完成数据包的封装 ,最后将封包后的数据放入 RTP 包发送器等待发送 。
4. 1 SD P 文件的生成
SD P 文件的生成规则依据 RFC2327 协议规
定 ,通过完成对会话层和媒体层相关选项赋值完成 SD P 文件的制作 。一个典型的 SD P 文件如所示
c = I N I P4 192. 168. 0. 16 m = video 20000 RTP /AVP 96 b = A S: 100
a = rtpmap: 96 MP4V - ES/90000 m = audio 20002 RTP /AVP 97
b = A S: 16
a = rtpmap: 97 mpeg4 - generic /44100 /2
c 选项定义了直播服务器的 IP 地址 ; m 选项
定 义了音视频 流传 输端口 号 , RTP /A VP 表明 使用 RTP 协议 ; b 选项指明了传输该数据流所需的带 宽 ; a 选项定义了音视频流媒体类型和格式。
4. 2 基于 RTP /RTSP 的数据交互
直播服务器首先接收从采集发布服务器上发 出的 RTSP ANNOUNCE 请求 ,在这个请求中包含了 已经在采集发布服务器中生成的 SD P 数据 。当采 集发布服务器和直播服务器通过 RTSP 请求 /响应 模式建立好命令流通道后 ,就可以通过发送双向不 同类型的 RTSP 请求来控制 RTP 包的发送 , 经由 RTP /RTCP 数据流通道向直播服务器发送在采集 发布服务器中生成的音视频数据流数据 。当采集 发布服务器向直播服务器发送 RTSP 请求时 ,和该 次采集发布 SESS ION 相关的 SD P 信息被保存在
直 播服务器发布列表中 。当需要停止发布时 ,采集发 布服 务 器 向 直 播 服 务 器 发 送 一 个 停 止 ( TEAR 2 DOWN )请求 ,通知直播服务器关闭本次采集发布
静电耳机SESS ION 并丢弃相关 SD P 信息 。
5 结束语
采集发布分离式直播服务器架构以集成式直 播服务器架构为基础 ,将采集发布服务器从直播服 务器中独立出来 ,通过定义符合 RFC 规范的命令 流接口和数据流接口在采集发布服务器和直播服
178
喻艺丹 :一种全新的采集发布分离式视频直播服务器实现框架 第 35卷
务器间进行命令控制和数据传输 。这种分离式的
bbzs图 3 分离式采集发布服务器界面 架构将实时音视频数
据采集 、压缩 、封包过程和数 据发送过程完全分离 ,通过设计功能独立的采集发 布服务器和直播
服务器提供实时流媒体直播服务 ,
极大的提高了直播服务器性能 ,允许单台直播服务 器接收多路采集发布服务器数据 ,同时还能实现采 集发布服务器的无人值守 。使用本文所提出架构 实现的采集发布服务器用户界面如图 3所示。
参 考 文 献
[ 1 ]H. Schulzrinne, S . Casner, R . Frederick, and V . Jacob 2
son, “RTP: A transpo rt p rotocol fo r real - tim e app lica 2 tions ”[ S]. RFC 1889, January. 1996
[ 2 ] H. Schulzrinne, A. Rao, and R . Lanphier, “RealTime
Stream ing Protocol (RTSP ) ”[ S]. RFC 2326, Ap ril 1998 [ 3 ]M. Handley, V . Jacobson,“SD P: Session Descrip tion Pro 2
tocol ”[ S]. RFC2327, Ap ril 1998
[ 4 ]H ttp: / /www . publicso urce. app le. com /p rojects / stream ing [ 5 ]李太君 ,吴泽晖. 流媒体传输协议及其应用研究. 计算机
工程与应用 , [ J ]. 2004, 3
(上接第 173页 ) 种控制 。[
5 ] LabV IE W 是虚拟仪器设计专用软件 ,用 图形语言 ( G 语言 ) 、图标和连线代替文本编写程 序 ,使用数据流编程方法来描述程序的执行 ,实现 仪器的各种功能 。如图 3所示。
功能强大 、操作方便 、成本低廉的多功能虚拟仪器 。 本文介绍构建虚拟仪器系统的方案 , 具有实用价 值 ,测试人员可以根据具体应用自行设置或修改应 用软件以满足实际需要 。在开发以及应用过程中 , 虚拟仪器体现出具有软件开发效率高 、可操作性和 可维护性好 、不动硬件即可通过软件重构产生新的 仪器功能等特点。
参 考 文 献
5 结束语
图 4 信号采集程序框
图
安全门卡[ 1 ]Chris Cant 著 ,孙义等译 , W ind ow s WDM 设备驱动程
序 开发指南 [M ]. 北京 :参考文献机械工业出版社 ,
2000
[ 2 ] EZ - U S B FX2 Manual Technical Reference, w ww . cy 2
p ress. com , 2003
[ 3 ]Burr - B row n Co rporation, ADS830 datasheet, 1998 [ 4 ] AD624 datasheet [ EB /OL ]. http: / /www . analog. com ,
2000
采用 U SB2. 0作硬件板卡与主机通信的接口 , 利用 l abV IE W 图形化编程语言 ,实现了接口便捷、
[ 5 ]N I 公司著汪敏生等译著 . LabV IEW 基础教程 [M ]. 北
京 :电子工业出版社 , 2002
8
Flow CO 2 La se r, P ro g ramm ab le Lo g ic Co n t ro lle r
( P age: 170) D esign of V irtua l In strum en t Ba sed on USB and Lab2
V IE W by Yang L ing Abstract The a rtic le d iscu sse s the app lica tio n o f the U SB techno lo gy an d the so ftw a re e nviro nm e n t o f Lab V IEW in the de s ign o f virtua l in s trum en t. T he virtua l in2 s trum e n t system co n s is ts o f the ha rdw a re bo a rd and the so ftw a re de ve lop ing p la tfo r m. In t he a r tic le , the de ta il o f t he system s truc tu re and f un c tio n is p r e se n t e d. Th is system take s fu ll advan tage o f U SB 2. 0 p ro to co l , and supp lyie s a fle xib le and effic ie n t so ftw a re in te rface to se t up new virtua l in s t rum e n t p rac tica lly.深度时空
Key words U SB 2. 0 p ro t o co l, LabV IEW, virtua l in s tru2 m en t( P age: 172)
D esign and I m plem en ta tion of Flex ible Crea ting T able in W ireless Garden T our Pla tform by W an J inxiang Abstract A t firs t th is p ap e r ana lyse s the co ncep tio n o f fle xib le c rea ting tab le an d fo cu se s o n how to i m p ro ve the fle xib lity o f cu s tom - bu ild W G TP. Th
en the au tho rs p re se n t a so lu tio n w h ich m anage s the s truc tu re and da ta o f tab le a s u se r an d adop ts a trigge r and b ro ke r func ti o n to m a in ta in the co n s is tency o f the da ta s truc tu re. A t la s t an in s tance is g ive n.
Key words Fle xib le , da ta p r o ce ss ing , W G TP
( P age: 174) A New Captur ing&Publish ing Separa te Arch itecture of L iv ing Stream ing Server by Yu Yidan Abstract In th is p ap e r a sep a ra te L iving s tre am ing se rv2
e r a rch ite c tu re is p ropo sed, and w ith RTP, RTSP SD P a s bu ild ing un its o
f the p ro t o co l s tack, the n it ana lyze s the da ta e xchan ge p ro ce ss be tw ee n livin
g s tream ing se rve r an d cap tu ring p ub lis
h ing se rve r.
Key words S tream ing techno lo gy, L iving s tre am ing se rve r, Cap tu re and p ub lish, Sep a ra t e ( P age: 176)
D esign and Research of Network Gam e Pla tform Ba sed on UM L by X iong L ihua Abstract A lo ng w ith the fa s t de ve lopm en t o f In t e rne t, ne tw o rk gam e em e rge s be cau se o f dem an d, fu rthe r2 m o re p re sen t s a goo d fu tu re , a ll kind s o f techno lo g ie s such a s UM L, m u ltith re ad ing, So cke t, da taba se a re u se d in it. The p ap e r m a in ly e labo ra te s the p r o ce s s to u se Ra2 tio na l Ro se visua liza tio n m o de ling too l bu ild ing ne tw o rk gam e m o de l, an d p re se n ts a m e tho d how to de s ign the gam e p ro t o co l, a s w e ll a s p ack an d unp ack the gam e p ro t o co .l
Key words UM L, Ra tio na l Ro se , N e tw o rk Gam e , Gam e P ro t o co l ( P age: 179)
Com pletion of 16 B its S ingle Ch ip Con trols the AD 9854
by Xu D anyan Abstract Th is p ap e r in t ro duce s the co n t ro lling o f AD 9854 th ro ugh 16 b its s ing le ch ip , it co n ta in s how to fo rm the o u ts ide c ircu its, how to se t eve ry co n tro l - re g2 is te r, how to com p u te the am p litude , p ha se , fre quen cy tun ing w o rd and so o n. An d the re is an e xam p le fo r the se se tting s, so the m e tho d o f u s ing AD 9854 is m o re un de rs tan dab le.
Key words 16 b its s ing le ch ip , AD 9854, co n tro l - reg is te r, tun ing w o rd( P age: 182)
Research and D esign of M arket Shopp ing System Ba sed on M ob ile Paym en t by L in Q iao Abstract A gen e ra l de s ign o f m a rke t shopp ing system ba sed o n m o b ile p aym en t is g ive n, the a rch ite c tu re o f system an d m anagem en t flow , func tio n m o du le , da ta2 ba se de s ign , an d key te chno lo gy o f system a re d iscu sse d in de ta i.l D eve lopm e n t o f system do e s u sef u l re sea rche s an d tria ls in pop u la riza tio n o f m o b ile p aym en t fo r the fu2 tu re.
Key words m o b ile e le c tro n ic com m e rce , m o b ile p ay2 m en t, so cke t, m u ltith r e a d,W eb Se rvice ( P age: 185)
T he Rea liza tion of GPRS T erm ina l E m bedd ing the Re2 duced T CP / IP Protocol Stack by He J inhui Abstract Th is p ap e r in tro duce s a fram ew o rk o f the GP RS w ire le ss da ta tran sm is s io n system , an d p a rticu la r2 ly d iscu sse s the i m p lem en ta tio n o f the GPRS w ire le ss te r m ina l ba sed o n the M SP430 s ing le ch ip and M C35 m o du le p ro duce d by S im en s Co rpo ra tio n. The n Em bed s the re duced TC P / I P p ro t o co l s tack in the GPRS te rm ina l, m a in ly inc lud ing the PPP、I P、TC P、UD P and DN S p ro to co l fo r o u r re qu irm en t. A t la s t na rra te s the so ftw a re de s ign2 m en t o f the system in the p en e tra ting m o d e.
Key words GP RS,M SP430, TCP / IP, DN S ( P age: 190)
T he D ev elopm en t of M anagem en t Informa tion System Ba sed on ASP. NET by Zhou Shuang’E Abstract A po s tg radua te info rm a tio n m anagem e n t sys2 tem is re se a rched an d de s igne d acco rd ing to the info r2 m a tio n o f po s t g radua te up da te qu ickly. The system is ba sed o n ASP. N ET and B / S (B row se r/ Se rve r) m o de .l The re le van t ke y techno lo gy is d iscu sse d in the p ap e r. P rac tice app lica tio n show s tha t the system p e rfo rm s w e ll in secu rity and p a ra lle l sea rch ing.
Key words ASP. N ET, M anagem e n t Info rm a tio n Sys2 tem , B / S( P age: 193)
T he D evelopm en t of D ev ice D r iv er under the W indows O pera tion System by W u L iw ei Abstract In th is p ap e r, the pop u la r W DM (W indow s D rive r M o de l) unde r the W indow s op e ra tio n system is ana lyze d a s a cu t - in po in t.The n som e o f the d rive r de 2 ve lopm e n t kits and debug too ls a re p re se n te d. An d la s t2 ly, how to choo se the de vice d rive r deve lopm e n t ba se d o n the re qu irem en t o f the p ro je c t is de sc ribe d.
Key words W DM , D e vice D rive r, DD K, D rive r S tud io
( P age: 196)