Real Time Streaming Protocol或者RTSP(实时流媒体协议),是由Real network
和Netscape共同提出的如何有效地在IP网络上传输流媒体数据的应用层协议。RTSP提供一种可扩展的框架,使能够提供能控制的,按需传输实时数
据,比如音频和视频文件。源数据可以包括现场数据的反馈和存贮的文件。
RTSP协议是一个非常类似HTTP协议的流控制协议。它们都使用纯文本来发送信息,而且rtsp协议的语法 也和HTTP类似。Rtsp一开始这样设计,也是为了能够兼容使用以前写的HTTP协议分析代 码 。这是个好消息。它们主要的区别是HTTP协议是没有状态的, http协议在发送一个命令后,连接会断 开,而且命令之间没有依赖性。不同的是RTSP的命令需要知道现在正处于一个什么状态,也就是说rtsp的命令总是按照顺序来发送,某个命令总在另外一个命令之前要发送。Rtsp不管处于什么状态都不会去断掉连接。HTTP 协议默 认使用80端口,而RTSP 默认使用554端口。如果一些服务器因为某些安全的原因而封掉了这个端口,那代理和防火墙可能不让RTSP消息通 过,需要管理员去放开554端口,而使得rtsp协议能通过。
sdp格式说明 [0x8b93138] live555 demux debug: RTP subsession 'video/H264'
Sending request:
SETUP rtsp:
//192.168.1.38:8554/5.264/track1 RTSP/1.0
CSeq: 3
Transport: RTP/AVP;unicast;client_port=43862-43863
User-Agent: VLC media player (LIVE555 Streaming Media v2010.02.10)
Received
SETUP response: RTSP/1.0 200 OK
CSeq: 3
Date: Wed, Feb 23 2011 02:32:46 GMT
Transport: RTP/AVP;unicast;destination=192.168.1.38;source=192.168.1.38;client_port=43862-43863;server_port=6970-6971
Session: 4C618051
[0x8b74088] main input debug: selecting program id=0
[0x8b93138] live555 demux debug: setup start: 0.000000 stop:0.000000
Sending request:
PLAY rtsp:
//192.168.1.38:8554/5.264/ RTSP/1.0
CSeq: 4
Session: 4C618051
Range: npt=0.000-
User-Agent: VLC media player (LIVE555 Streaming Media v2010.02.10)
Received
PLAY response: RTSP/1.0 200 OK
CSeq: 4
Date: Wed, Feb 23 2011 02:32:46 GMT
Range: npt=0.000-
Session: 4C618051
RTP-Info: url=rtsp:
//192.168.1.38:8554/5.264/track1;seq=10298;rtptime=1299638508
[0x8b93138] live555 demux debug: We have a timeout of 60 seconds
[0x8b93138] live555 demux debug: spawned timeout thread
[0x8b93138] live555 demux debug: play start: 0.000000 stop:0.000000
[0x8b93138] main demux debug: using access_demux module "
live555"
[0x8b93138] main demux debug: TIMER module_need() : 5.161 ms - Total 5.161 ms / 1 intvls (Avg 5.161 ms)
[0x8b93e78] main decoder debug: looking
for decoder module: 31 candidates
[0x8b93e78] avcodec decoder debug: libavcodec initialized (interface 0x341401)
[0x8b93e78] avcodec decoder debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) started
[0x8b93e78] main decoder debug: using decoder module "
avcodec"
[0x8b93e78] main decoder debug: TIMER module_need() : 11.674 ms - Total 11.674 ms / 1 intvls (Avg 11.674 ms)
[0x8bace08] main packetizer debug: looking
for packetizer module: 21 candidates
[0x8bace08] packetizer_h264 packetizer debug: found NAL_SPS (sps_id=0)
[0x8bace08] packetizer_h264 packetizer debug: found NAL_PPS (pps_id=0 sps_id=0)
[0x8bace08] main packetizer debug: using packetizer module "
packetizer_h264"
[0x8bace08] main packetizer debug: TIMER module_need() : 1.079 ms - Total 1.079 ms / 1 intvls (Avg 1.079 ms)
[0x8b93e78] main decoder debug: thread (decoder) created at priority 0 (input/decoder.c:315)
[0x8b93e78] main decoder debug: thread started
[0x8b74088] main input debug: `rtsp:
//192.168.1.38:8554/5.264' successfully opened
Sending request:
GET_PARAMETER rtsp:
//192.168.1.38:8554/5.264/ RTSP/1.0
CSeq: 5
Session: 4C618051
User-Agent: VLC media player (LIVE555 Streaming Media v2010.02.10)
Received
GET_PARAMETER response: RTSP/1.0 200 OK
CSeq: 5
Date: Wed, Feb 23 2011 02:32:46 GMT
Session: 4C618051
[0x8b74088] main input debug: Buffering 0%
[0x8b74088] main input debug: Buffering 0%
[0x8b74088] main input debug: Buffering 0%
[0x8b74088] main input debug: Buffering 3%
[0x8b74088] main input debug: Buffering 6%
[0x8b74088] main input debug: Buffering 6%
[0x8b74088] main input debug: no usable vout present, spawning one
[0x8c51b38] main spu text debug: looking
for text renderer module: 2 candidates
[0x8c5dd98] main generic debug: thread (fontlist builder) created at priority 0 (freetype.c:480)
[0x8c51b38] freetype spu text debug: using fontsize: 2
[0x8c51b38] main spu text debug: using text renderer module "
freetype"
[0x8c51b38] main spu text debug: TIMER module_need() : 0.812 ms - Total 0.812 ms / 1 intvls (Avg 0.812 ms)
[0x8c52b38] main scale debug: looking
for video filter2 module: 17 candidates
[0x8c52b38] swscale scale debug: 32x32 chroma: YUVA -> 16x16 chroma: YUVA with scaling using Bicubic (good quality)
[0x8c52b38] main scale debug: using video filter2 module "
swscale"
[0x8c52b38] main scale debug: TIMER module_need() : 1.111 ms - Total 1.111 ms / 1 intvls (Avg 1.111 ms)
[0x8c5eb58] main scale debug: looking
for video filter2 module: 17 candidates
[0x8c5eb58] yuvp scale debug: YUVP to YUVA converter
[0x8c5eb58] main scale debug: using video filter2 module "
yuvp"
[0x8c5eb58] main scale debug: TIMER module_need() : 1.085 ms - Total 1.085 ms / 1 intvls (Avg 1.085 ms)
[0x8c5dd98] main generic debug: thread started
[0x8c4e188] main video output debug: window size: 1280x720
[0x8c4e188] main video output debug: looking
for video output module: 7 candidates
[0x8c4e188] xvideo video output error: cannot
open display
[0x8c4e188] x11 video output error: cannot
open display
[0x8c4e188] fb video output warning: disabling tty handling, use with caution because there is no way to
return to the tty.
[0x8c4e188] fb video output error: cannot get terminal mode (Invalid argument)
[0x8c4e188] opengl video output debug: Texture size: 2048x1024
[0x8cff420] main generic debug: looking
for opengl provider module: 1 candidate
[0x8cff420] glx generic error: cannot
open display
[0x8cff420] main generic debug: TIMER module_need() : 0.379 ms - Total 0.379 ms / 1 intvls (Avg 0.379 ms)
[0x8c4e188] opengl video output warning: No OpenGL provider found
[0x8c5dd98] freetype generic debug: Building font database...
[0x8c5dd98] freetype generic debug: Finished building font database.
[0x8c5dd98] freetype generic debug: Took 1256 microseconds
[0x8c5dd98] main generic debug: thread ended
[0x8c4e188] main video output debug: removing module "
caca"
[0x8c51b38] main spu text debug: removing module "
freetype"
[0x8c5eb58] main scale debug: removing module "
yuvp"
[0x8c52b38] main scale debug: removing module "
swscale"