as3.0应用h.264的视频编码

要启用FlashPlayer11中的h.264编码需要导入以下几个类:
import flash.media.H264VideoStreamSettings;
import flash.media.VideoStreamSettings;
import flash.media.H264Level;
import flash.media.VideoCodec;
import flash.media.H264Profile;
然后生成一个H264VideoStreamSettings对象并设置相关属性:
var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();
h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_5_1);
h264Settings.setMode(320,240,15);
h264Settings.setQuality(0,100);
最后,将该对象附加在原来要发布的NetStream上就可以了:
myNS.videoStreamSettings = h264Settings;
myNS.publish(streamName,"live");

你可能感兴趣的:(as3)