如何以不同的速度流畅播放FLV?
我需要以不同的速率显示 FLV 的帧。
以下是一些示例:
- 用户将“擦洗”FLV 帧(前/后),
- FLV 需要以用户交互时一半的速度播放。
目前我正在使用 LoaderMax 及其 VideoLoader 对象来加载和播放 FLV 文件。 我尝试使用 playProgress属性,但仅显示 FLV 的关键帧。我通过基本设置(使用 NetStream 类)得到了相同的结果。
作为解决方法,我播放 FLV 一次,并缓存 BitmapData 实例,在其中绘制/缓存视频的每一帧。完成此操作后,我使用 BitmapData Vector 更新舞台上的位图。使用这种方法,清理/更改速度效果很好,但用户仍然需要在序列被缓存时查看(等待)一次,这是我不喜欢的。
关于如何做到这一点有更好的想法吗?
任何提示都很有用, 谢谢!
I will need to display the frames of an FLV at different rates.
Here are some examples:
- the user will 'scrub' through the flv frames(front/back)
- the flv will need to play at half the speed on a user interaction.
Currently I'm using LoaderMax and it's VideoLoader object to load and play FLV files.
I've tried using the playProgress property, but only the keyframes of the FLV are displayed. I got the same result with the basic setup(using the NetStream class)
As a workaround, I playback the FLV once, and cache BitmapData instances in which I draw/cache each frame of the video. After this is done, I use the BitmapData Vector to update a Bitmap on stage. Scrubbing/changing speed works fine with this method, but still the user needs to see(wait for) the sequence once, while it gets cached, which I don't like.
Any better ideas on how to do this ?
Any tips are useful,
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢这个问题:它让我阅读了 flv 格式规范(来自第 74 页) 并开始编写一个基于 ByteArray 的解析器。据我了解有两种方法:
所以似乎可以将每个帧作为像素数据访问
另一个是将元数据中的帧速率设置为您喜欢的值,将flv写回ByteArray并保存到本地文件系统或使用
NetStream.appendBytes()
用于播放Thx for the question: it made me read flv format spec (from page 74) and start writing a
ByteArray
based parser. as far as i understood there're two ways:so it seems possible to access each frame as pixel data
another one is to set framerate in metadata to a value you like, write an flv back to ByteArray and save to local filesystem or use
NetStream.appendBytes()
for playback我以前见过这样做,但视频被导入到 Flash IDE 中,我们操纵了擦洗的时间线。我相信我们有慢动作播放版本的视频的第二个版本,并在两个影片剪辑之间切换。技术含量相当低的方法,并非没有问题,但我们解决了它们。我有一种感觉,使用渐进式下载的普通旧 flv 会很难做到这一点。
I've seen this done before but the video was imported into the flash ide and we manipulated the time line for the scrubbing. I believe we had a second version of the video for the slow motion play back version and switched between the two movieclips. Fairly low-tech method and wasn't without it's issues but we got round them. I have a feeling you're going to struggle to do this with a plain old flv using progressive download.