I am creating a custom video player, I would like to add a video preview when the user hovers a progress bar.
I am able to generate thumbnails using FFmpeg as follows.
ffmpeg -i input -filter_complex \
"select='not(mod(n,60))',scale=240:-1,tile=layout=4x8" \
-vframes 1 -q:v 2 outputfile.jpg
PROBLEM
To use the above-created sprite image(combined thumbnails), I need to generate a WEBVTT which contains thumbnails and frames time interval like this below.
WEBVTT
00:00:00.000 --> 00:00:03.000
thumbnails.jpg#xywh=0,0,120,68
00:00:03.000 --> 00:00:06.000
thumbnails.jpg#xywh=120,0,120,68
00:00:06.000 --> 00:00:09.000
thumbnails.jpg#xywh=240,0,120,68
I am not able to find any FFmpeg command or tutorial on how to create such WEBVTT file using node-js and FFmpeg.
Maybe someone here knows the solution to this problem? any help will be appreciated.