从使用Nestream AppendBytes(AS3)解码的视频中获取位图? [英] Getting Bitmap from Video decoded with Nestream AppendBytes (AS3)?

查看:129
本文介绍了从使用Nestream AppendBytes(AS3)解码的视频中获取位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在 Flash 中处理过NetStream.appendBytes的人是否知道如何从解码的视频帧中获取bitmapData?我已经看过 此问题 ,但这是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)

问题在于,即使我使用的是byteArray(来自与SWF相同目录中的本地视频文件),仅使用bitmapdata.draw(video_container);也无法正常工作,但会引发策略文件错误.甚至没有互联网参与其中,但Flash告诉我"No Policy File granted permission from the server"或这样的废话.我认为错误只是纾困,而不是直截了当地说您不允许这样做."

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 Player知道SWF的位置以及该SWF本地的任何文件.当您将String作为URL等传递时可以,但是当Netstream数据不在SWF域本地时,则它成为策略文件问题.问题是我的数据不在SWF之类的文件夹中,因此无法存储在中,因为它无法对"字节数组进行轮询",对此有任何已知的解决方法吗? ...(我什至无法说出我真正想使用的字词.

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图像解码器,而Loader是JPEG到位图解码器或LoadCompressed..是MP3-to-PCM解码器.您知道,访问原始材料(这里是RGB像素),应用一些效果功能,然后发送到屏幕或保存到磁盘.

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-to-Bitmap decoder or LoadCompressed.. is an MP3-to-PCM decoder. You know, access the raw material (here RGB pixels), apply some 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('');

// ...

希望可以提供帮助.

这篇关于从使用Nestream AppendBytes(AS3)解码的视频中获取位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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