I think the article you linked to (http://support.jwplayer.com/customer/portal/articles/1407439-adding-preview-thumbnails) must have been updated since asking this question. As of my posting JW Player supports using a single sprite that (as best as I can tell) only loads once the video starts playing. So your VTT file looks something like:
WEBVTT
00:00.000 --> 00:05.000
/assets/thumbnails.jpg#xywh=0,0,160,90
00:05.000 --> 00:10.000
/assets/preview2.jpg#xywh=160,0,320,90
00:10.000 --> 00:15.000
/assets/preview3.jpg#xywh=0,90,160,180
00:15.000 --> 00:20.000
/assets/preview4.jpg#xywh=160,90,320,180
Except the example they provide isn't very good because you would want to use the same file (also it doesn't seem to like relative URIs). What I do is have ffmpeg generate thumbnails every n seconds with a fixed width then combine them into a single image with imagemagick's convert
with +append
command. Then knowing the length of the video (can be determined with ffprobe
) and the fixed width of the individual thumbnails it is trivial to generate the VTT file.
After I typed this out I see the question is tagged with jwplayer6
. I am using version 7; it's quite possible this only applies to the newer version. I'm going to go ahead and post anyway in case someone may find it useful.
Edit: It looks like some other folks have a similar approach for generating a thumbnail sprite with a more in-depth explanation and reusable code for download. My implementation details vary somewhat but the overall idea is basically the same. Worth checking out.