多媒体_live555构建流媒体服务器(1)
本文关键词:流媒体,由笔耕文化传播整理发布。
live555构建流媒体服务器(1)
读test.264码流文件,,客户端可以通过ffplay.exe rtsp: xxx播放出来。
直接使用编译好的库,改自testOnDemandRTSPServer.cpp
#include
#include comment (lib, "Ws2_32.lib")
#pragma comment (lib, "BasicUsageEnvironment.lib")
#pragma comment (lib, "groupsock.lib")
#pragma comment (lib, "liveMedia.lib")
#pragma comment (lib, "UsageEnvironment.lib")
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,
* inputFileName); newMatroskaDemuxWatchVariable;
static MatroskaFileServerDemux* demux;
) {
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(, ); // replace these with real strings
// Repeat the above with each 本文关键词:流媒体,由笔耕文化传播整理发布。
本文编号:216192
本文链接:https://www.wllwen.com/wenshubaike/jajx/216192.html