Generate a VTT file and mosaic of thumbnails for Radiant Media Player preview thumbnails feature
A helper script to easily create VTT files that works with Radiant Media Player preview thumbnails feature (could work with other players that follow the same VTT-based preview thumbnails implementation).
This process has been tested for node.js 8.11+ on Windows 10 and Ubuntu 16 LTS.
First you will need to create a mosaic of thumbnails with FFmpeg:
ffmpeg -i input.mp4 -filter_complex "select='not(mod(n,120))',scale=128:72,tile=11x11" -frames:v 1 -qscale:v 3 -an mosaic.jpg
A couple of things to notice from the above commande line:
The WebVTT file consists of a list of cues with the following data:
To automatically create that VTT file, install the create.js script from this repository:
git clone https://github.com/radiantmediaplayer/rmp-create-vtt-thumbnails.git
cd rmp-create-vtt-thumbnails
node create.js 596 assets/bbb-sprite.jpg output/bbb-thumbnails.vtt 5 128 72 11
See assets/ folder for ready-to-use mosaic image examples. See output/ folder for examples of VTT files generated with the create.js script.
node create.js duration spriteFileLocation outputVTTFileName gapBetweenFrames thumbnailWidth thumbnailHeight tileSize
All parameters are mandatory.
duration
: content duration in seconds
spriteFileLocation
: location for the mosaic image (a.k.a. sprite image) to reference in the resulting VTT file
outputVTTFileName
: location for the produced output VTT file
gapBetweenFrames
: the gap in seconds between frame extraction (value used for generating the mosaic image with FFmpeg)
thumbnailWidth
: the width of each thumbnail within the mosaic
thumbnailHeight
: the height of each thumbnail within the mosaic
tileSize
: the tile format used to generate the mosaic (value used for generating the mosaic image with FFmpeg: 11 for 11x11, 6 for 6x6 ...)
Issues should be submitted in this GitHub page. We will do our best to review them.
rmp-create-vtt-thumbnails is released under MIT.
Radiant Media Player is a commercial HTML5 media player, not covered by the above MIT license.
Radiant Media Player license can be found here: https://www.radiantmediaplayer.com/terms-of-service.html.
You may request a free trial for Radiant Media Player at: https://www.radiantmediaplayer.com/free-trial.html.