流式视频服务器和客户机的 实现

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

流式视频服务器和客户机的实现钱叶魁主要内容•目标和功能•采用的方法原理•实现目标和功能•实现流式视频服务器和客户机—流式存储视频应用•客户机发送SETUP,PLAY,PAUSE和TEARDOWN等RTSP命令,并且服务器应答这些命令;•当服务器处于播放状态时,它周期性地抓取JPEG帧,用RTP对该帧分组化,并将该RTP分组发送到一个UDP套接字中;•客户机接收该RTP分组,解压缩JPEG帧,并在客户机显示器上显示。采用的方法和原理•RTSP•RTPRTSP运行过程PresentationDescription文件例子titleTwister/titlesessiongrouplanguage=enlipsyncswitchtracktype=audioe=PCMU/8000/1src=rtsp://audio.example.com/twister/audio.en/lofitracktype=audioe=DVI4/16000/2pt=90DVI4/8000/1src=rtsp://audio.example.com/twister/audio.en/hifi/switchtracktype=video/jpegsrc=rtsp://video.example.com/twister/video/group/sessionRTSPExchangeExampleC:SETUPrtsp://audio.example.com/twister/audioRTSP/1.0Cseq:1Transport:rtp/udp;compression;port=3056;mode=PLAYS:RTSP/1.0200OKCseq:1Session4231C:PLAYrtsp://audio.example.com/twister/audio.en/lofiRTSP/1.0Cseq:2Range:npt=0-Session:4231C:PAUSErtsp://audio.example.com/twister/audio.en/lofiRTSP/1.0Cseq:3Range:npt=37Session:4231C:TEARDOWNrtsp://audio.example.com/twister/audio.en/lofiRTSP/1.0Cseq:4Session:4231S:RTSP/1.02003OKCseq:4Session:4231RTPrunsontopofUDPRTPlibrariesprovideatransport-layerinterfacethatextendUDP:•portnumbers•IPaddresses•payloadtypeidentification•packetsequencenumbering•time-stampingUDPRTPRTPHeaderPayloadType(7bits):Indicatestypeofencodingcurrentlybeingused.Ifsenderchangesencodinginmiddleofconference,senderinformsthereceiverthroughthispayloadtypefield.•Payloadtype0:PCMmu-law,64kbps•Payloadtype3,GSM,13kbps•Payloadtype7,LPC,2.4kbps•Payloadtype26,MotionJPEG•Payloadtype31.H.261•Payloadtype33,MPEG2videoSequenceNumber(16bits):IncrementsbyoneforeachRTPpacketsent,andmaybeusedtodetectpacketlossandtorestorepacketsequence.RTPHeader(2)•Timestampfield(32byteslong).ReflectsthesamplinginstantofthefirstbyteintheRTPdatapacket.•SSRCfield(32bitslong).IdentifiesthesourceoftheRTPstream.EachstreaminaRTPsessionshouldhaveadistinctSSRC.实现

1 / 11
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功