Flex 4:两个 VideoDisplay 的交叉淡入淡出过渡不起作用
我正在尝试在 Flex 中在两个状态之间进行交叉淡入淡出转换,这两个状态都包含 VideoDisplay 对象。问题在于默认的 CrossFade 效果会获取两种状态的位图快照并在两者之间进行混合。这意味着电影在过渡期间似乎被冻结。
有人知道使用 PixelBender(GPU 加速)方法在两部电影之间进行淡入淡出的解决方案吗?我的另一种选择是手动重新排序视频对象并更改顶部视频对象的 alpha,但这会占用大量 CPU(在我的情况下为 ±300%)...
状态:
转换:
<s:transitions>
<s:Transition >
<s:CrossFade id="crossfader" target="{this}" duration="{fadeTime}" />
</s:Transition>
</s:transitions>
对象:
<components1:VideoDisplay
id="movie_attract"
width="640" x="0" height="480" y="0"
source="{configuration.movieAttract.source}"
includeIn="attract"
/>
<components1:VideoDisplay
id="movie_engage"
left="0" right="0" top="0" bottom="0"
source="{configuration.movieEngage.source}"
includeIn="engage"
/>
I'm trying to do a cross-fade transition in Flex between two states, both containing a VideoDisplay object. The problem is that the default CrossFade effect takes a bitmap snapshot of both states and blends between the two. This means that the movies appear to be frozen for the time of the transition.
Does anybody know of a solution that uses a PixelBender (GPU-accelerated) method of fading between two movies? My other option is to manually re-order the video objects and change the alpha of the top one, but this uses a lot of CPU (in my case ±300%)...
States:
Transition:
<s:transitions>
<s:Transition >
<s:CrossFade id="crossfader" target="{this}" duration="{fadeTime}" />
</s:Transition>
</s:transitions>
Objects:
<components1:VideoDisplay
id="movie_attract"
width="640" x="0" height="480" y="0"
source="{configuration.movieAttract.source}"
includeIn="attract"
/>
<components1:VideoDisplay
id="movie_engage"
left="0" right="0" top="0" bottom="0"
source="{configuration.movieEngage.source}"
includeIn="engage"
/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现使用 Spark Fade(而不是 CrossFade)对我来说效果(和执行)更好。
将 CrossFade 线替换为以下内容应该可行。
免责声明:我尚未使用当前正在播放视频的 VideoDisplay 对此进行测试。但即使对于暂停的视频,Fade 效果的表现也比 CrossFade 好得多。与 CrossFade 不同,淡入淡出很平滑,不生涩。我知道这并不能严格回答您的问题,但您可能想尝试一下。
I have found that using the Spark Fade (not CrossFade) works (and performs) better for me.
Replacing your CrossFade line with the following should work.
Disclaimer: I have not tested this with VideoDisplays that are currently playing a video. But even with paused videos, the Fade effect performed much better than CrossFade. Fade was smooth and not jerky, unlike CrossFade. I know this is not strictly answering your question, but you may want to try it out.