无需播放视频即可捕获帧阵列,然后在 flash/flex 客户端中向后播放
我见过一些关于拍摄正在播放的视频帧的屏幕截图的帖子。我正在寻找一种向后播放视频并且通常一次移动一帧的方法。理想情况下,我能够从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为如果不先播放内容就没有办法。但是......您可以在流式视频(不一定在显示列表中)播放时按顺序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 ?
您的部件组合令人困惑,但是...
能够捕获帧数组:
无需播放视频:
然后向后播放:
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:
without having to play video:
then play backwards:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html
如果您使用关键帧间隔 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.