我使用 FMLE 3.1 流式传输以 H.264 格式编码的实时视频,并使用 FMS 3 和 Flash Player 10 + AS 3 连接到流。
当我连接到流时,仅播放音频。我什至可以获得有关视频的元数据信息,但我只收到音频。
我已经尝试过一些东西,例如
“安装 iTunes 后 Flash 10 不会播放实时流 H.264” http://forums.adobe.com/thread/505620。我在与我的环境完全不同的环境中进行了测试,但结果相同。
-
我尝试过一些格式的播放方法,但这只是播放文件
ns.play("mp4:saple.f4v");
ns.play("mp4:样本");
另请阅读“如何观看和录制现场 h.264”,网址为“http://www.flashcomguru.co.uk/forum/forum_posts.asp?TID=4649 ”,但我什至无法首先播放该流。
这是我正在使用的代码
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);
}
另一个细节是,当我将视频录制到文件(例如“sample.f4v”)时,我将此视频放入 FMS 中,但是当我连接到此流时,我收到“FileStructureInvalid”错误消息。
我将扩展名更改为 .flv“http://www.adobe。 com/devnet/flashplayer/articles/hd_video_flash_player_04.html”到压平文件的解决方案“http://www.flashcomguru.com/forum/forum_posts.asp?TID=4006" 但事实并非如此,因为我正在使用 FMS 流式传输录制的视频。
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.
发布评论
评论(1)
SE_0208 回答:“您可以升级到 3.0.5 并尝试您的方案吗 - 在点版本中修复了相当多的 H.264 错误 - 它的免费更新”,这就是解决方案。
在发行说明中,没有与我的上下文相关的具体内容,但也许这是一组内容。
1628134:此版本不支持在服务器上录制 H.264 内容。
1656058:在传输损坏的文件(尤其是包含 H.264/AAC 内容的文件)时,无法保证服务器行为,并且可能会导致性能严重下降、内存使用过多以及可能的服务器进程崩溃等问题。请在部署前使用 FLVCheck 工具确保内容完整性。
1630621:如果缓冲区设置得太短,帧速率非常低的 H264 视频可能需要很长时间才能启动。
SE_0208 answered: "Can you upgrade to 3.0.5 and try your scenario - there were quite a few H.264 bugs were fixed in dot releases - its free update " and that was the solution.
In the release notes there is not something specific related with my context, but maybe that was a group of things.
1628134: Recording H.264 content on the server is not supported in this version.
1656058: The server behavior is not guaranteed when streaming corrupted files, especially those containing H.264/AAC content, and may result in issues ranging from severe performance degradation, excessive memory usage and possibly server process crashes. Please use FLVCheck tool to ensure content integrity before it is deployed.
1630621: Very low frame rate H264 videos may take a long time to start if the buffer is set too short.