无需播放视频即可捕获帧阵列,然后在 flash/flex 客户端中向后播放

发布于 2024-10-31 09:11:32 字数 217 浏览 0 评论 0原文

我见过一些关于拍摄正在播放的视频帧的屏幕截图的帖子。我正在寻找一种向后播放视频并且通常一次移动一帧的方法。理想情况下,我能够从 Flash 视频中提取特定 i 帧之前和之后的帧。

对于这个问题来说,最重要的是能够在不实际播放视频的情况下提取帧。我在 SO 上找到的所有解决方案都需要播放视频,然后它们基本上只是将屏幕打印为位图。

在动作脚本中是否可以提取单个视频帧以使单帧向前和向后前进?

I've seen a few posts out there that have dealt with taking a screenshot of a playing video frame. I'm looking for a way to play video backwards and generally move around at a frame at a time. Ideally I'd be able to extract out frames from flash video before and after a particular i-frame.

Most importantly to this question is the ability to extract the frames, without actually playing the video. All the solutions I've found on SO require the video to be playing, then they essentially just print the screen to a bitmap.

Is is possible in actionscript to extract out the individual video frames to enable single frame advance both forward and backward?

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

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

发布评论

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

评论(3

沫离伤花 2024-11-07 09:11:32

我认为如果不先播放内容就没有办法。但是......您可以在流式视频(不一定在显示列表中)播放时按顺序bitmapdata.draw每一帧,直到您有一大堆位图可供导航。这有两个大问题:

一是显然,您只能访问已经播放过的帧。这可能会通过应用程序中发生的任何其他情况来处理 - 假设用户在视频流式传输/被捕获时正在与一些介绍内容进行交互。

另一个可能无法克服的问题是内存。您流式传输内容的原因是您不会始终在内存中保留全部 24 兆(或其他)的 flv。这种情况意味着您必须这样做。话虽这么说,取决于帧的大小/数量 - 这可能不是一个大问题。

坦率地说,如果您决定走这条路,您最好将视频分解为 Flash 之外的帧(在 After Effects 或 Premier 中),并将它们嵌入到 swf 中(或单独加载它们)。无论如何,这意味着您可以更好地控制压缩。

也许这有帮助?

I don't think there is a way, without first playing content. But... you could sequentially bitmapdata.draw each frame as a streamed video (not necessarily in the display list) plays, until you have one large array of bitmaps to navigate through. There's two big problems with this:

One, obviously, is that you would only have access to the frames that have already played. This might be dealt with by whatever else is happening in your app - say a user is interacting with some introduction content while the video is streaming/being captured.

The other, maybe insurmountable, problem is with memory. The reason you stream content is so that you don't have all 24 megs (or whatver) of the flv in memory at all time. This type of scenario would mean that you would have to. That being said, depending on the size / number of frames - this may not be such a big issue.

Frankly, if you decide to go this route, you'd be better breaking the video into frames outside of flash (in after effects or premier), and embedding them with the swf (or loading them individually). It would mean you would have better control over compression, at any rate.

Maybe that helps ?

沩ん囻菔务 2024-11-07 09:11:32

您的部件组合令人困惑,但是...

能够捕获帧数组:

bitmapData.draw(video);

无需播放视频:

netStream.pause();

然后向后播放:

netStream.step(-1);

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html

Your combination of the parts is confusing, but...

Ability to capture array of frames:

bitmapData.draw(video);

without having to play video:

netStream.pause();

then play backwards:

netStream.step(-1);

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html

也只是曾经 2024-11-07 09:11:32

如果您使用关键帧间隔 1(即所有帧都是关键帧)对视频文件进行编码,则向后导航视频是没有问题的。这会增加文件的大小,但使您可以在播放时立即跳转到任何帧。

Navigating a video backwards is no problem if you encode the video file it with a keyframe interval of 1 (that is when all frames are keyframes). That increases the size of the file but gives you the possibility to instantly jump to any frame on playback.

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