Using seek() and PlayHeadTime() with FLVPlayback component of video files in Flash can be quite inaccurate. We had the same problem when we were building a prototype for our project, which involved switching and syncing of videos using specific timing. PlayHeadTime gave a decimal value, but whenever we would do a seek() using the PlayHeadTime value on a video, the timing would be off by 0.5-1 second.
Apparently, the accuracy of the seek() function is dependent on the keyFrameInterval of the video and the FPS meaning Precision = keyFrameInterval / FPS.
So for example, if you have a keyFrameInterval = 30 (1st frame will be a keyframe, 30th frame will be a keyframe, 60th frame … etc.) and FPS is set on 15, you’ll only be able to seek in 2-seconds intervals of time (precision = 30 / 15).
To make the seeking more accurate, set the key frame distance when exporting your video with Adobe Premiere. This option can be found in the “video” tab, “Advanced Settings”, check “Set Key Frame Distance” and set the key frame distance lower. Export it and now your seek() accuracy would be more precise!
Related Posts
December 19, 2011
Learning ROILA
The RObot Interaction Language (ROILA) is a new spoken language that is optimized for the communication between machines and humans
October 6, 2011
Visual Story Class
Visual Story is a storytelling/film class 2011. Team Promo and Retrofit assignment.
Entertainment Technology Center, Carnegie Mellon
February 20, 2014
Finding old AMD ATI Graphics Drivers
2 Comments
Add comment Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Wowww..
Does this mean if I set it to 1 (A key frame every frame), I will get a 100% accuracy ??
If your video is for example on 30 fps and you set the key frame distance to 1 key, you’ll get a precision of 1/30 second-intervals of time between each frame. It’s technically not 100% accurate, but the interval is so small that you probably wouldn’t notice any difference when seeking through the video 🙂