如何播放单个 NetStream 但在不同的视频对象上显示它的不同部分?

发布于 2024-10-12 09:32:32 字数 160 浏览 1 评论 0原文

我的 3D 视频在每一帧上并排编码了每只眼睛的内容。我想做的是将左半部分放在右半部分上。 (然后我将更改颜色和叠加,以便佩戴蓝青色 3D 眼镜的人可以观看视频)。

我尝试将单个 NetStream 附加到两个视频对象并偏移它们,但这只能让流在一个对象上播放。

有什么建议吗?

I have 3D videos encoded with each eye's content side-by-side on each frame. What I want to do is take the left-half and over-lay it on the right-half. (I'll then change with the colors and the overlaying so that someone with blue-cyan 3D glasses can view the video).

I tried to attach a single NetStream to two video objects and offset them, but that only let the stream play on one object.

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

二智少女猫性小仙女 2024-10-19 09:32:32

由于 根据定义或多或少是连续的小数据流,而不是固定长度的对象,您永远不能同时访问 NetStream 的两个不同位置。您可以尝试在帧与帧之间的位置之间“跳跃”,产生一种“快门”效果,但这可能效果不佳。

但是,您可以让视频对象共享相同的 NetConnection,并让两个 NetStream 实例加载同一部电影,或者您可以在两个单独的 FLV 中同时播放左眼和右眼的内容。不过,您必须注意同步,并且可能会出现轻微的不一致。

如果您的目标是 Flash Player 10.1 或更高版本,则可以将两个 FLV 作为 byteArray 加载到内存中,然后使用 NetStream.appendBytes 播放它们。这应该可以解决同步问题。

Since a stream is by definition a more or less continuous flow of small bits of data, rather than an object of fixed length, you can never access two different positions of a NetStream at the same time. You could try to "jump" between positions from frame to frame, producing a kind of "shutter" effect , but that would probably not perform well.

You can, however, let the video objects share the same NetConnection, and have two NetStream instances load the same movie, or you could just have your content for the left eye and right eye in two separate FLVs playing at the same time. You would have to take care of synchronization, though, and there might by slight inconsistencies.

If you are targeting Flash Player 10.1 or later, you can load both FLVs into memory as a byteArray, and then use NetStream.appendBytes to play them. This should take care of the synching problems.

起风了 2024-10-19 09:32:32

从那时起,我就知道如何实现我想要的目标。

伪代码:

bmd1 = new BitmapData(...);
bmd2 = new BitmapData(...);
bmp1 = new Bitmap(bmd1);
bmp2 = new Bitmap(bmd2);
addChild(bmp1);
addChild(bmp2);

onEnter {
  bmd1.draw(video, ...transformations)
  bmd2.draw(video, ...transformations)
}

然后将 bmp1 和 bmp2 组织到您想要的位置,并进行相应的转换。

I've since figured out how to accomplish what I want.

pseudo-code:

bmd1 = new BitmapData(...);
bmd2 = new BitmapData(...);
bmp1 = new Bitmap(bmd1);
bmp2 = new Bitmap(bmd2);
addChild(bmp1);
addChild(bmp2);

onEnter {
  bmd1.draw(video, ...transformations)
  bmd2.draw(video, ...transformations)
}

then organize bmp1 and bmp2 to be where you want the pieces to be, and transform accordingly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文