Linux基于Live555从网络摄像机获取rstp实时264视频流并转发1、编译生成库
从上下载,下载地址:www.live555/liveMedia/public/,选择下载
解压:tar xzf
修改权限: chmod +777 live -R
修改交叉编译工具:cp config.armlinux cp config.arm
vi config.arm
CROSS_COMPILE?= arm-buildroot-linux-uclibcgnueabi-
生成Makefile : ./genMakefiles arm
make
生成mediaServer /live555MediaServer
使用H.264文件测试:live555MediaServer test.264
获取IP 错误一直为127.0.1.1 或0.0.0.0
而机器IP 为127.0.0.1 & 192.168.55.3
内核不支持端口复用需要注释掉groupsock/GroupsockHelper.cpp SO_REUSEPORT
2、添加获取实时帧类
参考:wwwblogs/leixiaohua1020/p/3902151.html
创建rtsp server
创建对话
static ServerMediaSession* createNewSMS(UsageEnvironment& env,
char const* fileName, FILE* /*fid*/) ServerMediaSession* sms = NULL;
sms->addSubsession(H264LiveVideoServerMediaSubsession
::createNew(env, fileName, reuseSource));
获取video
FramedSource*
H264LiveVideoServerMediaSubsession::createNewStreamSource (unsigned /*clientSessionId*/, unsigned& estBitrate)
H264LiveVideoSource* liveSource = H264LiveVideoSource::createNew(envir(), fChanID);
if (liveSource == NULL) return NULL;
// Create a framer for the Video Elementary Stream:
session下载return H264VideoStreamFramer::createNew(envir(), liveSource);
获取帧
H264LiveVideoSource::doGetNextFrame()
编译通过nfs运行
VLC 播放
代码下载地址:
download.csdn/download/xwu122930/10156693