Adobe has finally added a new codec to the Flash Player for video capture!.The latest build includes the H.264 codec for ENCODING, meaning you can capture your local webcam from within Flash Player and broadcast a live stream to FMS without having to use a desktop app such as Flash Media Live Encoder
Encoding H.264 is actually pretty processor-intensive, and you’ll theoretically be capturing at higher quality that you would with Spark, so there may be some significant latency and dropped frames if you aren’t careful with your settings. (The API allows for Baseline or Main profiles, with levels from 1 to 5.1 for you encoding gurus out there.)
The H264VideoStreamSettings is the subclass of the VideoStreamSettings class that enables specifying video compression settings for each NetStream. All parameters (resolution, frame rate, bandwidth, etc.) are gated by Cameracapture parameters. You can use methods (setMode(), etc.) to specify desired encoder parameters and you can use the properties (width, etc.) to retrieve the actual compression parameters used. Properties will be validated once Camera is attached to NetStream object and compression has started.
Note Current implementation does not support setting properties per NetStream and Camera parameters will be used instead for each publishing NetStream.
var cam:camera = Camera.getCamera();
var ns:netStream = new NetStream(nc);
ns.client = this;
ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();
h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_5_1);
h264Settings.setQuality(0,0);
h264Settings.setKeyFrameInterval(15);
h264Settings.setMode(width,height,fps);
ns.videoStreamSettings = h264Settings;
ns.attachCamera(cam);
ns.publish("livestream", "live");
THe difference between H264 Profiles is that , low powered older mobile devices need a lower version of videos to play as they do not have that much processing powere in CPU, so they use H264 Baseline profile. Newer and more powerful phones support better Profile like the h264 Main profile.
Desktop and laptops can play all of them(i am 95% sure on this). For each mobile device or tablet you can find out in their specifications whihc h264 profiles theysupport. And then you need to encode your videos in that H264 profile in order for them to play on that device. Something similar with the levels. I think if you google on h264 you find more info on this.
