[AS3]as3做摄像头直播H264VideoStream的示例
[AS3]as3做摄像头直播H264VideoStream的示例
[AS3]as3做摄像头直播H264VideoStream的示例
- import flash.media.H264VideoStreamSettings;
- import flash.media.VideoStreamSettings;
- import flash.media.H264Level;
- import flash.media.VideoCodec;
- import flash.media.H264Profile;
- var myNS:NetStream = new NetStream(nc);
- var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();
- h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_5_1);
- h264Settings.setMode(320,240,15);
- h264Settings.setQuality(0,100);
- myNS.videoStreamSettings = h264Settings;
- myNS.publish("livestream","live");
- ---------------------以上代码没有效果只能开始摄像头工作,再换下面一段试试
- video.attachVideo(Camera.get());
- video.attachAudio(Microphone.get());
- //CuPLayer.com提示:可以理解为在nc连接上绑一个流
- var nsOut:NetStream = new NetStream(nc);
- //CuPLayer.com提示:在流上加麦克风和视频头
- nsOut.attachVideo(Camera.get());
- nsOut.attachAudio(Microphone.get());
- nsOut.publish("livestream", "live");
- ----------------这段代码在as2中能通过,但是屏幕不显示录像的图片,
- 晕,现在是在as3,肯定也通不过的,再换一段
- import flash.display.Sprite;
- import flash.media.Camera;
- import flash.media.Video;
- var camera:Camera;
- var video:Video;
- camera = Camera.getCamera();
- video = new Video(320,240);//CuPLayer.com提示:构造函数中的参数是宽度和高度,默认是320,240。
- video.attachCamera(camera);
- addChild(video);
[AS3]as3做摄像头直播H264VideoStream的示例
热门文章推荐
- [HLS]做自己的m3u8点播系统使用HTTP Live Streaming(HLS技术)
- [FMS]FMS流媒体服务器配置与使用相关的介绍
- [AS3]什么是M3U8,与HTML5的区别是什么
- AS2.0 让flash自适应全屏,并且不自动缩放
- [AS3]as3.0的sound类常用技巧整理
- [AS3]as3与ByteArray详解、ByteArray介绍、ByteArray用法
- 关于RTMP,RTMPT,RTMPS,RTMPE,RTMPTE协议的介绍
- [JS]分享浏览器弹出窗口不被拦截JS示例
请稍候...