在 AS3 中,当使用 NetStream 进行视频播放时,当我使用appendBytes 时如何查找
我正在尝试使用 NetStream 从 byteArray 播放。请参阅此了解我正在谈论的内容。
我能够让它播放视频。但现在我需要能够看到特定的一秒。我无法做到这一点。如果我浏览字节数组,我知道我可以根据需要获取元数据和关键帧以及每个关键帧所在位置的偏移量(以字节为单位)。然而,没有办法寻求特定的偏移量。它只支持以秒为单位的查找,这似乎不适用于 byteArray。
我该怎么办?
I am trying to use NetStream to play from a byteArray. Please see this for what I am talking about.
I am able to get this to play the video. However now I need to be able to see to a particular second. I am not able to do this. If I go through the bytearray I know I can get the metadata and the keyframes as required and the offset ( in bytes) as to where each keyframe is at. However there is no way to seek to a particular offset. It only supports seek in seconds and that doesn't seem to work on the byteArray.
How do I go about this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我得到了我的工作:
I got I worked:
每个 flv 标签都有一个时间戳和偏移量。
您可以在此处找到 FLV 规范:http://download.macromedia.com/f4v/video_file_format_spec_v10_1。 pdf
您无法在任何位置播放视频。您必须从标签的开头开始,这样您就需要找到时间最接近您要查找的时间的标签。
你会想要做这样的事情:
Each flv tag has a timestamp and offset.
You can find the FLV spec here: http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf
You can't play the video at any position. You must start at the beginning of a tag so you will need to find the tag with a time nearest to the time you want to seek to.
You're going to want to do something like this:
尝试我在此处发布的代码作为示例如何在不需要 FLV 元数据中存在“关键帧”的情况下完成查找。还有一个 可用于测试的工作演示(使用带有 H264 和 AAC/MP3 音频的 FLV)。
该代码部分是为了回答这个问题(如果您需要额外的信息/上下文)
Try my code posted here for an example of how seeking is done without needing "keyframes" to exist in FLV metadata etc. There is also a working demo available to test (use FLV with H264 and AAC/MP3 audio).
That code was partly to answer this question (if you need additional info/context)