Accurate seek when using HTTP Pseudostreaming in Flash

我的未来我决定 提交于 2020-01-04 10:40:06

问题


Good day!

I've faced one problem when developing my video player in AS3. I use HTTP pseudostreaming for FLV and MP4 (here is a description of pseudostreaming: http://flowplayer.org/plugins/streaming/pseudostreaming.html)

The problem: The size distribution over flv/mp4 file is not linear, so seeking based on (stream.bytesLoaded / stream.bytesTotal) * video.duration is not accurate.

My solution

For this solution we need to have keypoints\seekpoints in video file (you will need the anyway) at the beginning of the file.

  1. User clicks on seek bar, we calculate target seek time in seconds

  2. We check if target time is already buffered: 2.1. if so -- just seek using NetStream.seek() 2.2. if target time is not loaded -- found neares seekpoint using table of keypoints in file metadata and perform switch to the new URL with added ?start=...

Using this technique I can get accurate seek, but the overall approach is a bit tricky.

Is there any better way?


回答1:


Just in case anybody needs help on this topic, here is osmf plugin you can use to accomplish pseudostreaming using flex's videoplayer:

Github link



来源:https://stackoverflow.com/questions/7498482/accurate-seek-when-using-http-pseudostreaming-in-flash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!