librtmp 设计为客户端 用于请求直播流和推送直播流,而非服务器
http://blog.csdn.net/gubenpeiyuan/article/details/38089013?utm_source=tuicool&utm_medium=referral 不错的
1.rtmp 推流
<span style="white-space:pre"> </span>fp_send1 = fopen("cuc_ieschool.h264", "rb");
//初始化并连接到服务器
while(1)
{
bool bConnect = RTMP264_Connect("rtmp://127.0.0.1:1234/live/stream");//("rtmp://localhost/publishlive/livestream");
printf("connect to rtmp://127.0.0.1:1234/stream/live ............\n");
if(bConnect)
break;
Sleep(1000);
}
//while(1)
{
//发送
RTMP264_Send(read_buffer1);
Sleep(10);
}
//断开连接并释放相关资源
RTMP264_Close();
Sleep(10);
}
return 0;
2.fms (flash media server )环境配置
下载安装FMS4.5
在view Application 创建New instance --->live/stream
3.播放FMS 直播视频
在FMS安装目录下找到D:\Program Files\Adobe\Flash Media Server 4.5\samples\videoPlayer 打开videoplayer.html 输入播放url即可播放