ActionScript 3的空气 - 视频制作闪烁跳跃 [英] ActionScript 3 AIR — Video make blink jump

查看:174
本文介绍了ActionScript 3的空气 - 视频制作闪烁跳跃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做的iOS和Android使用ActionScript 3和Adobe AIR的(3.7)的建立IPA和APK应用程序。在此应用中,我打开一个视频从FLV和场景中的添加。 问题是,在仿真器或闪存来看,一切正常,但是,在iPad上的(和测试上的iPad 1,2 3具有相同的结果)的视频使短裤跳的(像由短跳入时间线突然冻结后续)的每2 secondes约。

I make an application for iOS and Android using ActionScript 3 and Adobe AIR ( 3.7 ) to build the ipa and apk. In this application, I load a Video from an FLV and add it in the scene. The problem is, on the emulator or the Flash view, all is ok, but, on the iPad ( test on iPad 1, 2 and 3 with same results ) the video makes shorts jumps ( like a sudden freeze follow by a short jump into the time-line ) every 2 secondes, approximately.

当然,我请确保该视频是不是在其他元素或以上的移动剪辑。我尝试加载视频未经界面的其余部分:同样的结果。更改中将renderMode为直接或GPU,没有...输出不同质量的视频,并保证没有redimensionnement的(即使在8的倍数的尺寸)的,没有了。

Of course, I make sure that the video wasn't under other elements or above moving clips. I try to load the video without the rest of the interface : same result. Change the renderMode to "direct" or "gpu", no... Export the video in different quality and assure no redimensionnement ( Even with a dimension in a multiple of 8 ), no again.

我用这个code相似载入我的视频的(这是考验code我用的是河畔,这个问题是不是在我的code其他地方)

I use a similarity of this code to load my video ( It's the test code I use to be sur that the problem wasn't elsewhere in my code )

var myVideo:Video = new Video();
this.addChild(myVideo);

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

ns.client = { onMetaData:ns_onMetaData, NetStatusEvent:ns_onPlayStatus };

myVideo.attachNetStream(ns);

ns.play("myLink.flv");

var ns_onMetaData:* = function(item:Object):void {  }

var ns_onPlayStatus:* = function(event:NetStatusEvent):void {}

ns.addEventListener(NetStatusEvent.NET_STATUS, ns_onPlayStatus);

在此先感谢和抱歉,我的英语不好

Thanks in advance and sorry for my bad english

推荐答案

您不应该在iOS设备上使用的FLV。这是我个人的猜测,为什么你所看到的跳跃。 FLV是德软件codeD,所以它是比较慢的。我个人的猜测是遇到丢帧而视频被德codeD。

You should not use FLV on iOS devices. That is my personal guess as to why you are seeing the "jump". FLV is software decoded, so it is relatively slow. My personal guess is you are experiencing dropped frames while the video is being decoded.

在iOS(和所有的移动设备,真的),你要使用H.264视频与 MP4 的扩展名( M4V 将工作在iOS上,而不是在Android上,我相信)。对于播放,你要为使用的StageVideo 的StageWebView ,而不是AS3的视频播放器。的StageVideo将使使用该设备的实际媒体框架。的StageWebView只能在iOS和一定的Andr​​oid设备,并会呈现使用该设备的实际媒体播放器。

On iOS (and all mobile devices, really), you want to use h.264 video with an mp4 extension (m4v will work on iOS, but not on Android, I believe). For playback, you want to use either StageVideo or StageWebView rather than an AS3-based video-player. StageVideo will render using the actual media framework of the device. StageWebView will only work on iOS and certain Android devices, and will render using the actual media player of the device.

这之间的区别和视频的FLVPlayback (或Flex或者OSMF的视频播放器)是视频将是硬件加速/日codeD。这意味着您的应用程序的渲染时间(以及视频渲染时间)不会也被有多快,视频德codeD,因为一个单独的芯片将处理它决定。

The difference between this and Video or FLVPlayback (or the Flex or OSMF-based video players) is that the video will be hardware accelerated/decoded. This means that your app's render time (and thus the video render time) will not also be dictated by how fast the video is decoded because a separate chip will be handling it.

此外,硬件加速视频会多,对电池寿命要好得多。我跑了测试去年在iPad 3的电池寿命软件/ CPU去codeD FLV和硬件去codeD H.264消耗之间的差异在30%附近的某个地方。

Additionally, hardware accelerated video will be much, much better on battery life. I ran a test last year on an iPad 3 and the difference between battery life consumed by software/CPU decoded FLV and hardware decoded h.264 was somewhere in the neighborhood of 30%.

请记住,这两个选项不呈现显示列表上。的StageWebView呈现显示列表的上方和下方的StageVideo呈现。

Keep in mind that both of these options do not render in the display list. StageWebView renders above the display list and StageVideo renders below.

我建议观看视频我的previous答案呈现在AIR的移动应用程序也是如此。我已经进入了更详细的有关移动在过去的AIR视频。我已经建立了三个视频点播使用空气的流动,现在的应用程序,它绝对是一个棘手的任务。

I suggest viewing my previous answers on video render in an AIR for Mobile app as well. I have gone into more detail about video in AIR for mobile in the past. I have built three video-on-demand apps using AIR for Mobile now and it is definitely a delicate task.

<一个href="http://stackoverflow.com/questions/16010572/netstream-http-video-not-playing-on-ios-device/16021558#16021558">NetStream HTTP视频不打IOS设备

<一个href="http://stackoverflow.com/questions/16820583/optimizing-video-playback-in-air-for-ios/16821001#16821001">Optimizing在AIR视频播放的iOS

<一个href="http://stackoverflow.com/questions/14516296/how-to-implement-stagevideo-in-adobe-air-for-android/14525861#14525861">How在Adobe AIR实现的StageVideo为Android?

希望这是对你有所帮助。

Hopefully this is of some help to you.

这篇关于ActionScript 3的空气 - 视频制作闪烁跳跃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆