Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to set up a pseudostreaming site that has timed subtitles for h264 video files that are served via nginx_mod_h264_streaming + JW Player. The subtitles are automatically converted to a format that JW player can read, which is a PHP script that takes a viewer's current location in the video and spits out an XML-like file that has subtitle lines and their starting+ending timestamps, relative to where the viewer is.

Whenever the viewer loads the stream page then, the video is automatically-seeked to its proper place relative to a starting time stored in a MySQL DB, and the subtitles are also seeked forward properly. The user doesn't see any of this; he or she just sees him or herself at the proper place in the video.

My issue is that the subtitle timestamps need to be pretty accurate, and that nginx_mod_h264_streaming can only seek to the closest keyframe in the video, which is pretty frequently displaced a significant amount of time from where the user should be seeked. I'm under the impression that this isn't a problem that can really be fixed; you can only really seek to a keyframe if you want to display the video properly.

What I'm wondering is this: is there any way to read the time that the video is actually seeked to, or maybe even the keyframe number so I can at least display the subtitles properly? I can't find anything in the JW Player docs to indicate a way of doing this; if another player is capable of this, I'd be open to switching.

Thanks much for your help!

share|improve this question

1 Answer 1

I believe you can use javascript to get that:

jwplayer("container").getPosition();

Where container is the id of the JWPlayer container element, or without, if there is only one JW Player on the page:

jwplayer().getPosition();

http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12540/javascript-api-reference#GettingStarted

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.