Visual studio 2010 流媒体时,live media server每次发送多少字节
我有下面的直播媒体库代码,因为我试图理解它,我想知道直播媒体服务器在流式传输视频文件test1.264时每次发送多少字节?? 如何查找流媒体时间,我拔出头发却找不到,有谁能帮我找到上述查询……Visual studio 2010 流媒体时,live media server每次发送多少字节,visual-studio-2010,visual-c++,streaming,live,rtsp,Visual Studio 2010,Visual C++,Streaming,Live,Rtsp,我有下面的直播媒体库代码,因为我试图理解它,我想知道直播媒体服务器在流式传输视频文件test1.264时每次发送多少字节?? 如何查找流媒体时间,我拔出头发却找不到,有谁能帮我找到上述查询…… #include "liveMedia.hh" #include "BasicUsageEnvironment.hh" UsageEnvironment* env; // To make the second and subsequent client for each stream reuse th
#include "liveMedia.hh"
#include "BasicUsageEnvironment.hh"
UsageEnvironment* env;
// To make the second and subsequent client for each stream reuse the same
// input stream as the first client (rather than playing the file from the
// start for each client), change the following "False" to "True":
Boolean reuseFirstSource = False;
// To stream *only* MPEG-1 or 2 video "I" frames
// (e.g., to reduce network bandwidth),
// change the following "False" to "True":
Boolean iFramesOnly = False;
static void announceStream(RTSPServer* rtspServer, ServerMediaSession* sms,
char const* streamName, char const* inputFileName); // fwd
static char newMatroskaDemuxWatchVariable;
static MatroskaFileServerDemux* demux;
static void onMatroskaDemuxCreation(MatroskaFileServerDemux* newDemux, void* /*clientData*/) {
demux = newDemux;
newMatroskaDemuxWatchVariable = 1;
}
int main(int argc, char** argv) {
// Begin by setting up our usage environment:
TaskScheduler* scheduler = BasicTaskScheduler::createNew();
env = BasicUsageEnvironment::createNew(*scheduler);
UserAuthenticationDatabase* authDB = NULL;
#ifdef ACCESS_CONTROL
// To implement client access control to the RTSP server, do the following:
authDB = new UserAuthenticationDatabase;
authDB->addUserRecord("username1", "password1"); // replace these with real strings
// Repeat the above with each <username>, <password> that you wish to allow
// access to the server.
#endif
// Creating the RTSP server:
RTSPServer* rtspServer = RTSPServer::createNew(*env, 8554, authDB);
if (rtspServer == NULL) {
*env << "Failed to create RTSP server: " << env->getResultMsg() << "\n";
exit(1);
}
char const* descriptionString
= "Session streamed by \"testOnDemandRTSPServer\"";
// A H.264 video elementary stream:
{
char const* streamName = "h264ESVideoTest";
char const* inputFileName = "test1.264";
ServerMediaSession* sms
= ServerMediaSession::createNew(*env, streamName, streamName,
descriptionString);
sms->addSubsession(H264VideoFileServerMediaSubsession
::createNew(*env, inputFileName, reuseFirstSource));
rtspServer->addServerMediaSession(sms);
announceStream(rtspServer, sms, streamName, inputFileName);
}
if (rtspServer->setUpTunnelingOverHTTP(80) || rtspServer->setUpTunnelingOverHTTP(8000) || rtspServer->setUpTunnelingOverHTTP(8080)) {
*env << "\n(We use port " << rtspServer->httpServerPortNum() << " for optional RTSP-over-HTTP tunneling.)\n";
} else {
*env << "\n(RTSP-over-HTTP tunneling is not available.)\n";
}
env->taskScheduler().doEventLoop(); // does not return
return 0; // only to prevent compiler warning
}
static void announceStream(RTSPServer* rtspServer, ServerMediaSession* sms,
char const* streamName, char const* inputFileName) {
char* url = rtspServer->rtspURL(sms);
UsageEnvironment& env = rtspServer->envir();
env << "\n\"" << streamName << "\" stream, from the file \""
<< inputFileName << "\"\n";
env << "Play this stream using the URL \"" << url << "\"\n";
delete[] url;
}
#包括“liveMedia.hh”
#包括“BasicUsageEnvironment.hh”
使用环境*env;
//使每个流的第二个和后续客户端重用相同
//作为第一个客户端的输入流(而不是从
//为每个客户端启动),将以下“False”更改为“True”:
布尔reuseFirstSource=False;
//流*仅*MPEG-1或2视频“I”帧
//(例如,减少网络带宽),
//将以下“False”更改为“True”:
布尔iFramesOnly=False;
静态流(RTSPSServer*RTSPSServer、ServerMediaSession*sms、,
字符常量*流名称,字符常量*输入文件名);//前轮驱动
静态字符newMatroskaDemuxWatchVariable;
静态MatroskaFileServerDemux*demux;
MatroskaFileServerDemux*newDemux,void*/*clientData*/)创建时的静态void{
demux=新demux;
newMatroskaDemuxWatchVariable=1;
}
int main(int argc,字符**argv){
//首先设置我们的使用环境:
TaskScheduler*scheduler=BasicTaskScheduler::createNew();
env=BasicUsageEnvironment::createNew(*调度器);
UserAuthenticationDatabase*authDB=NULL;
#ifdef访问控制
//要实现对RTSP服务器的客户端访问控制,请执行以下操作:
authDB=新用户身份验证数据库;
authDB->addUserRecord(“username1”、“password1”);//用实际字符串替换这些字符串
//对您希望允许的每个项目重复上述步骤
//访问服务器。
#恩迪夫
//创建RTSP服务器:
RTSPServer*RTSPServer=RTSPServer::createNew(*env,8554,authDB);
if(rtspServer==NULL){
*环境addServerMediaSession(sms);
宣告流(RTSPSServer、sms、streamName、inputFileName);
}
如果(rtspServer->setUpTunnelingOverHTTP(80)| | rtspServer->setUpTunnelingOverHTTP(8000)| | rtspServer->setUpTunnelingOverHTTP(8080)){
*env envir();
环境