I'm using FMLE 3.1 to stream live video encoded with H.264 format with FMS 3 and Flash player 10 + AS 3 to connect to the stream.
When I connect to the stream, just the audio is played. I'm able even to get the metadata information about the video, but I just receive the audio.
I already tried some stuff like
"Flash 10 won't play live stream H.264 after iTunes install" http://forums.adobe.com/thread/505620. I tested it in a complete different environment than mine, but the same result.
I've tried some format to play method, but this is just to play files
ns.play("mp4:saple.f4v"); ns.play("mp4:sample");
Also read "How do you watch and record a live h.264" at "http://www.flashcomguru.co.uk/forum/forum_posts.asp?TID=4649", but I don't get even to play the stream at first place.
This is the code I'm using
import flash.media.Video;
var video:Video = new Video(720, 480);
var ncVideo = new NetConnection();
this.ncVideo.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
this.ncVideo.connect("rtmp://localhost/livecast", "user");
var customClient:Object = new Object();
customClient.onMetaData = metaDataHandler;
function onNetStatus(e:NetStatusEvent) {
if (e.info.code == "NetConnection.Connect.Success")
createNetStream();
}
function createNetStream(){
var ns = new NetStream(this.ncVideo);
ns.client = customClient;
ns.addEventListener(NetStatusE vent.NET_STATUS, onNsStatus);
ns.play("livestream", -1);
this.video.attachNetStream(ns) ;
this.addChild(video);
}
function onNsStatus(e) {
trace("onNsStatus " + e.info.code);
}
function metaDataHandler(infoObject:Object):void {
trace(infoObject.width + " - " + infoObject.height);
}
Another detail is that when I record the video to a file for instance "sample.f4v", I put this video in the FMS but when I connect to this stream I receive the "FileStructureInvalid" error message.
I went from changing the extension to .flv "http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player_04.html" to the solution to flatten the files "http://www.flashcomguru.com/forum/forum_posts.asp?TID=4006" but this is not the case because I'm using FMS to stream the recorded video.