Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
0.1.0 pre-release
  • Loading branch information
radiantmediaplayer committed Jul 2, 2018
1 parent fdb9737 commit 0fa89f9
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# node
node_modules/
debug.log

# VSC
.vscode
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
# rmp-create-vtt-thumbnails

An helper script to easily create VTT files that works with [Radiant Media Player preview thumbnails feature](https://www.radiantmediaplayer.com/docs/latest/preview-thumbnails.html).

First you will need to create a mosaic of thumbnails with FFmpeg [as described here](https://www.radiantmediaplayer.com/docs/latest/preview-thumbnails.html#preview-thumbnails-ffmpeg).

Once this is done you can download this script to automatically create a VTT file that will work with this mosaic of thumbnails in [Radiant Media Player](https://www.radiantmediaplayer.com).

For more information on the VTT format used [see this documentation section](https://www.radiantmediaplayer.com/docs/latest/preview-thumbnails.html#preview-thumbnails-introduction).

This script (create.js) is in alpha stage and may need improvement. It has been tested for node.js 8.11+ on Windows 10.

## Usage from the command line
```
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.

## Parameters docs

`node create.js duration spriteFileLocation outputVTTFileName gapBetweenFrames thumbnailWidth thumbnailHeight tileSize`

`duration`: content duration in seconds

`spriteFileLocation`: location for the mosaic image (a.k.a. sprite image)

`outputVTTFileName`: location to write the output VTT file related to the input `spriteFileLocation`

`gapBetweenFrames`: the gap in seconds between frame extraction

`thumbnailWidth`: the thumbnail width within the mosaic

`thumbnailHeight`: the thumbnail height within the mosaic

`tileSize`: the tile format used to generate the mosaic (example 11 for 11x11, 6 for 6x6 ...)

## Issues
Issues should be submitted in this GitHub page. We will do our best to review them.

## License
rmp-create-vtt-thumbnails is released under MIT

Radiant Media Player has its own license which can be found here: [https://www.radiantmediaplayer.com/terms-of-service.html](https://www.radiantmediaplayer.com/terms-of-service.html)
8 changes: 7 additions & 1 deletion create.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env node

/**
* @license Copyright (c) 2015-2018 Radiant Media Player
* rmp-create-vtt-thumbnails 0.1.0 | https://github.com/radiantmediaplayer/rmp-create-vtt-thumbnails
*/

'use strict';

const fs = require('fs');
Expand Down Expand Up @@ -84,7 +90,7 @@ process.argv.forEach((value, index) => {
// delete VTT file if already exists
try {
fs.unlinkSync(outputVTTFileName);
console.log(outputVTTFileName + ' already exist - deleted it');
console.log(outputVTTFileName + ' already exists - deleted it');
} catch (err) {
if (err && err.code === 'ENOENT') {
console.log(outputVTTFileName + ' does not exist - will create it');
Expand Down
25 changes: 25 additions & 0 deletions license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
MIT License

rmp-create-vtt-thumbnails is released under MIT License.
Terms are outlined below (from opensource.org)

Radiant Media Player | https://www.radiantmediaplayer.com
Copyright (c) 2015-2018 Radiant Media Player

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "rmp-create-vtt-thumbnails",
"version": "0.1.0"
}

0 comments on commit 0fa89f9

Please sign in to comment.