Skip to content

bradmax-com/bradmax-thumbnails-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Bradmax

thumbnails tool


Shell script to generate thumbnail images from video file with vtt file as thumbnails descriptor. Require ffmpeg and ffprobe to be installed.

There are two wasy to generate thumbnails for video file:

  • as spritesheets. Images are merged into sprites sheets (flag -spritesheets ). These is default behaviour.
  • as thumbnails. Each thumbnail as separated image file (flag -thumbnails ).

Options:

  • required
    --input (-i) - [string] path to ffmpeg input video file.
    --output (-o) - [string] path to output directory.

  • optional
    -spritesheets - when flag is added will generate image sprite files with thumbnails (default).
    -thumbnails - when flag is added will generate single image for each thumbnail.
    -poster - when flag is added will also generate poster image with random frame from input video.
    --timespan (-t) - [integer] time span (in seconds) between each thumbnail, default 10 sec. It will generate thumbnail every 10 seconds.
    --width (-w) - [integer] width (in pixels) of each thumbnail, default 160 px.
    --name (-n) - [string] base name for generated files, default 'spritesheet' when -spritesheets or 'thumbnail' when -thumbnails flag is enabled.
    --vtt-name - [string] override base name (-n) for VTT file. When provided generated vtt file path will be "[--output]/[--vtt-name].vtt".
    --img-name - [string] override base name (-n) for image files. When provided generated images path will be "[--output]/[--img-name].jpg".
    --img-dir - [string] base dir for image files. When provided generated images path will be "[--output]/[--img-dir]/[--(img-)name].jpg".
    --ss-cols - [integer] (optional) Number of image columns for spritesheets (default 6). --ss-rows - [integer] (optional) Number of image rows for spritesheets (default 5). --help (-h) - display help message.

Note:

When flag -spritesheets is enabled script will probe video file to find best match for image grid dimmentions based on provided video file duration and --timespan option value. Then You will need to choose one of proposed grid sizes. Best grid sizes are ones that do not have unused thumbnail spaces. For example if video duration is 30 seconds, thumbnails -timespan set to 10 (seconds) and choosed grid size is 2x2, then 1 thumbnail space will be unused, because (30s / 10s) = 3, but 2x2 = 4,

Usage:

$ thumbnails.sh -i /input/video.mp4 -o /output/directory

or:

$ thumbnails.sh -thumbnails -poster -i /input/video.mp4 -o /output/directory -w 160 -t 10 --vtt-name thumbnails --img-dir thumbs --img-name thumb


About

Shell script to generate thumbnail images from video file with vtt file as thumbnails descriptor.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages