1、h264文件的推送
testH264VideoStreamer.cpp文件的開頭就定義了
char const* inputFileName = "test.264";
后面接着創建了會話
ServerMediaSession* sms
= ServerMediaSession::createNew(*env, "testStream", inputFileName,
"Session streamed by \"testH264VideoStreamer\"",
True /*SSM*/);
也就是將test.264文件,取出一幀一幀的數據並推送到rtsp://host_ip:port/testStream
本實例運行如下
2、實時碼流的推送
實時流的推送只需要將如上h264文件的定義改成一個fifo
mkfifo /tmp/test.264
char const* inputFileName = "/tmp/test.264";
然后將camera采集的數據編碼成h264的格式存到這個緩存,testH264VideoStreamer就可以將緩存的h264視頻數據推送出去.
例如像樹梅派將camera數據編碼到test.264緩存.
raspivid -o /tmp/test.264 -t 0 -d
這里就不拿板子出來運行了,這里http://www.cnblogs.com/dong1/p/5095739.html,有個testOnDemandRTSPServer實例,
跟testH264VideoStreamer一樣的功能.
3、live555\testProgs里還有個testOnDemandRTSPServer.cpp 實例
參考
https://blog.csdn.net/firehood_/article/details/16844397
https://blog.csdn.net/caoshangpa/article/details/53200527
記得修改makefile
DynamicRTSPServer.$(CPP): DynamicRTSPServer.hh
DynamicRTSPServer.$(CPP): DynamicRTSPServer.hh