live555 ffmpegenvironment 什么是否释放

Live555解决办法 - C++当前位置:& &&&Live555解决办法Live555解决办法&&网友分享于:&&浏览:3次Live555vs2010&使用live555
添加头文件BasicUsageEnvironment.hh出现这样的错误
在文件中这样添加的
#include&"BasicUsageEnvironment.hh"
#pragma&comment(lib,&"BasicUsageEnvironment.lib")
BasicUsageEnvironment.lib(DelayQueue.obj)&:&MSIL&.netmodule&or&module&compiled&with&/GL&&restarting&link&with&/LTCG;&add&/LTCG&to&the&link&command&line&to&improve&linker&performance
1&LINK&:&warning&LNK4075:&ignoring&'/INCREMENTAL'&due&to&'/LTCG'&specification
1&MSVCRT.lib(MSVCR100.dll)&:&error&LNK2005:&_sprintf&already&defined&in&libcmtd.lib(sprintf.obj)
1&MSVCRT.lib(MSVCR100.dll)&:&error&LNK2005:&__ctime64&already&defined&in&libcmtd.lib(ctime64.obj)
1&MSVCRT.lib(MSVCR100.dll)&:&error&LNK2005:&_strncmp&already&defined&in&libcmtd.lib(strncmp.obj)
1&MSVCRT.lib(MSVCR100.dll)&:&error&LNK2005:&__ftime64&already&defined&in&libcmtd.lib(ftime64.obj)
1&MSVCRT.lib(ti_inst.obj)&:&error&LNK2005:&"private:&__thiscall&type_info::type_info(class&type_info&const&&)"&(??0type_info@@@@Z)&already&defined&in&libcmtd.lib(typinfo.obj)
1&MSVCRT.lib(ti_inst.obj)&:&error&LNK2005:&"private:&class&type_info&&&__thiscall&type_info::operator=(class&type_info&const&&)"&(??4type_info@@@@Z)&already&defined&in&libcmtd.lib(typinfo.obj)
1&LINK&:&warning&LNK4098:&defaultlib&'MSVCRT'&conflicts&with&use&of&other&&use&/NODEFAULTLIB:library
1&Groupsock.lib(GroupsockHelper.obj)&:&error&LNK2001:&unresolved&external&symbol&_our_inet_addr
1&Groupsock.lib(GroupsockHelper.obj)&:&error&LNK2001:&unresolved&external&symbol&_our_random
1&Groupsock.lib(GroupsockHelper.obj)&:&error&LNK2001:&unresolved&external&symbol&_initializeWinsockIfNecessary
1&Groupsock.lib(GroupsockHelper.obj)&:&error&LNK2001:&unresolved&external&symbol&_our_srandom
1&E:\Traffic\Client\Debug\Client.exe&:&fatal&error&LNK1120:&4&unresolved&externals
1&Build&FAILED.------解决方案--------------------右键属性中忽略掉MSVCRT.lib,引用Groupsock.lib就行了
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
  完整解决方案的结构如下图2& 添加头文件  方法1:采用全局包含方式(绝对路径)。需要添加的include文件包括 E:\My Document\Visual Studio 2010\Projects\myLive555\BasicUsageEnvironment\include E:\My Document\Visual Studio 2010\Projects\myLive555\liveMedia\include E:\My Document\Visual Studio 2010\Projects\myLive555\groupsock\include E:\My Document\Visual Studio 2010\Projects\myLive555\BasicUsageEnvironment\include   方法2:采用局部(当前工程)包含方式(相对路径)。推荐  描述:工程-&属性-&配置属性-&C/C++-&常规-&附加包含目录 ..\BasicUsageEnvironment\include ..\groupsock\include ..\liveMedia\include ..\UsageEnvironment\include &3& 添加文件。&&& 在上述lib工程中添加对应的所有的cpp文件。4& 设置工程的输出目录。  路径:E:\My Document\Visual Studio 2010\Projects\myLive555\lib  方法:项目-》属性-》常规-》输出目录5& 编译解决方案  结果:在lib目录下生成 BasicUsageEnvironment.lib、groupsock.lib、UsageEnvironment.lib、liveMedia.lib&下载编译好的live555(lib和头文件)  方式一,环境为Win7,包含编译好的live555、提取的4个lib、myLive555Header和截图。下载()  方式二,环境win7+VS2010,包含整个工程,下载()&Ⅳ 使用实例1&& 添加库①步骤一:  方法1. 将编译生成的四个lib库库拷贝到“*:\Program Files\Microsoft Visual Studio 10.0\VC\lib”下面  方法2. 将编译生成的四个lib库库拷贝到当前工程的cpp文件下  方法3. 将编译生成的四个lib库作为全局库的形式添进工程②步骤二:  方法1. [菜单]“项目-&属性-&配置属性-&连接器-&输入-&附加依赖项”里填写      “libUsageEnvironment.lib;libliveMedia.lib;libgroupsock.lib;libBasicUsageEnvironment.lib;Ws2_32.lib”  :VS2010中,多个lib之间需要用分号或者回车隔开,用空格行不通,切记!信不信由你了,我在这个地方又折腾了一会了,青春不在啊~  方法2.& pragma&方式   #pragma comment (lib, "Ws2_32.lib")
#pragma comment (lib, "libBasicUsageEnvironment.lib") #pragma comment (lib, "libgroupsock.lib") #pragma comment (lib, "libliveMedia.lib") #pragma comment (lib, "libUsageEnvironment.lib") 2& 添加头文件说明:如果采用方式二编译的,那么此步骤可以省去①步骤一:将所有的.h文件放到一起,如myLive555Header里面,再添加include②步骤二:  方法1. “项目-&属性-&配置属性-&C/C++-&常规-&附加包含目录”  方法2. “工具-&选项-&项目和解决方案-&C++ 目录”,选择对应平台,然后添加所需“包括文件”目录(此法VS2010不通)&3& 测试代码  直接用testProgs里面的例子,我用的是testOnDemandRTSPServer.cpp,测试成功,如下图&&Ⅴ 测试live555服务器方式一:(利用ffplay.exe播放)1 把媒体文件放到和live555MediaServer.exe同一目录2 运行live555MediaServer.exe,弹出的dos框里面有地址,如下图3 客户端,dos下进入到ffplay所在文件夹下,然后输入如下命令    ffplay.exe rtsp://10.120.2.18/&媒体文件名&  弹出视频播放画面,如下图&方式二:(直接vlc中播放网络流)1 把媒体文件放到和live555MediaServer.exe同一目录2 打开vlc plaer,打开网络串流,输入rtsp,如下图3 点播放,开始播放,如下图&《本篇完》&谢谢阅读!
阅读(1023)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_',
blogTitle:'【流媒体】live555—VS2010 下live555编译、使用及测试[转]',
blogAbstract:'call \"E:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat\"cd liveMedianmake /B -f liveMedia.makcd ../groupsocknmake /B -f groupsock.makcd ../UsageEnvironmentnmake /B -f UsageEnvironment.makcd ../BasicUsageEnvironmentnmake /B -f BasicUsageEnvironment.makcd ../testProgsnmake /B -f testProgs.mak',
blogTag:'',
blogUrl:'blog/static/38',
isPublished:1,
istop:false,
modifyTime:8,
publishTime:8,
permalink:'blog/static/38',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}1350人阅读
live555(5)
live555一般都是编译成静态的库,但是引用的时候需要注意他的顺序。如果引用的库正确而顺序不正确会出现找不到函数的错误。
正确的引用顺序是:libliveMedia.a &&libBasicUsageEnvironment.a &&libgroupsock.a &&libUsageEnvironment.a
liveMedia要放在其他的前面
例如在qtcreator中加入live555的静态就是:
unix:!macx: LIBS += $$PWD/../live/liveMedia/libliveMedia.a &$$PWD/../live/BasicUsageEnvironment/libBasicUsageEnvironment.a &$$PWD/../live/groupsock/libgroupsock.a &&$$PWD/../live/UsageEnvironment/libUsageEnvironment.a
注意使用qtcreator中add library添加的库中是LIBS += -LlibPath -llib 这个是针对动态库的,静态库不需要加-L。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:323289次
积分:3691
积分:3691
排名:第6205名
原创:43篇
转载:135篇
评论:44条
(3)(1)(1)(1)(1)(1)(2)(1)(1)(1)(1)(1)(2)(2)(4)(4)(1)(2)(4)(6)(2)(3)(3)(3)(4)(1)(7)(3)(8)(4)(4)(5)(3)(13)(1)(6)(4)(6)(26)(4)(2)(1)(5)(16)(1)(2)(1)Live555 与客户端的交互解析
Live555 与客户端的交互解析
1. 为什么有 RTSP?这要从 RTP 说起。RTP 是实时传输协议。具体请参考 RFC3550(http://www.ietf.org/rfc/rfc3550.txt)。RTP 在实际应用中,是被动推送的方式。即如下图的流程。&&则将会产生如下对话:(M: Media S C: Client)C:谁给我发视频呢?M:我!C:谁让你给我发视频的?M:主人。C:我现在又不用,你发给我干嘛?M:主人让我发的,我也不知道为啥要发。C:……M:我只能持续的发,发啊发…..C:发你妹~!我死了。M:那我还是要发,我又不知道你死了,发啊发……C,M:主人傻×。&&&& RTP 的被动发送方式,使得不管客户端是否准备好接收视频流,是否异常死掉,媒体服务都会不断往外发送视频流。这种处理方式是不符合实际业务逻辑的。正常的业务逻辑应该是,客户端要视频,媒体服务才发送视频;客户端不要视频了,媒体服务停止发送视频;客户端异常死掉了,媒体服务应该能检测到,并停止发送视频。 所以,实际解决方式有两种:I. 发送到组播组,由网络设备控制。即,媒体服务发送到一个组播地址,客户端加入到组播组后,由网络设备发送视频。当客户端退出组播组,网络设备停止发送给客户端。所有的控制均由组播协议IGMP 相关进行控制。II. 通过 RTSP 协议。其实 RTSP 协议就是一个媒体服务的控制协议。请参考RFC2326(http://www.ietf.org/rfc/rfc2326.txt)。请翻译下面一段话。The Real Time Streaming Protocol, or RTSP, is an application-level protocol for control over the delivery of data with real-time properties.2. 下载 Live555 源码及 VLC1.1.9 版本下载 Live555 源码,并解压。(/liveMedia/public/live555-latest.tar.gz)下载slamtv60.264(/liveMedia/public/264/slamtv60.264),并放置到 live 源码下的 mediaServer 目录。下载 VLC1.1.9 版本http://download.videolan.org/pub/videolan/vlc/1.1.9/win32/vlc-1.1.9-win32.7z3. 编译 Live555不编译 testProg 及 proxyServer 目录,没用也耗时。修改 Makefile.tail 文件,注释加'#'号vim Makefile.tailall:&&& cd $(LIVEMEDIA_DIR) ; $(MAKE)&&& cd $(GROUPSOCK_DIR) ; $(MAKE)&&& cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE)&&& cd $(BASIC_USAGE_ENVIRONMENT_DIR) ; $(MAKE)&&& #cd $(TESTPROGS_DIR) ; $(MAKE)&&& cd $(MEDIA_SERVER_DIR) ; $(MAKE)&&& #cd $(PROXY_SERVER_DIR) ; $(MAKE)install:&&& cd $(LIVEMEDIA_DIR) ; $(MAKE) install&&& cd $(GROUPSOCK_DIR) ; $(MAKE) install&&& cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) install&&& cd $(BASIC_USAGE_ENVIRONMENT_DIR) ; $(MAKE) install&&& #cd $(TESTPROGS_DIR) ; $(MAKE) install&&& cd $(MEDIA_SERVER_DIR) ; $(MAKE) install&&& #cd $(PROXY_SERVER_DIR) ; $(MAKE) installclean:&&& cd $(LIVEMEDIA_DIR) ; $(MAKE) clean&&& cd $(GROUPSOCK_DIR) ; $(MAKE) clean &&& cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) clean&&& cd $(BASIC_USAGE_ENVIRONMENT_DIR) ; $(MAKE) clean&&& #cd $(TESTPROGS_DIR) ; $(MAKE) clean&&& cd $(MEDIA_SERVER_DIR) ; $(MAKE) clean&&& #cd $(PROXY_SERVER_DIR) ; $(MAKE) clean修改 config.linux,修改编译器vim config.linuxC_COMPILER = gccCPLUSPLUS_COMPILER = g++LINK = g++ -o生成 Makefile,执行命令./genMakefile linux编译程序,执行命令make经过一长串文字之后,会在 mediaServer 目录下,生成 live555MediaServer。若没生成,请从头执行。&4. 打开 Live555 的调试信息修改 UsageEnvironment/include 目录下的 UsageEnvironment.hh 文件,加入宏定义vim UsageEnvironment/include/UsageEnvironment.hh#ifndef _USAGE_ENVIRONMENT_HH#define _USAGE_ENVIRONMENT_HH#define DEBUG 1 // added by jeremy#ifndef _USAGEENVIRONMENT_VERSION_HH重新编译,执行命令make这样 Live555 里面很多 fprintf(stderr, ...)的信息,就能显示了。5. 启动 Live555执行命令cd mediaServer./live555MediaServer & log.txt 2&&1 重启一个命令行窗口,cd 到 live 源码目录下的 mediaServer 目录,执行命令cat log.txt查看 rtsp 地址及端口&解释命令&&& & log.txt 是将打印信息保存到 log.txt 文件中。&&& 2&&1 是将 stderr 输出到 stdout从图可以看到 rtsp 访问地址为 rtsp://192.168.1.198:8554/slamtv60.264。解释&&& where &filename& is a file present in the current directory. 请自己翻译。&&& 8554 是因为没用 sudo 用户,无法绑定到 554 端口。最新开的命令行窗口,执行命令tail -f log.txt此命令将会不断刷新 log.txt 的内容到屏幕上。6. 启动客户端宿主机 windoz 上,开始-&运行-&cmd执行命令cd vlc-1.1.9vlc -vvv --extraintf=logger rtsp://192.168.1.198:8554/slamtv60.264最后一条命令,是用命令行开启 vlc,并在后台开启调试窗口,同时打开 URL。如果操作无问题,那么这时应该播放视频了。请播放 30 秒后,按 VLC 的停止播放按钮。 7. 获取日志Live555 日志都保存到了虚拟机 log.txt 中VLC 的日志都在后台,通过拖选,右键,复制到剪贴板后,新建个文本文件,进行保存。8. 分析 Live555 的日志从 Live555 的 log.txt 日志,我们可以看到整个的处理流程。accept 连接并显示内容accept()ed connection from 192.168.1.98RTSPClientConnection[0x154eca0]::handleRequestBytes() read 132 new bytes:OPTIONS rtsp://192.168.1.198:8554/slamtv60.264 RTSP/1.0CSeq: 2User-Agent: LibVLC/1.1.9 (LIVE555 Streaming Media v)可以看到地址是 192.168.1.98,使用的库是 LibVLC/1.1.9,它使用的 Live555的库是
版本。解析获取到 Option 请求,url 是 slamtv60.264 parseRTSPRequestString() succeeded, returning cmdName "OPTIONS", urlPreSuffix "", urlSuffix "slamtv60.264", CSeq "2", Content-Length 0, with 0 bytes following the message.send 回应信息sending response: RTSP/1.0 200 OKCSeq: 2Date: Fri, Sep 27 :08 GMTPublic: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETERLive555 支持的请求有 OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER接收到请求RTSPClientConnection[0x154eca0]::handleRequestBytes() read 158 new bytes:DESCRIBE rtsp://192.168.1.198:8554/slamtv60.264 RTSP/1.0CSeq: 3User-Agent: LibVLC/1.1.9 (LIVE555 Streaming Media v)Accept: application/sdp解析为 Describe,并解析了 url 对应的文件的信息parseRTSPRequestString() succeeded, returning cmdName "DESCRIBE", urlPreSuffix "", urlSuffix "slamtv60.264", CSeq "3", Content-Length 0, with 0 bytes following the message.H264VideoStreamParser::parse() EXCEPTION (This is normal behavior - *not* an error)Parsed 22-byte NAL-unit (nal_ref_idc: 3, nal_unit_type: 7 ("Sequence parameter set"))profile_idc: 77constraint_setN_flag: 64level_idc: 51seq_parameter_set_id: 0log2_max_frame_num_minus4: 3pic_order_cnt_type: 0log2_max_pic_order_cnt_lsb_minus4: 4max_num_ref_frames: 1gaps_in_frame_num_value_allowed_flag: 0pic_width_in_mbs_minus1: 23pic_height_in_map_units_minus1: 17frame_mbs_only_flag: 1frame_cropping_flag: 0vui_parameters_present_flag: 1BEGIN vui_parametersaspect_ratio_info_present_flag: 0overscan_info_present_flag: 0video_signal_type_present_flag: 0chroma_loc_info_present_flag: 0timing_info_present_flag: 1num_units_in_tick: 2time_scale: 102fixed_frame_rate_flag: 1Set frame rate to 25.500000 fpsPresentation time: .31899822 bytes @.318998, fDurationInMicroseconds: 0 ((0*.500000) Parsed 4-byte NAL-unit (nal_ref_idc: 3, nal_unit_type: 8 ("Picture parameter set"))Presentation time: .3189984 bytes @.318998, fDurationInMicroseconds: 0 ((0*.500000)Parsed 3017-byte NAL-unit (nal_ref_idc: 2, nal_unit_type: 1 ("Coded slice of a non-IDR picture"))Presentation time: .318998*****This NAL unit ends the current access unit*****3017 bytes @.318998, fDurationInMicroseconds: 39215 ((1*.500000)Parsed 3081-byte NAL-unit (nal_ref_idc: 2, nal_unit_type: 1 ("Coded slice of a non-IDR picture"))Presentation time: .358213*****This NAL unit ends the current access unit*****3081 bytes @.358213, fDurationInMicroseconds: 39215 ((1*.500000)Parsed 2836-byte NAL-unit (nal_ref_idc: 2, nal_unit_type: 1 ("Coded slice of a non-IDR picture"))Presentation time: .397428*****This NAL unit ends the current access unit*****2836 bytes @.397428, fDurationInMicroseconds: 39215 ((1*.500000)回应 Describe 请求sending response: RTSP/1.0 200 OKCSeq: 3Date: Fri, Sep 27 :08 GMTContent-Base: rtsp://192.168.1.198:8554/slamtv60.264/Content-Type: application/sdpContent-Length: 525v=0o=- 8916 1 IN IP4 192.168.1.198s=H.264 Video, streamed by the LIVE555 Media Serveri=slamtv60.264t=0 0a=tool:LIVE555 Streaming Media va=type:broadcasta=control:*a=range:npt=0-a=x-qt-text-nam:H.264 Video, streamed by the LIVE555 Media Servera=x-qt-text-inf:slamtv60.264m=video 0 RTP/AVP 96c=IN IP4 0.0.0.0b=AS:500a=rtpmap:96 H264/90000a=fmtp:96 packetization-mode=1;profile-level-id=4D4033;sprop-parametersets=Z01AM5JUDAS0IAAAAwBAAAAM0eMGVA==,aO48gA==a=control:track1application/sdp 说明下面从 v=0 开始,是 264 文件的 sdp 信息。可以看到客户端接收端口是 接收到请求RTSPClientConnection[0x154eca0]::handleRequestBytes() read 189 new bytes:SETUP rtsp://192.168.1.198:8554/slamtv60.264/track1 RTSP/1.0CSeq: 4User-Agent: LibVLC/1.1.9 (LIVE555 Streaming Media v) Transport: RTP/AVP;client_port=解析请求并回应parseRTSPRequestString() succeeded, returning cmdName "SETUP", urlPreSuffix "slamtv60.264", urlSuffix "track1", CSeq "4", Content-Length 0, with 0 bytes following the message.sending response: RTSP/1.0 200 OKCSeq: 4Date: Fri, Sep 27 :08 GMTTransport: RTP/AVP;destination=192.168.1.98;source=192.168.1.198;client_port=;server_port=Session: BB58AEA2协议 RTP/AVP,目的地 192.168.1.98,源 192.168.1.198,客户端端口 ,服务端端口 ,session 号 BB58AEA2接收到请求RTSPClientConnection[0x154eca0]::handleRequestBytes() read 168 new bytes:PLAY rtsp://192.168.1.198:8554/slamtv60.264/ RTSP/1.0CSeq: 5User-Agent: LibVLC/1.1.9 (LIVE555 Streaming Media v)Session: BB58AEA2Range: npt=0.000-Range 是从 0 秒开始到最后。对应 sdp 里面的 a=range:npt=0-这一行。解析请求,并回应parseRTSPRequestString() succeeded, returning cmdName "PLAY", urlPreSuffix "slamtv60.264", urlSuffix "", CSeq "5", Content-Length 0, with 0 bytes following the message.RTCPInstance[0x15795c0]::RTCPInstance()schedule(1.797)sending REPORTsending RTCP packet80c8ca d5ef7d88 700b10 04 a05b17ca a0H264VideoStreamParser::parse() EXCEPTION (This is normal behavior - *not* an error)sending response: RTSP/1.0 200 OKCSeq: 5Date: Fri, Sep 27 :08 GMTRange: npt=0.000-Session: BB58AEA2RTP-Info: url=rtsp://192.168.1.198:8554/slamtv60.264/track1;seq=41987;rtptime=其中还启用了 RTCPInstance,进行 RTCP 监听,发送 RTCP 的 packet,内容就是从 80c80006 的一串数字。 再次解析文件Parsed 22-byte NAL-unit (nal_ref_idc: 3, nal_unit_type: 7 ("Sequence parameter set"))profile_idc: 77constraint_setN_flag: 64level_idc: 51seq_parameter_set_id: 0log2_max_frame_num_minus4: 3pic_order_cnt_type: 0log2_max_pic_order_cnt_lsb_minus4: 4max_num_ref_frames: 1gaps_in_frame_num_value_allowed_flag: 0pic_width_in_mbs_minus1: 23pic_height_in_map_units_minus1: 17frame_mbs_only_flag: 1frame_cropping_flag: 0vui_parameters_present_flag: 1BEGIN vui_parametersaspect_ratio_info_present_flag: 0overscan_info_present_flag: 0video_signal_type_present_flag: 0chroma_loc_info_present_flag: 0timing_info_present_flag: 1num_units_in_tick: 2time_scale: 102fixed_frame_rate_flag: 1Set frame rate to 25.500000 fpsPresentation time: .43265722 bytes @.432657, fDurationInMicroseconds: 0 ((0*.500000)Parsed 4-byte NAL-unit (nal_ref_idc: 3, nal_unit_type: 8 ("Picture parameter set"))Presentation time: .4326574 bytes @.432657, fDurationInMicroseconds: 0 ((0*.500000)Parsed 3017-byte NAL-unit (nal_ref_idc: 2, nal_unit_type: 1 ("Coded slice of a non-IDR picture"))Presentation time: .432657*****This NAL unit ends the current access unit*****3017 bytes @.432657, fDurationInMicroseconds: 39215 ((1*.500000)后台,已经开始发送视频了,没有相关的日志打印。接收到请求RTSPClientConnection[0x154eca0]::handleRequestBytes() read 158 new bytes:GET_PARAMETER rtsp://192.168.1.198:8554/slamtv60.264/ RTSP/1.0CSeq: 6User-Agent: LibVLC/1.1.9 (LIVE555 Streaming Media v)Session: BB58AEA2请求为 GET_PARAMETER解析并回应请求parseRTSPRequestString() succeeded, returning cmdName "GET_PARAMETER", urlPreSuffix "slamtv60.264", urlSuffix "", CSeq "6", Content-Length 0, with 0 bytes following the message. sending response: RTSP/1.0 200 OKCSeq: 6Date: Fri, Sep 27 :08 GMTSession: BB58AEA2Content-Length: 10后面都是解析 264 文件,类似下面的日志信息。有兴趣的可以对着代码深入研究。Parsed 3081-byte NAL-unit (nal_ref_idc: 2, nal_unit_type: 1 ("Coded slice of a non-IDR picture"))Presentation time: .471872*****This NAL unit ends the current access unit*****3081 bytes @.471872, fDurationInMicroseconds: 39215 ((1*.500000)收到保活信息并确认[0x15795c0]saw incoming RTCP packet (from address 192.168.1.98, port 61481)81c3d a05b17ca 00ffffff 00b
81ca0004 094a65 d504300RRRTSP client session (id "BB58AEA2", stream name "slamtv60.264"): Liveness indicationvalidated RTCP subpacket (type 2): 1, 201, 0, 0x8000353dUNSUPPORTED TYPE(0xca)validated RTCP subpacket (type 2): 1, 202, 12, 0x8000353dvalidated entire RTCP packet请留意 incomming 的 RTCP 包的地址及端口。RTCP 并不是从 554 发送的。Liveness indication,保活指示validated entire RTCP packet,确认整个 RTCP 包发送保活信息sending REPORTsending RTCP packet80c8ca d5ef7d8b a4dee9
caca a0schedule(1.793)停止播放时接收到的请求RTSPClientConnection[0x154eca0]::handleRequestBytes() read 153 new bytes:TEARDOWN rtsp://192.168.1.198:8554/slamtv60.264/ RTSP/1.0CSeq: 7User-Agent: LibVLC/1.1.9 (LIVE555 Streaming Media v)Session: BB58AEA2解析并回应请求parseRTSPRequestString() succeeded, returning cmdName "TEARDOWN", urlPreSuffix "slamtv60.264", urlSuffix "", CSeq "7", Content-Length 0, with 0 bytes following the message.RTCPInstance[0x15795c0]::~RTCPInstance()sending BYEsending RTCP packet 80c8ca d5ef7da8 bcd7c32
002d961c 81cbcasending response: RTSP/1.0 200 OKCSeq: 7Date: Fri, Sep 27 :40 GMTRTCP 发送 BYE 信息。关掉连接RTSPClientConnection[0x154eca0]::handleRequestBytes() read -1 new bytes (of 10000); terminating connection!10. 分析 VLC1.1.9 的日志上面的 OPTIONS、DISCRIBE SETUP PLAY TEARDOWN 命令的请求和发送,均能在 VLC 的日志里面找到对应。举个栗子:Sending request: OPTIONS rtsp://192.168.1.198:8554/slamtv60.264 RTSP/1.0CSeq: 2User-Agent: LibVLC/1.1.9 (LIVE555 Streaming Media v)Received 152 new bytes of response data.Received a complete OPTIONS response:RTSP/1.0 200 OKCSeq: 2Date: Fri, Sep 27 :08 GMTPublic: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER[031da168] live555 demux debug: RTP subsession 'video/H264'Sending request: SETUP rtsp://192.168.1.198:8554/slamtv60.264/track1 RTSP/1.0CSeq: 4User-Agent: LibVLC/1.1.9 (LIVE555 Streaming Media v)Transport: RTP/AVP;client_port=Received 204 new bytes of response data.Received a complete SETUP response:RTSP/1.0 200 OKCSeq: 4Date: Fri, Sep 27 :08 GMTTransport: RTP/AVP;destination=192.168.1.98;source=192.168.1.198;client_port=;server_port=Session: BB58AEA2超时时间[031da168] live555 demux debug: We have a timeout of 60 seconds60 秒超时?没有仔细研究。看日志或许是这样。&使用 rtcp 保活[031da168] live555 demux debug: tk-&rtpSource-&hasBeenSynchronizedUsingRTCP() 所有 rtcp 相关的操作,没有体现在日志中,所以无法看到发送 rr 包。10. 关于 RTSP 的保活RTSP 的保活有两种方式:发送 RTCP 包,如上所述。详情参考 RTCP RFC3605(http://tools.ietf.org/html/rfc3605)发送 PLAY 和 GET_PARAMETER 请求在 RTSP 的 RFC 里面有这样两段话,说的很清楚,请自己翻译。If a stream is playing, such a PLAY request causes no further action and can be used by the client to test server liveness.GET_PARAMETER with no entity body may be used to test client or server liveness ("ping")11. 把流程图形化&&这样的流程图,是不是很符合逻辑。So Perfect。12. 写在最后关于保活,还可以做一个实验,在正常播放时,用任务管理器,把 VLC 砍掉(结束进程树),造成客户端异常死掉的情况,看看 Live555 是如何处理的?这个当课后作业吧。以上是转载与狗哥一篇博文:/higoge
发表评论:
TA的最新馆藏[转]&

我要回帖

更多关于 live555 rtsp server 的文章

 

随机推荐