1 / 11

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

流式视频服务器和客户机的 实现. 钱叶魁. 主要内容. 目标和功能 采用的方法原理 实现. 目标和功能. 实现流式视频服务器和客户机 — 流式存储视频应用. 客户机 发送 SETUP,PLAY,PAUSE 和 TEARDOWN 等 RTSP 命令,并且 服务器 应答这些命令; 当 服务器 处于播放状态时,它周期性地抓取 JPEG 帧,用 RTP 对该帧分组化,并将该 RTP 分组发送到一个 UDP 套接字中; 客户机 接收该 RTP 分组,解压缩 JPEG 帧,并在客户机显示器上显示。. 采用的方法和原理. RTSP RTP. RTSP 运行过程.

kipp
Télécharger la présentation

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

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 流式视频服务器和客户机的实现 钱叶魁

  2. 主要内容 • 目标和功能 • 采用的方法原理 • 实现

  3. 目标和功能 • 实现流式视频服务器和客户机—流式存储视频应用 • 客户机发送SETUP,PLAY,PAUSE和TEARDOWN等RTSP命令,并且服务器应答这些命令; • 当服务器处于播放状态时,它周期性地抓取JPEG帧,用RTP对该帧分组化,并将该RTP分组发送到一个UDP套接字中; • 客户机接收该RTP分组,解压缩JPEG帧,并在客户机显示器上显示。

  4. 采用的方法和原理 • RTSP • RTP

  5. RTSP运行过程

  6. Presentation Description文件例子 <title>Twister</title> <session> <group language=en lipsync> <switch> <track type=audio e="PCMU/8000/1" src = "rtsp://audio.example.com/twister/audio.en/lofi"> <track type=audio e="DVI4/16000/2" pt="90 DVI4/8000/1" src="rtsp://audio.example.com/twister/audio.en/hifi"> </switch> <track type="video/jpeg" src="rtsp://video.example.com/twister/video"> </group> </session>

  7. RTSP Exchange Example C: SETUP rtsp://audio.example.com/twister/audio RTSP/1.0 Cseq:1 Transport: rtp/udp; compression; port=3056; mode=PLAY S: RTSP/1.0 200 OK Cseq:1 Session 4231 C: PLAY rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Cseq:2 Range: npt=0- Session: 4231 C: PAUSE rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Cseq:3 Range: npt=37 Session: 4231 C: TEARDOWN rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Cseq:4 Session: 4231 S: RTSP/1.0 200 3 OK Cseq:4 Session: 4231

  8. UDP RTP RTP runs on top of UDP • RTP libraries provide a transport-layer interface • that extend UDP: • port numbers • IP addresses • payload type identification • packet sequence numbering • time-stamping

  9. RTP Header • Payload Type (7 bits): Indicates type of encoding currently being used. If sender changes encoding in middle of conference, sender • informs the receiver through this payload type field. • Payload type 0: PCM mu-law, 64 kbps • Payload type 3, GSM, 13 kbps • Payload type 7, LPC, 2.4 kbps • Payload type 26, Motion JPEG • Payload type 31. H.261 • Payload type 33, MPEG2 video • Sequence Number (16 bits): Increments by one for each RTP packet • sent, and may be used to detect packet loss and to restore packet • sequence.

  10. Timestamp field (32 bytes long). Reflects the sampling instant of the first byte in the RTP data packet. SSRC field (32 bits long). Identifies the source of the RTP stream. Each stream in a RTP session should have a distinct SSRC. RTP Header (2)

  11. 实现

More Related