获取位图的NetStream对appendBytes(AS3)后位图、NetStream、appendBytes

2023-09-08 14:57:29 作者:凡亽總難捨

我想知道如果谁处理了 NetStream.appendBytes 中的闪存知道如何获得的位图数据?我已经看了 this问题 ,但它是从3年前和最近的评论/答案似乎消失了。 2014 有没有人成功地把这些字节成位图?我工作的Flash Player 11.8,这是不是一个桌面/ AIR应用程序。

I am wondering if someone who has handled NetStream.appendBytes in Flash knows how to get the bitmapData from a decoded video frame? I have already looked at this question but that is from 3 years ago and the more recent comment/answer seems to be gone. In 2014 has anyone managed to turn those bytes into a bitmap? I am working with Flash Player 11.8 and this is not a desktop/AIR app.

在下面的图片,我可以做的步骤 1)和 2)但有一个砖墙第3步)

In the image below I can do steps 1) and 2) but there's a brick wall at step 3)

问题是,简单地使用的BitmapData.draw(video_container); 不起作用,而是它抛出,即使我使用的是的字节数组(从同一目录中的SWF本地视频文件)。没有互联网,甚至参与,但闪存告诉我,的任何策略文件授予的权限从服务器或者这样的废话。我认为错误只是纾困的直上说insteading你不能这样做。

The problem is that simply using bitmapdata.draw(video_container); does not work but instead it throws a Policy File error even though I am using a byteArray (from local video file in the same directory as the SWF). No internet is even involved but Flash tells me that "No Policy File granted permission from the server" or such nonsense. I think the error is just a bail-out insteading of straight up saying "You are not allowed to do this.."

我曾尝试:想反正安抚这个的crossdomain.xml 问题,并寻找到所有已知的安全/域设置。我来的错误是没有问题的,但问题的副作用。下面是该问题的结论: Flash播放器是知道的SWF的位置和当地给它的任何文件。这没关系,当你通过一个字符串作为URL等,但在的NetStream 的数据是不是本地的SWF域,那么它成为政策文件的问题。问题是我的数据在内存不喜欢的SWF文件夹,因此不能alllow 的BitmapData.draw ,因为它不能警察的字节数组,任何众所周知修复呢? ...(我甚至不能说,我真的想使用的话)。

I have tried: trying to appease this Crossdomain.xml issue anyway and looking into all known security/domain settings. I came to the conclusion that the error is not the problem but a side effect of the issue.. The issue here being that: Flash Player is aware of the SWF's location and of any files local to it. That's okay when you pass a String as URL etc but when the Netstream data is not local to the SWF domain then it becomes a Policy File issue. Problem is my data is in the Memory not in a folder like the SWF and therefore cannot alllow bitmapData.draw since it cannot "police" an array of bytes, any known fixes for this?... (I can't even say the words I really wanted to use).

我所试图实现的:是基本上可使用NetStream作为以同样的方式的H.263或H.264影像去codeR 装载机是JPEG德codeR或 LoadCom pressed .. 是一个MP3德codeR。要知道,访问原料(这里像素),应用效果的功能,然后发送到屏幕或保存到磁盘。

What I am trying to achieve: Is to essentially use Netstream as an H.263 or H.264 image decoder in the same way Loader is a JPEG decoder or LoadCompressed.. is an MP3 decoder. You know, access the raw material (here pixels), apply effects functions and then send to screen or save to disk.

推荐答案

我知道这是有点晚了,但我想我找到了你的问题的解决方案。

I know it is a little late, but I think I found a solution for your problem.

因此​​,为了避免在安全性违规#2123错误,你刚才做的是这样的:

So, to avoid the Security sandbox violation #2123 Error, you have just to do like this :

// ...

net_stream.play(null);

net_stream.play('');

// ...

希望能有所帮助。

Hope that can help.