用 flashmediaserver 做在线视频录音

作者:袖梨 2022-07-02

flashmediaserver 非常好实现的

给你几段AS代码吧.

播放
nc = new NetConnection();
nc.connect("rtmp://127.0.0.1/cam02");
res = new NetStream(nc);
view.attachVideo(res);
view.attachAudio(res);
res.play("2");

录象
var cam = Camera.get();
if (cam == null)
{
    nocamerror.text = "没有摄像头n或设备正被占用中";
}
else
{
//从麦和设像头显示视频
my_video.attachVideo(cam);
my_video.attachAudio(Microphone.get());
//连接
nc = new NetConnection();
nc.connect("rtmp://127.0.0.1/flash");
nsOut = new NetStream(nc);
nsOut.attachVideo(cam);
nsOut.attachAudio(Microphone.get());
//发布2.flv
nsOut.publish("2");
}

相关文章

精彩推荐